i want to edit and change the admin->catalog->product->edit->option attributes name i.e. price, point and weight to something else. I do it in admin/view/template/product-form.tpl but it does not reflect the change please help.
i change this:
<td class="text-left"><?php echo $entry_subtract; ?></td>
<td class="text-right"><?php echo $entry_price; ?></td>
to this
<td class="text-left"><?php echo "something"; ?></td>
<td class="text-right"><?php echo "something"; ?></td>
Related
I use OpenCart 1.5.6.4 and 2.3
In admin panel and in customer list there is no column for Customer Id
between this place:
For Opencart 2:
You need to edit this file:
admin/view/template/customer/customer_list.tpl
1)
Find:
<td class="text-left"><?php if ($sort == 'name') { ?>
Add before it:
<td class="text-left">Customer ID</td>
2)
Find:
<td class="text-left"><?php echo $customer['name']; ?></td>
Add before it:
<td class="text-left"><?php echo $customer['customer_id']; ?></td>
For Opencart 1:
This file:
admin/view/template/sale/customer_list.tpl
1)
Find:
<td class="left"><?php if ($sort == 'name') { ?>
Add before it:
<td class="left">Customer ID</td>
2)
Find:
<td class="left"><?php echo $customer['name']; ?></td>
Add before it:
<td class="left"><?php echo $customer['customer_id']; ?></td>
For sort customers by their id for Opencart 2 in step 1 add this code:
<td class="text-left">
<?php if ($sort == 'customer_id') { ?>
Customer ID
<?php } else { ?>
Customer ID
<?php } ?>
</td>
instead of:
<td class="text-left">Customer ID</td>
Then open this file:
admin/controller/customer/customer.php
Find:
$data['sort_name'] = $this->url->link('customer/customer', 'token=' . $this->session->data['token'] . '&sort=name' . $url, true);
Add before it:
$data['sort_customer_id'] = $this->url->link('customer/customer', 'token=' . $this->session->data['token'] . '&sort=customer_id' . $url, true);
In a HTML file with some PHP included
<table>
<tbody>
<tr>
<td>td1</td>
<td>td2</td>
</tr>
<tr>
<td colspan="3">
<?php echo 'something' ?>
</td>
<td>
<?php echo echo 'something' ?>
</td>
<td>
<?php echo 'something' ?>
</td>
</tr>
</tbody>
</table>
I'd like to find all <?php that comes after <td ...> + next line.
(Here not td1 and not td2)
Approach:
(?s)(<td.*?>)+(\n)... also matches <td>td1</td> and <td>td2</td>
What comes after (?s)(<td.*?>)?
To remove the <?php...?> you can replace (<td[^>]*>)\s*<\?php.*?\?> by $1:
Explaining:
(<td[^>]*>) # store in $1 what you want to retrieve
\s* # also match what you want to remove
<\?php.*?\?> # the php content
Then when replacing by $1 it will remove only \s*<\?php.*?\?> which depended on <td>
Hope it helps.
I want search in my product page for country.To search product by
country. For this i tried to edit the admin panel of virtuemart by
adding country to it.But, its not showing any dropdown.
Added in file- product_edit_information.php
<?php $i = 1 - $i; ?>
<tr class="row<?php echo $i?>">
<td ><div style="text-align:right;font-weight:bold;">
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_COUNTRY') ?></div>
</td>
<td colspan="3">
<select name="mprices[product_currency][0]" id="mpricesproduct_currency0" style="display: none;" class="chzn-done">
<option><?php echo $this->product->product_url; ?></option>
</select>
</td>
</tr>
But, no effect on the admin panel. See the screenshot below:
Also, if possible can anybody suggest a component or module or plugin for coupon system without premium.
I have a chunck of text in a file:
<tr bgcolor="#F9F9F9">
<td align="left">8/7/2012 11:23:42 AM</td>
<td align="left"><em>Here is the text I want to parse out</em></td>
<td class="ra">9.00</td>
<td class="ra">297.00</td>
<td class="ra">0.00</td>
<td class="ra">0.00</td>
<td class="ra">$0.00</td>
<td class="ra">$0.50</td>
<td class="ra"></td>
</tr>
using grep I would like to end up with the result being
Here is the text I want to parse out
Working on the code now I have
cat file.txt | grep -m 1 -oP '<em>[^</em>]*'
but that does not work... thanks for your help!
A correct regex would be (?<=<em>).*?(?=</em>).
So, try:
grep -m 1 -oP '(?<=<em>).*?(?=</em>)' file.txt
I want to display Product Viewed Report in Dashboard itself. Now the report id under Report->Products->Viewed
How to display it? I tried copying the code from admin->controller->report->product_viewed.php TO admin->controller->common->home.php
and copied the code from admin->view->report->product_viewed.tpl to admin->common->home.tpl
i have added code like this in home.tpl
<div class="content">
<table class="list">
<thead>
<tr>
<td class="left"><?php echo $column_name; ?></td>
<td class="left"><?php echo $column_model; ?></td>
<td class="right"><?php echo $column_viewed; ?></td>
<td class="right"><?php echo $column_percent; ?></td>
</tr>
</thead>
<tbody>
<?php if ($products) { ?>
<?php foreach ($products as $product) { ?>
<tr>
<td class="left"><?php echo $product['name']; ?></td>
<td class="left"><?php echo $product['model']; ?></td>
<td class="right"><?php echo $product['viewed']; ?></td>
<td class="right"><?php echo $product['percent']; ?></td>
</tr>
<?php } ?>
<?php } else { ?>
<tr>
<td class="center" colspan="4"><?php echo $text_no_results; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
in my admin panel-> dashboard i am getting error like this
Notice: Undefined variable: products in /Applications/MAMP/htdocs/opencart/admin/view/template/common/home.tpl on line 95Notice: Undefined variable: column_name in /Applications/MAMP/htdocs/opencart/admin/view/template/common/home.tpl on line 88 Notice: Undefined variable: column_model in /Applications/MAMP/htdocs/opencart/admin/view/template/common/home.tpl on line 89 Notice: Undefined variable: column_viewed in /Applications/MAMP/htdocs/opencart/admin/view/template/common/home.tpl on line 90 Notice: Undefined variable: column_percent in /Applications/MAMP/htdocs/opencart/admin/view/template/common/home.tpl on line 91
please help me in solving this? where i should declare this 'products' ?
What it looks like to me is that there are no results from the products viewed and you have done this transition almost perfectly.
You can either update the language files with the appropriate fields in admin>language>english>common>home.php or you can change the tpl a little like this
<div class="content">
<table class="list">
<thead>
<tr>
<td class="left">Product Name:</td>
<td class="left">Model:</td>
<td class="right">Viewed:</td>
<td class="right">Percent:</td>