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

#   How Get correct Custom Field value on Variants ecosystem

##

- **[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")**
- [![aminweb's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar38602.png)](/forum/user/38602-aminweb "View aminweb's Profile") Topic Author
- [ Offline](/forum/user/38602-aminweb)
- Amin

Less More

- Posts: 138
- Thank you received: 4
-
-
-

2 years 7 months ago [\#360034](#360034) by [aminweb](/forum/user/38602-aminweb "View aminweb's Profile")  *[How Get correct Custom Field value on Variants ecosystem](/forum/26-product-category-display/907964-how-get-correct-custom-field-value-on-variants-ecosystem#360034 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 5 -- PHP version -- : 8.2  Hello, I try customize template for my client. i need get correct value of CF when change characteristics on Product page. I try get value by this:  but alwayes return main product value.")* was created by *[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")*

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 5
-- PHP version -- : 8.2

Hello,
I try customize template for my client.
i need get correct value of CF when change characteristics on Product page.
I try get value by this: Code:

$this-&gt;element-&gt;shipping_time;

but alwayes return main product value.

---

Joomla Developer \| am.ebrahimzadeh\[at\]gmail.com

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14294
-
-

2 years 7 months ago [\#360035](#360035) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How Get correct Custom Field value on Variants ecosystem](/forum/26-product-category-display/907964-how-get-correct-custom-field-value-on-variants-ecosystem#360035 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 5 -- PHP version -- : 8.2  Hello, I try customize template for my client. i need get correct value of CF when change characteristics on Product page. I try get value by this:  but alwayes return main product value.")*

Hi,

That's not that simple to do.
You'll have to do 3 things:
1. In the product / show.php view file, you need to add the display for each variant: Code:

&lt;div id="hikashop_product_shipping_&lt;?php echo $variant_name; ?&gt;" style="display:none;"&gt;&lt;?php echo $variant-&gt;shipping_time; ?&gt;&lt;/div&gt;

2. In your product layout (probably product / show_default.php ), you want to add the main display: Code:

&lt;div id="hikashop_product_shipping_main"&gt;&lt;?php echo $this-&gt;element-&gt;shipping_time; ?&gt;&lt;/div&gt;

3. In the product / show_block_characteristic.php you want to change the line: Code:

var names = ['id','name','code','image','price','quantity','description','weight','url','width','length','height','contact','custom_info','files'];

in order to add your new div name, like this: Code:

var names = ['id','name','code','image','price','quantity','description','weight','url','width','length','height','contact','custom_info','files','shipping'];

This will allow the javascript system of the characteristics to copy the HTML in the div of the currently selected variant, to the main div.

The following user(s) said Thank You: [aminweb](/forum/user/38602-aminweb "View aminweb's Profile")

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

- **[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")**
- [![aminweb's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar38602.png)](/forum/user/38602-aminweb "View aminweb's Profile") Topic Author
- [ Offline](/forum/user/38602-aminweb)
- Amin

Less More

- Posts: 138
- Thank you received: 4
-
-
-

2 years 7 months ago [\#360045](#360045) by [aminweb](/forum/user/38602-aminweb "View aminweb's Profile")  Replied by *[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")* on topic *[How Get correct Custom Field value on Variants ecosystem](/forum/26-product-category-display/907964-how-get-correct-custom-field-value-on-variants-ecosystem#360045 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 5 -- PHP version -- : 8.2  Hello, I try customize template for my client. i need get correct value of CF when change characteristics on Product page. I try get value by this:  but alwayes return main product value.")*

wow! amazing, thank you Nicolas

---

Joomla Developer \| am.ebrahimzadeh\[at\]gmail.com

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

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

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