Welkom bij Joomla!NL

Om alle mogelijkheden van dit forum te kunnen gebruiken, moet je je eerst registreren.

Zet de naam van de webshopextensie in de titel en vermeld verder in iedere vraag:
  1. De exacte versie van Joomla! die je gebruikt
  2. De exacte versie van de webshopextensie.
  3. De volledige url van je website (indien mogelijk).

TIP! - add to cart button in categorie overzicht.

TIP! - add to cart button in categorie overzicht.

15 feb 2012 06:59 - 13 sep 2013 08:28
#1
In VM 2.0 zit niet meer standaard een add to cart knop als je in categorie overzicht zit.

hier onder de samenvatting van deze link op het Virtuemart forum.

Maak altijd eerst een backup van je bestanden!

zoek in components/com_virtuemart/views/category/tmpl/default.php de volgende code op
Code:
<?php // Product Details Button echo JHTML::link($product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details')); ?> </p>

voeg hier na een van de volgende codes toe.

Add to cart zonder extra functies
Code:
<form method="post" class="product" action="index.php" id="addtocartproduct<?php echo $product->virtuemart_product_id ?>"> <div class="addtocart-bar"> <?php // Display the quantity box ?> <!-- <label for="quantity<?php echo $this->product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> --> <span class="quantity-box"> <input style="display:none;" type="text" class="quantity-input" name="quantity[]" value="1" /> </span> <?php // Display the quantity box END ?> <?php // Add the button $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO'); $button_cls = ''; //$button_cls = 'addtocart_button'; if (VmConfig::get('check_stock') == '1' && !$this->product->product_in_stock) { $button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY'); $button_cls = 'notify-button'; } ?> <?php // Display the add to cart button ?> <span class="addtocart-button"> <input type="submit" name="addtocart" class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" /> </span> <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>

Add to cart met aantallen opgave
Code:
<form method="post" class="product" action="index.php" id="addtocartproduct<?php echo $product->virtuemart_product_id ?>"> <div class="addtocart-bar"> <?php // Display the quantity box ?> <!-- <label for="quantity<?php echo $this->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" name="quantity[]" value="1" /> </span> <span class="quantity-controls"> <input type="button" class="quantity-controls quantity-plus" /> <input type="button" class="quantity-controls quantity-minus" /> </span> <?php // Display the quantity box END ?> <?php // Add the button $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO'); $button_cls = ''; //$button_cls = 'addtocart_button'; if (VmConfig::get('check_stock') == '1' && !$this->product->product_in_stock) { $button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY'); $button_cls = 'notify-button'; } ?> <?php // Display the add to cart button ?> <span class="addtocart-button"> <input type="submit" name="addtocart" class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" /> </span> <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>
Laatst bewerkt 13 sep 2013 08:28 door Astrid.
  • ekkie
  • ekkie's berichtenfoto Heeft onderwerp gestart
  • Bekend met Joomla!NL
  • Bekend met Joomla!NL
  • Berichten: 98
Moderators: Juliank92PeterJelleRomke
Tijd voor maken pagina: 0.914 seconden

Wil je Joomla!NL steunen?

Steun Joomla!NLAlle teamleden werken enthousiast, op vrijwillige basis, mee aan Joomla!NL. Maar een website met forum kost nu eenmaal geld. Dus als je Joomla!NL wilt steunen, dan kan dat, graag zelfs!

Lees hier meer informatie