Text "SKU: "prior to product code

  • Posts: 11
  • Thank you received: 0
11 years 10 months ago #131134

-- HikaShop version -- : 2.2.2 Essential
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.3.27
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- :

Current i have the following settings in: System - Configuration - Display, Default parameters for products
Display product code: Yes
In the product display I would like to prefix the product code with "SKU: "
How would i do this? Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 10 months ago #131158

Hi,
You'll probably be able to do it by editing the code of the "show_default" file of the "product" view of your front-end template through "Hikashop->Display->Views", and replace these lines :

    <span id="hikashop_product_code_main" class="hikashop_product_code_main">
      <?php
      echo $this->element->product_code;
      ?>
    </span>
By :
    <span id="hikashop_product_code_main" class="hikashop_product_code_main">
      <?php
      echo 'SKU:'.$this->element->product_code;
      ?>
    </span>

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 9 months ago #132240

Hi Mohamad, thank you for your reply.
Your suggestion gave me the "SKU:" in the detailed product display. Where I really want to put "SKU:" is in the category listing of the products. i.e. when customer selects a category, they see a listing of products.
What Display View would that be?

Thans so much!

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 9 months ago #132359

Ok, Can you show me a screenshot and a link of where you exactly want to add it, so that I can tell you which file you'll have edit ?

Please Log in or Create an account to join the conversation.

  • Posts: 265
  • Thank you received: 1
10 years 9 months ago #180965

Sorry to jump on an old thread. I just want to display the code within the product page, but not on category display... I have made the changes and it comes up in both the category and product displays...

I can't find an option within the menu options to prevent this happening.

Thanks,
Hal

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 9 months ago #180967

Hi,

You can disable the display of the product code in the settings of the associated module of the category listing menu.
Or if you have added some code to the view to display the product code, you can use a PHP if condition to restrict the display.

For example the following code allow to display content only on product page and not in listing:

if(JRequest::getCmd('layout') == 'show')
    echo $this->element->product_code;

Please Log in or Create an account to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum