Author Topic: How to show/hide "add to cart" for individual products?  (Read 3606 times)

dolfff

  • Beginner
  • *
  • Posts: 1
How to show/hide "add to cart" for individual products?
« on: December 23, 2010, 06:08:34 am »
I am using VirtueMart as catalogue until now (option 'use only as catalogue' checked in Admin menu). Currently I want to add cart functionality to some (but not all) products. In the 'Display options' tab I can hide the quantity box but unfortunately I cannot find an option to hide the "add to cart" button. How can I accomplish this? I have a hunch that I am missing something because my wish sounds rather trivial.

mowlman

  • Jr. Member
  • **
  • Posts: 209
Re: How to show/hide "add to cart" for individual products?
« Reply #1 on: January 12, 2011, 19:37:53 pm »
I would like the same thing.  I found a temp work around of removing the price from an item. Call for price shows up, but the add to cart button is removed.   

There are other discussions about creating a new category and selecting a different browse template.   I think it would be better to have a Hide AddToCart selection next to the Hide Quantity box. 

zorkhh

  • Advanced
  • Jr. Member
  • *****
  • Posts: 245
    • vm-expert.com
Re: How to show/hide "add to cart" for individual products?
« Reply #2 on: January 12, 2011, 21:33:44 pm »
There is no special parameter for this in the product-configuration.

If you could live with it that the addtocart button is also hidden when you hide the quantity box, you could add this code to the addtocart templates:

Code: [Select]
<php
$quantity_options = ps_product::get_quantity_options( $product_id ) ;
extract( $quantity_options ) ;
if(@$display_type!='hide') {
// addtocartform code here
}
?>

With this code, the addtocart-button is not active when the quantity-box is hidden.
Virtuemart Professional Support at http://www.vm-expert.com

Visit the large Virtuemart Group on Joomla.org: http://people.joomla.org/groups/viewgroup/30-Virtuemart.html

cherokee

  • Beginner
  • *
  • Posts: 20
Re: How to show/hide "add to cart" for individual products?
« Reply #3 on: August 24, 2011, 16:49:03 pm »
Hello.
Excuse my English
Thanks, exactly what I need to do.
Where do I find the code for inclusion addtocartform?
thanks

cherokee

  • Beginner
  • *
  • Posts: 20
Re: How to show/hide "add to cart" for individual products?
« Reply #4 on: August 30, 2011, 14:08:29 pm »
Now I understood.
In my flypage I replaced:

<?php echo $addtocart ?>

by:

<?php
$quantity_options = ps_product::get_quantity_options( $product_id ) ;
extract( $quantity_options ) ;
if(@$display_type!='hide') {
      echo $addtocart ;  }
?>

a greeting
Alberto

bernardfenley

  • Beginner
  • *
  • Posts: 11
Re: How to show/hide "add to cart" for individual products?
« Reply #5 on: September 07, 2011, 05:08:47 am »
I'm also facing the same problem. However, my scenario is a bit different. I have correctly added Paypal as one of my payment of method and it says it's active. But I can't see the "add to cart" button in my products.

The other one is, Paid by Credit Card and it says active also. I'd like the "add to cart" button for both method show up/display in my products.

Can anyone help/guide me through the process. I'm hoping for all your kindness.

Thanks,
Bernard