News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How can I turn off the cart for some products

Started by gldproducts, November 20, 2012, 00:06:15 AM

Previous topic - Next topic

gldproducts

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

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!

WebStuff

Set the price to 0.00 and select Virtuemart->Configuration->Configuration->Pricing->"Show call for price, when the price is empty"

bytelord

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!

WebStuff


WebStuff

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

@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!

WebStuff

Just done this as a test and it works.
Comment out:
// 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

Quote from: bytelord 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

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

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!