Author Topic: How can I turn off the cart for some products  (Read 5939 times)

gldproducts

  • Beginner
  • *
  • Posts: 40
How can I turn off the cart for some products
« on: November 20, 2012, 00:06:15 am »
Can somebody please tell me how I can turn off the "Add To Cart" button on certain products? I'm running VM 2.0.14 and Joomla 2.5.8. I would really appreciate it. I'm looking to only have PayPal as the option as ell right now.

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: How can I turn off the cart for some products
« Reply #1 on: November 20, 2012, 09:52:28 am »
Hello,

You could use the option  Displays 'Notify Me' instead of 'Add To Cart' button under Configuration-> Shopfront ->  Action when a Product is Out of Stock. So you could place those products under 0 stock and the add-to-cart button will not appeared.

An other way i am thinking is to create a custom field with the option Show Cart Button = TRUE (boolean) by default, if you select FALSE then you could override your productdetails/default_addtocart.php when this customfield is false do not show the add-to-cart button

Hope it helps

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

mirrorsandglass

  • Jr. Member
  • **
  • Posts: 163
  • Time Is Precious, Waste It Wisely
Re: How can I turn off the cart for some products
« Reply #2 on: November 20, 2012, 15:43:34 pm »
Set the price to 0.00 and select Virtuemart->Configuration->Configuration->Pricing->"Show call for price, when the price is empty"

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: How can I turn off the cart for some products
« Reply #3 on: November 20, 2012, 15:46:29 pm »
If i am not mistaken the product have a price ....

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

mirrorsandglass

  • Jr. Member
  • **
  • Posts: 163
  • Time Is Precious, Waste It Wisely
Re: How can I turn off the cart for some products
« Reply #4 on: November 20, 2012, 15:57:35 pm »
You're right bytelord.
Sorry. :(

mirrorsandglass

  • Jr. Member
  • **
  • Posts: 163
  • Time Is Precious, Waste It Wisely
Re: How can I turn off the cart for some products
« Reply #5 on: November 20, 2012, 16:16:18 pm »
Actually if you create a default.php override file and edit it to exclude the addtocart code then assign that to the products you want that should do it.

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: How can I turn off the cart for some products
« Reply #6 on: November 20, 2012, 16:31:11 pm »
@mirrorsandglass

Yes that will work also ...

an override for the productdetails/default.php to not load the template default_addtocart.php

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

mirrorsandglass

  • Jr. Member
  • **
  • Posts: 163
  • Time Is Precious, Waste It Wisely
Re: How can I turn off the cart for some products
« Reply #7 on: November 20, 2012, 16:49:06 pm »
Just done this as a test and it works.
Comment out:
Code: [Select]
// Add To Cart Button
// if (!empty($this->product->prices) and !empty($this->product->images[0]) and $this->product->images[0]->file_is_downloadable==0 ) {
//if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices['salesPrice'])) {
    //echo $this->loadTemplate('addtocart');
//}  // Add To Cart Button END
.
Make sure your new filename is not longer than 16 characters as it won't save it in the product override field due to the database field only being 16 chars long.

gldproducts

  • Beginner
  • *
  • Posts: 40
Re: How can I turn off the cart for some products
« Reply #8 on: November 26, 2012, 19:39:05 pm »
Hello,

You could use the option  Displays 'Notify Me' instead of 'Add To Cart' button under Configuration-> Shopfront ->  Action when a Product is Out of Stock. So you could place those products under 0 stock and the add-to-cart button will not appeared.

An other way i am thinking is to create a custom field with the option Show Cart Button = TRUE (boolean) by default, if you select FALSE then you could override your productdetails/default_addtocart.php when this customfield is false do not show the add-to-cart button

Hope it helps

Regards

Thanks byLord. I set the stock to zero and now displaying 'Notify Me' instead of 'Add To Cart' button. that seems to work for now. I'll work to comment out the notify me.

http://www.gldgames.com

let me know what you think if you get a chance. ;D

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: How can I turn off the cart for some products
« Reply #9 on: November 27, 2012, 01:20:23 am »
Hello,

ok then, just create an override for default_addtocart.php as we said before and make your edits.

It's a nice site, need some work more and as it seems you are on the right track ;)

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!