Need to show all Variant Images at once

  • Posts: 36
  • Thank you received: 2
12 years 1 month ago #69981

I need to show my variant images like this:

www.ofcentral.com/NEW/apparel/vehicle/pr...when-your-cup-holder

I used Aceshop in that store. But Aceshop isn't working on this other site (I think it's a hosting issue) so I'm trying out Hikashop for the first time. But I need to be able to show my variants like the above example. Is that possible in hikashop as is? Or is there a plugin of some kind I can install?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #70070

Hi,

You can edit the file "product / show_default" in HikaShop > Display > Views and try to add the following code:

<?php
foreach($this->element->variants as $variant){
	foreach($variant->characteristics as $k => $characteristic){
		$char_id = $characteristic->variant_characteristic_id;
		$cat_id = $k;
	}
	foreach($variant->images as $image){
		echo '<img onClick="document.getElementById(\'hikashop_product_characteristic_'.$cat_id.'\').value = '.$char_id.'; document.getElementById(\'hikashop_product_characteristic_'.$cat_id.'\').focus();" style="height:100px;" src="' . $this->image->uploadFolder_url . $image->file_path . '" alt="' . $image->file_name . '"  />';
	}
}
echo '<input type="hidden" onFocus="return hikashopUpdateVariant(this);" id="hikashop_product_characteristic_'.$cat_id.'" value="">';
?>

It's an example, you can do it in another way.

Last edit: 12 years 1 month ago by Xavier.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum