- Posts: 138
- Thank you received: 4
How Get correct Custom Field value on Variants ecosystem
2 years 6 months ago #360034
by aminweb
Joomla Developer | am.ebrahimzadeh[at]gmail.com
How Get correct Custom Field value on Variants ecosystem was created by aminweb
-- 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.
-- 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->element->shipping_time;
Joomla Developer | am.ebrahimzadeh[at]gmail.com
Please Log in or Create an account to join the conversation.
2 years 6 months ago #360035
by nicolas
Replied by nicolas on topic How Get correct Custom Field value on Variants ecosystem
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:
2. In your product layout (probably product / show_default.php ), you want to add the main display:
3. In the product / show_block_characteristic.php you want to change the line:
in order to add your new div name, like this:
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.
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:
<div id="hikashop_product_shipping_<?php echo $variant_name; ?>" style="display:none;"><?php
echo $variant->shipping_time;
?></div>
Code:
<div id="hikashop_product_shipping_main"><?php
echo $this->element->shipping_time;
?></div>
Code:
var names = ['id','name','code','image','price','quantity','description','weight','url','width','length','height','contact','custom_info','files'];
Code:
var names = ['id','name','code','image','price','quantity','description','weight','url','width','length','height','contact','custom_info','files','shipping'];
The following user(s) said Thank You: aminweb
Please Log in or Create an account to join the conversation.
2 years 6 months ago #360045
by aminweb
Joomla Developer | am.ebrahimzadeh[at]gmail.com
Replied by aminweb on topic How Get correct Custom Field value on Variants ecosystem
wow! amazing, thank you Nicolas
Joomla Developer | am.ebrahimzadeh[at]gmail.com
The following user(s) said Thank You: Philip
Please Log in or Create an account to join the conversation.
Time to create page: 0.174 seconds