[Skip to main content](#vessel-content)

#   Display Product Code with Variant Changes

##

- **[sldoom](/forum/user/37032-sldoom "View sldoom's Profile")**
- [![sldoom's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37032-sldoom "View sldoom's Profile") Topic Author
- [ Offline](/forum/user/37032-sldoom)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 5 months ago [\#202194](#202194) by [sldoom](/forum/user/37032-sldoom "View sldoom's Profile")  *[Display Product Code with Variant Changes](/forum/26-product-category-display/877055-display-product-code-with-variant-changes#202194 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.37 -- Browser(s) name and version -- : Chrome 42.0  I am trying to 'stabilize' the display of the product&#95;code. I have set Display-Display Product Code to YES. I have modified the Front-End CSS, as well as, the Display-View-show&#95;default file. The product&#95;code displays correctly when you open the page, but, if you choose an alternate characteristic, the page partially refreshes and reverts my changes.  I am betting I am missing something fairly simple, as I have spent several hours searching for an answer.  Thanks in advance for your help.  Scott")* was created by *[sldoom](/forum/user/37032-sldoom "View sldoom's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.37
-- Browser(s) name and version -- : Chrome 42.0

I am trying to 'stabilize' the display of the product_code. I have set Display-Display Product Code to YES. I have modified the Front-End CSS, as well as, the Display-View-show_default file. The product_code displays correctly when you open the page, but, if you choose an alternate characteristic, the page partially refreshes and reverts my changes.

I am betting I am missing something fairly simple, as I have spent several hours searching for an answer.

Thanks in advance for your help.

Scott

- [ ![pic1.jpg](/forum/attachment/24472) ](/forum/attachment/24472 "pic1.jpg") [ ](/forum/attachment/24472?download=1 "pic1.jpg")
- [ ![pic2.jpg](/forum/attachment/24473) ](/forum/attachment/24473 "pic2.jpg") [ ](/forum/attachment/24473?download=1 "pic2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzcwNTUtZGlzcGxheS1wcm9kdWN0LWNvZGUtd2l0aC12YXJpYW50LWNoYW5nZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#202220](#202220) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Display Product Code with Variant Changes](/forum/26-product-category-display/877055-display-product-code-with-variant-changes#202220 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.37 -- Browser(s) name and version -- : Chrome 42.0  I am trying to 'stabilize' the display of the product&#95;code. I have set Display-Display Product Code to YES. I have modified the Front-End CSS, as well as, the Display-View-show&#95;default file. The product&#95;code displays correctly when you open the page, but, if you choose an alternate characteristic, the page partially refreshes and reverts my changes.  I am betting I am missing something fairly simple, as I have spent several hours searching for an answer.  Thanks in advance for your help.  Scott")*

Hi,

When you change the variant, there is some javascript which replace some elements in the page with the content of the variant.
The span with id "hikashop_product_name_main" will receive the variant product name.
The span with id "hikashop_product_code_main" will receive the variant product code.

If you have customize the view "show_default", you might need to also override the "show" view to generate the same kind of HTML code for the variants. Code:

if(!empty($variant-&gt;product_name)) { ?&gt; &lt;div id="hikashop_product_name_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;&lt;?php echo $variant-&gt;product_name; ?&gt;&lt;/div&gt; &lt;?php } if($this-&gt;config-&gt;get('show_code') &amp;&amp; !empty($variant-&gt;product_code)) { ?&gt; &lt;div id="hikashop_product_code_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;&lt;?php echo $variant-&gt;product_code; ?&gt;&lt;/div&gt; &lt;?php }

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzcwNTUtZGlzcGxheS1wcm9kdWN0LWNvZGUtd2l0aC12YXJpYW50LWNoYW5nZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sldoom](/forum/user/37032-sldoom "View sldoom's Profile")**
- [![sldoom's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37032-sldoom "View sldoom's Profile") Topic Author
- [ Offline](/forum/user/37032-sldoom)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 5 months ago [\#202601](#202601) by [sldoom](/forum/user/37032-sldoom "View sldoom's Profile")  Replied by *[sldoom](/forum/user/37032-sldoom "View sldoom's Profile")* on topic *[Display Product Code with Variant Changes](/forum/26-product-category-display/877055-display-product-code-with-variant-changes#202601 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.37 -- Browser(s) name and version -- : Chrome 42.0  I am trying to 'stabilize' the display of the product&#95;code. I have set Display-Display Product Code to YES. I have modified the Front-End CSS, as well as, the Display-View-show&#95;default file. The product&#95;code displays correctly when you open the page, but, if you choose an alternate characteristic, the page partially refreshes and reverts my changes.  I am betting I am missing something fairly simple, as I have spent several hours searching for an answer.  Thanks in advance for your help.  Scott")*

Thanks for your help. This shows where I needed to make the necessary changes.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzcwNTUtZGlzcGxheS1wcm9kdWN0LWNvZGUtd2l0aC12YXJpYW50LWNoYW5nZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.183 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
