Virtuemart 3 now supports add to cart button in category view. How can this be implemented in latest Storefront template ?
When do you plan to release new e-comerce template ?
Thanks.
teitbite wrote:Hi
I have no idea about releasing plans. It's something developers only knows.
Please send me an access to ftp and an url to the page with category view and I'll see what can be done about add to cart there.
<?php
/* REMOVE THE COMMENT AND PHP TAGS IF YOU NEED TO DISPLAY PRICES ON THE CATEGORY LISTING
<div class="catProductPrice" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and !$product->images[0]->file_is_downloadable) {
echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
}
echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
} ?>
</div>
*/
?>
<?php
<div class="catProductPrice" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and !$product->images[0]->file_is_downloadable) {
echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
}
echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
} ?>
</div>
?>
<div class="addtocart-area">
<form method="post" class="product js-recalculate" action="<?php echo JRoute::_ ('index.php?option=com_virtuemart',false); ?>">
<div class="vm-customfields-wrap">
<?php
if(!empty($rowHeights['customfields'])) echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>'addtocart')); ?>
</div>
<?php
if (!VmConfig::get('use_as_catalog', 0) ) {
echo shopFunctionsF::renderVmSubLayout('addtocartbar',array('product'=>$product));
} ?>
<input type="hidden" name="option" value="com_virtuemart"/>
<input type="hidden" name="view" value="cart"/>
<input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>"/>
<input type="hidden" name="pname" value="<?php echo $product->product_name ?>"/>
<input type="hidden" name="pid" value="<?php echo $product->virtuemart_product_id ?>"/>
<?php
$itemId=vRequest::getInt('Itemid',false);
if($itemId){
echo '<input type="hidden" name="Itemid" value="'.$itemId.'"/>';
} ?>
</form>
</div>