VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: luiskar on November 23, 2013, 19:14:41 PM

Title: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: luiskar on November 23, 2013, 19:14:41 PM
First of all, sorry because I don't speak English very well.

I migrated joomla 1.5 to joomla 2.5 and virtuemart 1.1.9 to 2.0.24b. After all hours, I finish almost all the work. In joomla 1.5 virtuemart 1.1.9 I had the botton "add to the cart" when I listed de products from a category and also when I entered into de product but now I only have it when I enter into the product. I read that to put the botton I need to write in default.php but I am not so familiar with writting php code yet. Anyone can help me?
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: janjoomla on November 23, 2013, 22:37:39 PM
Maybe this will help:

http://forum.virtuemart.net/index.php?topic=90961.0
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: luiskar on November 23, 2013, 23:04:12 PM
Quote from: janjoomla on November 23, 2013, 22:37:39 PM
Maybe this will help:

http://forum.virtuemart.net/index.php?topic=90961.0
I already saw that but i don't know in what line I need to put that code
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: janjoomla on November 23, 2013, 23:27:46 PM
file: /com_virtuemart/views/category/tmpl/default.php (better create a override)

After:

<?php // Product Details Button
echo JHTML::link($product->linkJText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
?>

</p>
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: luiskar on November 24, 2013, 02:06:02 AM
Quote from: janjoomla on November 23, 2013, 23:27:46 PM
file: /com_virtuemart/views/category/tmpl/default.php (better create a override)

After:

<?php // Product Details Button
echo JHTML::link($product->linkJText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
?>

</p>

It works. The problem is that in products that I dont put the price also have the botton, instead the botton request price or question about the product
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: Maxim Pishnyak on November 24, 2013, 16:31:00 PM
Check related option in VM configuration.
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: luiskar on November 27, 2013, 11:17:09 AM
Quote from: Maxim Pishnyak on November 24, 2013, 16:31:00 PM
Check related option in VM configuration.
I alredy did that, but only works inside the articule, not in the browser category. There always shows the botton add to the car
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: luiskar on November 30, 2013, 10:48:14 AM
Anyone knows how to do it, I need if the articule don't have price show the botton request price instead the botton add to the cart. Inside the articule it works but in browser category always shows me add to the cart botton
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: jenkinhill on November 30, 2013, 12:06:07 PM
There is no code to check for zero price added to the the category template?
Title: Re: Put add to cart botton in browser category in virtuemart 2.0.24b
Post by: Spiros Petrakis on December 01, 2013, 16:49:53 PM
Quote from: jenkinhill on November 30, 2013, 12:06:07 PM
There is no code to check for zero price added to the the category template?

The code is already available in the view

$product->prices['salesPrice']<=0

or you can use

!empty($product->prices['salesPrice'])