Is there a way to display the product's SKU in the catalog ?
For example if there is something like a variable or tag to use in the code like in wordpress?
And also would be great if the search can work with SKUs as well..
Thanks.
For example if there is something like a variable or tag to use in the code like in wordpress?
And also would be great if the search can work with SKUs as well..
Thanks.
Last edited by i2Paq on Thu Feb 18, 2010 9:59 pm, edited 2 times in total.
Reason: Title fix + topic moved
Reason: Title fix + topic moved
1. EDIT: catalog/controller/product/product.php
2. FIND:
3. AFTER, ADD:
That will bring ALL product db values to be available from the tpl for any future fields you want to add later.
Now, you can display them where you want on the template
1. EDIT: catalog/view/theme/YOURTHEME/template/product/product.tpl
2. FIND:
3. AFTER, ADD:
2. FIND:
Code: Select all
$product_info = $this->model_catalog_product->getProduct($product_id);
Code: Select all
$this->data['product_info'] = $product_info;
Now, you can display them where you want on the template
1. EDIT: catalog/view/theme/YOURTHEME/template/product/product.tpl
2. FIND:
Code: Select all
<tr>
<td><b><?php echo $text_model; ?></b></td>
<td><?php echo $model; ?></td>
</tr>
Code: Select all
<tr>
<td><b>SKU</b></td>
<td><?php echo $product_info['sku']; ?></td>
</tr>
There is a topic about that: [MOD] how to widen search on my shop.electron wrote:Thanks!
That's exactly what i was asking for.
And another thing would be very nice if it was indexed by the search as well.
Thanks again !
I'm not sure it covers what you ask.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
How would I go about doing the same thing but for the header template, so I could use any product data there, such as the thumbnail or SKU? I'm guessing the file to edit is catalog/controller/common/header.php...?1. EDIT: catalog/controller/product/product.php
2. FIND:
$product_info = $this->model_catalog_product->getProduct($product_id);
3. AFTER, ADD:
$this->data['product_info'] = $product_info;
That will bring ALL product db values to be available from the tpl for any future fields you want to add later.
I've tried adding this, but with no luck:
Code: Select all
$this->data['product_info'] = $product_info;
I found the solution in this great extension
http://www.opencart.com/index.php?route ... on_id=1701
http://www.opencart.com/index.php?route ... on_id=1701
Mrlele wrote:Hello, I d like to do the same on the Category Page. I did it yesterday and it was working, did some change and cant figure it out how I did it earlier
Thank you for your help
Hi, i've the same problem! I need to show sku on the Category page.
I've do the same things to the controller->catalog>product->category.php and i've call on the category template: echo $product_info['sku'], but nothing appears.
Hello colleagues, I am from Bulgaria and I have a problem with my Opencart, I need help, I have the following errors: 2014-06-22 20:46:17 - PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'root'@'localhost' (using password: NO) in /home/xxxxxx/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php on line 538
2014-06-22 20:46:17 - PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/xxxxx/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php on line 538
2014-06-22 20:46:17 - PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/xxxxx/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php on line 538
Hi,
I created a new table column in the oc_product table named "link". I can print its values in the admin side but I can't print it's values to the front product page. I tried numerious ways to do that. But I couldn't get anything from db. There are some tutorials in the forum but all of them are for outdated versions of Opencart (like this). So none of them (neither this one) work unfortunately... I think I'm so close to the solution
Do you know anything to solve this problem?
Thank you,
VC
I created a new table column in the oc_product table named "link". I can print its values in the admin side but I can't print it's values to the front product page. I tried numerious ways to do that. But I couldn't get anything from db. There are some tutorials in the forum but all of them are for outdated versions of Opencart (like this). So none of them (neither this one) work unfortunately... I think I'm so close to the solution
Do you know anything to solve this problem?
Thank you,
VC
But you did not tell us, for wich Version you want this !platinum wrote:I got the sku to show up on my product page but how do i get it show up in the catalog view. LIST and GRID view. Thank you
Ernie
---
[VQMOD] SKU in Product List by viethemes free, OC v.2.0.0.0 - 2.2.0.0
http://www.opencart.com/index.php?route ... n_id=23091
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Who is online
Users browsing this forum: No registered users and 43 guests