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

#   Variant code vs. product code

##

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

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 1 month ago [\#124297](#124297) by [fakur-design](/forum/user/24280-fakur-design "View fakur-design's Profile")  *[Variant code vs. product code](/forum/26-product-category-display/862163-variant-code-vs-product-code#124297 "-- url of the page with the problem -- :   www.fakur-design.dk  -- HikaShop version -- : business -- Joomla version -- : 2,5,14 -- PHP version -- : x.x.x  I seriously need help. I want my product code to be displayed on my webpage and also on the order-confirmation email, so therefore I have activated &quot;show code&quot; in my configuration. But instead of displaying the product code, it displays the code of a variant?!  Example:   www.fakur-design.dk/en/for-horses/trense...with-swarovskistones  What can I do?")* was created by *[fakur-design](/forum/user/24280-fakur-design "View fakur-design's Profile")*

-- url of the page with the problem -- : [ www.fakur-design.dk](http://www.fakur-design.dk)
-- HikaShop version -- : business
-- Joomla version -- : 2,5,14
-- PHP version -- : x.x.x

I seriously need help. I want my product code to be displayed on my webpage and also on the order-confirmation email,
so therefore I have activated "show code" in my configuration.
But instead of displaying the product code, it displays the code of a variant?!

Example: [ www.fakur-design.dk/en/for-horses/trense...with-swarovskistones](http://www.fakur-design.dk/en/for-horses/trenser/product/442-biothane-headstall-with-swarovskistones)

What can I do?

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 month ago [\#124350](#124350) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Variant code vs. product code](/forum/26-product-category-display/862163-variant-code-vs-product-code#124350 "-- url of the page with the problem -- :   www.fakur-design.dk  -- HikaShop version -- : business -- Joomla version -- : 2,5,14 -- PHP version -- : x.x.x  I seriously need help. I want my product code to be displayed on my webpage and also on the order-confirmation email, so therefore I have activated &quot;show code&quot; in my configuration. But instead of displaying the product code, it displays the code of a variant?!  Example:   www.fakur-design.dk/en/for-horses/trense...with-swarovskistones  What can I do?")*

Hi,

For the webpage, you have to replace the code: Code:

echo $this-&gt;element-&gt;product_code;

By: Code:

echo $this-&gt;element-&gt;main-&gt;product_code;

in the view "product / show_default" via the menu Display &gt; Views.

In the email the parent product code is not loaded, you will have to add some code to get it.
You have the product_id in the variable $item-&gt;product_id, so with the product id, get the parent product id, and with the parent_product_id get the main product_code.

It require php kowledge.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjIxNjMtdmFyaWFudC1jb2RlLXZzLXByb2R1Y3QtY29kZT90bXBsPW1hcmtkb3du) 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.152 seconds

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

[](#top)
