Guten Tag Leute,
und zwar habe ich ein selbsterstelltes Feld "Farbe" mit dem man die Farbvariante des Profuktes wählen kann.
Nun das funktioniert auch ganz gut auch bei der Produktdetailseite.
Nur bei der Kategorieansicht gibt es ein Problem welches ich mir nciht erklären kann.
Das erste Produkt mit einem Feld "Farbe" hat bestimmte Optionen z.b. "gelb" und "blau".
Diese Optionen werden auf die folgenden Produkte übernommen d.h. bei jedem Produkt wo man die Farbe wählen kann steht nun "gelb" und "blau" obwohl eigentlich andere Optionen eingestellt worden sind.
Das ist nur bei der Kategorieansicht. Klickt man nun auf die Detailansicht werden die Optionen richtig angezeigt.
Hier wäre der zuständige Code dafür:
- <?php
- defined('_JEXEC') or die('Restricted access');
- ?>
- <div class="addtocart-area" style=" margin-top:-15px;">
- <form method="post" class="product js-recalculate" action="index.php" style="" >
- <?php // Product custom_fields
- if (!empty($product->customfieldsCart)) { ?>
- <div class="product-fields">
- <?php foreach ($product->customfieldsCart as $field) { ?>
- <div class="product-field product-field-type-<?php echo $field->field_type ?>">
- <span class="product-fields-title" ><strong><?php echo JText::_($field->custom_title) ?></strong></span>
- <?php if ($field->custom_tip)
- echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png'); ?>
- <span class="product-field-display"><?php echo $field->display ?></span>
- <span class="product-field-desc"><?php echo $field->custom_field_desc ?></span>
- </div>
- <?php
- }
- ?>
- </div>
- <?php
- }
- /* Product custom Childs
- * to display a simple link use $field->virtuemart_product_id as link to child product_id
- * custom_value is relation value to child
- */
- if (!empty($product->customsChilds)) {
- ?>
- <div class="product-fields"><br />
- <?php foreach ($product->customsChilds as $field) { ?>
- <div class="product-field product-field-type-<?php echo $field->field->field_type ?>">
- <span class="product-fields-title" ><strong><?php echo JText::_($field->field->custom_title) ?></strong></span>
- <span class="product-field-desc"><?php echo JText::_($field->field->custom_value) ?></span>
- <span class="product-field-display"><?php echo $field->display ?></span>
- </div>
- <?php } ?>
- </div>
- <?php } ?>
- <div class="addtocart-bar" style="margin-top:9px;">
- <span style="color: #666666; font-size: 0.85em; font-weight:bold; float:left">Anzahl</span>
- <br />
- <?php // Display the quantity box
- $stockhandle = VmConfig::get('stockhandle', 'none');
- if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($product->product_in_stock - $product->product_ordered) < 1) {
- ?>
- <a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id='.$product->virtuemart_product_id); ?>" class="notify"><?php echo JText::_('COM_VIRTUEMART_CART_NOTIFY') ?></a>
- <?php } else { ?>
- <!-- <label for="quantity<?php echo $product->virtuemart_product_id; ?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
- <span class="quantity-box">
- <input type="text" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($product->min_order_level) && (int) $product->min_order_level > 0) {
- echo $product->min_order_level;
- } else {
- echo '1';
- } ?>" />
- </span>
- <span class="quantity-controls js-recalculate">
- <input type="button" class="quantity-controls quantity-plus" />
- <input type="button" class="quantity-controls quantity-minus" />
- </span>
- <?php // Display the quantity box END ?>
- <span style="color: #666666; font-size: 0.85em; font-weight:bold; float:left; padding-top:5px">Einzelpreis</span>
- <br />
- <div class="product-price marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
- <br />
- <?php
- if ($this->show_prices == '1') {
- if( $product->product_unit && VmConfig::get('vm_price_show_packaging_pricelabel')) {
- echo "<strong>". JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT').' ('.$product->product_unit."):</strong>";
- }
- if(empty($product->prices) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) ){
- echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE');
- }
- //todo add config settings
- if( $this->showBasePrice){
- echo $this->currency->createPriceDiv('basePrice','COM_VIRTUEMART_PRODUCT_BASEPRICE',$product->prices);
- echo $this->currency->createPriceDiv('basePriceVariant','COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT',$product->prices);
- }
- echo $this->currency->createPriceDiv('variantModification','COM_VIRTUEMART_PRODUCT_VARIANT_MOD',$product->prices);
- echo $this->currency->createPriceDiv('basePriceWithTax','COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX',$product->prices);
- /* echo $this->currency->createPriceDiv('discountedPriceWithoutTax','COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE',$product->prices);
- echo $this->currency->createPriceDiv('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT',$product->prices); */
- echo $this->currency->createPriceDiv('salesPrice','COM_VIRTUEMART_PRODUCT_SALESPRICE',$product->prices);/*
- echo $this->currency->createPriceDiv('priceWithoutTax','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX',$product->prices);
- echo $this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices);
- echo $this->currency->createPriceDiv('taxAmount','COM_VIRTUEMART_PRODUCT_TAX_AMOUNT',$product->prices); */
- } ?>
- </div>
- <br />
- <br />
- <?php
- // Display the add to cart button
- ?>
- <span class="addtocart-button" style=" float:left">
- <input type="submit" name="addtocart" class="addtocart-button" value="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO') ?>" title="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO') ?>" />
- </span>
- <?php } ?>
- <div class="clear"></div>
- </div>
- <?php // Display the add to cart button END ?>
- <input type="hidden" class="pname" value="<?php echo $product->product_name ?>" />
- <input type="hidden" name="option" value="com_virtuemart" />
- <input type="hidden" name="view" value="cart" />
- <noscript><input type="hidden" name="task" value="add" /></noscript>
- <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>" />
- <?php /** @todo Handle the manufacturer view */ ?>
- <input type="hidden" name="virtuemart_manufacturer_id" value="<?php echo $product->virtuemart_manufacturer_id ?>" />
- <input type="hidden" name="virtuemart_category_id[]" value="<?php echo $product->virtuemart_category_id ?>" />
- </form>
- <div class="clear"></div>
- </div>
Kann mir da jemand weiterhelfen. Im Grunde werden immer die FarbOptionen vom ersten Produkt auf die folgenden Produkte in der Kategorieansicht übernommen. wieso auch immer ...
Ich hoffe ihr konntet mich verstehen.
Danke, Andi