Hallo zusammen,
ich hoffe, dass ich hier richtig bin, und mir jemand weiterhelfen kann.
Ich möchte folgendes realisieren:
Ich habe einen Produktkonfigurator für Virtuemart 2. Die Auswahl des Produktes funktioniert auch einwandfrei, jedoch soll das Produktbild auch automatisch beim Aktivieren des entsprechenden Buttons aktualisiert werden.
Leider bekomme ich das nicht hin.
Ich habe es bisher nur geschafft das verkleinerte Bild der Auswahlmöglichkeit in den imgWrapper einzufügen.
Allerdings werden dort alle Bilder "übereinander gestapelt".
Siehe hier:
PHP
- 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>' ;
- Diese Zeile habe ich eingefügt: $html.= '<div class="imgWrapper">'.$this->displayType($productCustom->custom_value,$group->field_type,$is_list=0,$price,$row,$is_cart=1).'</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++;
- }
Ich hoffe mir kann jemand helfen, bin echt am verzweifeln.
Viele Grüße
Lars