News:

Support the VirtueMart project and become a member

Main Menu

Change Product-Image depending on selected Radio-Button

Started by xcover, December 12, 2012, 19:37:20 PM

Previous topic - Next topic

xcover

Hi,
i wanna change the Product-Image depending on the selected radio-button of the custom fields in an imagewrapper.

The custom fields work fine.

Could anyone advise me, how to get the product-image in original size in the image-wrapper?

Screenshot attached.

I have the following code:

else if($group->field_type == 'M'){//image
$checked = 'checked="checked"';
$items=0;
$item_count=1;
$total=count($group->options);
foreach ($group->options as $key=>$productCustom) {
if ((float)$productCustom->custom_price )$price = $currency->priceDisplay($calculator->calculateCustomPriceWithTax($productCustom->custom_price));
else  $price = ($productCustom->custom_price==='') ? '' : $free ;
if($items==0){$html.='<div class="inner_atr_wrapper">';}
$html.= '<div class="atr"><input id="'.$key.'_'.$pb_group_id.'" '.$checked.' type="radio" value="'.$productCustom->value.'" name="customPrice['.$row.'] ['.$group->virtuemart_custom_id.']" />';
$html.= '<label for="'.$key.'_'.$pb_group_id.'">'.$this->displayType($productCustom->custom_value,$group->field_type,$is_list=0,$price,$row,$is_cart=1).'</label></div>' ;

$items++;
if($items>0 && $items%3==0){
$html.='<div style="clear:both;"></div></div>';
$items=0;
}else if($item_count==$total && $item_count%3!=0){
$html.='<div style="clear:both;"></div></div>';
}
$checked ='';

if($start_flag==0){
if($versionCompare>0)$this->default_custom_prices[$productCustom->value]=$group->virtuemart_custom_id;
else $this->default_custom_prices[$group->virtuemart_custom_id]=$productCustom->value;
}
$start_flag=1;
$item_count++;
}


Hope someone could help me.
Regards
Xcover

[attachment cleanup by admin]