Display SKU on Category Page Under Name

ThemeBurn SupportForumsOpenCart ThemesBurnEngineDisplay SKU on Category Page Under Name

This topic has been marked as not resolved.

Hello All,

I am looking for an option to display the SKU under the product name on the category page.

I’ve included a snap snot here. I’d like it to show up in the same place that “100 Count Package” currently is.

Is this possible?

Kyle

  • This reply was modified 2683 days ago by  honeybroker.
  • This reply was modified 2683 days ago by  honeybroker.
December 15, 2016 at 7:03 am #54334

Hi,

Can you try to use the attached vqmod?

BR,
ThemeBurn team

December 19, 2016 at 6:21 pm #54482

Thank you so much for the reply. I took the code you gave me and edited a little.

Essentially what I wanted to do was create the option to split the product name into two lines. The first line being the name and the second line being a descriptor. I was not using the sku and the mpn fields so I used them to put the data I wanted displayed in the database.

I edited the code to have an if statement in the product name to determine whether there was data in the sku field. If there wasn’t it would display the name as recorded in the “product name” field.

The only issue I am having may be related to the cache. I’ve tried to clear all of the cache files on both the machine and the server. I will update you if there is resolution to this over the next few days. If you would be so kind as to check the code and see if I did something wrong I would appreciate it. I am having the error as show on the category page and the related products page.

honey-wedding-favors.com

Thanks,
Kyle


<?xml version="1.0" encoding="UTF-8"?>
<modification>
  <id>Show product model</id>
  <version>1.0</version>
  <vqmver>2.5.1</vqmver>
  <author>BurnEngine</author>

  <file path="catalog/view/theme/BurnEngine/template/product/" name="category.tpl,manufacturer_info.tpl,product.tpl,search.tpl,special.tpl">
    <operation>
      <search position="replace"><![CDATA[
        <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
      ]]></search>
      <add><![CDATA[
<a href="<?php echo $product['href']; ?>">
<?php if($product['sku']==null) {echo $product['name'];} else{echo $product['sku']."<br>".$product['mpn'];}
 ?></a>
      ]]></add>
    </operation>
  </file>

</modification>

  • This reply was modified 2675 days ago by  honeybroker.
  • This reply was modified 2675 days ago by  honeybroker.
  • This reply was modified 2675 days ago by  honeybroker.
  • This reply was modified 2675 days ago by  honeybroker.
December 23, 2016 at 12:16 am #54666

I’ve updated the xml file.

I’ve managed to get the related products and featured products to work but can’t seem to get it to work in the category pages.


<?xml version="1.0" encoding="UTF-8"?>
<modification>
  <id>Show product model</id>
  <version>1.0</version>
  <vqmver>2.5.1</vqmver>
  <author>BurnEngine</author>

  <file path="catalog/view/theme/BurnEngine/template/product/" name="category.tpl,manufacturer_info.tpl,product.tpl,search.tpl,special.tpl,featured.tpl">
    <operation>
      <search position="replace"><![CDATA[
        <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
      ]]></search>
      <add><![CDATA[

<a href="<?php echo $product['href']; ?>">
<?php if(isset($product['sku'])){
if($product['sku']==null) {echo $product['name'];} 
else{echo $product['sku']."<br>".$product['mpn'];}
}
else{echo $product['name'];}

 ?></a>
      ]]></add>
    </operation>
  </file>

</modification>

  • This reply was modified 2671 days ago by  honeybroker.
December 27, 2016 at 2:12 am #54730

Hi,

Does it work on the other listing pages? Generally, it works fine locally on the latest version of BurnEngine.

You should see it the “search” string can be found in the category template. Cleaning vqmod and ocmod cache is another “to do”.

BR,
ThemeBurn team

December 29, 2016 at 2:41 pm #54848

I have done everything I can think of to get this to work. I have cleared the caches on my computers and on the server. I have uninstalled all of the modules and tested and have been able to get it to work on all of the pages except on the category page.

For some reason the category page is not passing variables from the controller/product/category file to be read by the vqmod affecting the category.tpl file.

Kyle

January 2, 2017 at 8:54 am #54918

Hi Kyle,

This is a bit out of the scope of the free support, but we could take a look. Can you share some ftp access details?

You can use hidepost to share private information with the support staff.

BR,
ThemeBurn team

January 9, 2017 at 9:50 am #55133
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.