Hi nicolas
Great! Almost there, but I must miss something.
The BOTTLEYEAR is not there from the beginning, but shows when I change variant to 2016.
But changing back to 2015, it stays the bottleyear from 2016 - 2015 has to be 2019.
Can you spot my mistake somewhere?
var names = ['id','name','code','image','price','quantity','description','weight','url','width','length','height','contact','custom_info','files','bottleyear'];
- TEST START -
<div id="hikashop_product_bottleyear_main" class="hikashop_product_bottleyear_main" itemprop="bottleyear">
<?php
foreach($this->element->variants as $variant) {
$this->row =& $variant;
$variant_name = array ();
if(!empty($variant->characteristics)) {
foreach($variant->characteristics as $k => $ch) {
$variant_name[] = $ch->characteristic_id;
}
}
$variant_name = implode('_', $variant_name);
$this->variant_name = '_' . $variant_name;
if(!empty($variant->bottleyear)) {
?>
<div id="hikashop_product_bottleyear_<?php echo $variant_name; ?>" style="display:none;">Bottle year: <?php echo $variant->bottleyear; ?></div>
<?php
}
}
?>
</div>
- TEST END -