Disable Product - Price, Add to Cart, Wishlist

Contrib type: 
Module
Moderation: 
Failed code review
Status: 
Bug testing
Compatibility: 
Ubercart 1.x
Latest version: 
1

Sometimes you want to list products in the catalog but you don't want people to buy them. This module lets you disable the price and/or "add to cart" on a per product basis. Works in the UI the same as the shippable product checkbox.
Test on a development site first.

AttachmentSize
uc_disable_product.zip2.85 KB



Button removed, price not??

Thanks for this modules. I wanted this functionality pretty bad
Testing this module, and it seems the "Add to cart button"is gone (yeah), but the price still shows.

See this for instance http://www.side-shore.nl/board/royal-62-love-machine

Any ideas??

Re: Disable Product - Price, Add to Cart, Wishlist

this is just what i need! i wonder if i can replace "add to cart" button into some text like "Out of stock!" ?

Or instead of "Out of stock!" a custom message will be very nice

Nice contribution. As ivan mentioned some message should be given to customer. Other wise they will try to find a button to add to cart. BTW, instead of "Out of stock!" a custom message can ve much better for special cases.

bugs

installed on drupal 5.7 and ubercart 5.x-1.4
1-
first of installation I haved 1st error when open my page module (now not remember message)
but resolved so: go on file .info and remove this " " at "Add to cart"

after installed:
2nd error:
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /...../sites/all/modules/ubercart/contrib/uc_disable_product/uc_disable_product.module on line 56

foreach ($form_values['items'] as $key => &$value)
I removed the &

not know why this error but I use php4 so not know if php5 this work, someone can to test?)

3- for uninstall I have message (write below **)
I resolved so in file .install
function uc_disable_product_uninstall()
{
db_query("ALTER TABLE {uc_products} DROP `hide_price` ");
db_query("ALTER TABLE {uc_products} DROP `disable_add_to_cart` ");
db_query("ALTER TABLE {uc_products} DROP `disable_wishlist` ");
}

have removed this rows /*!40100 DEFAULT CHARACTER SET UTF8 */ ;

I not tested module (too much error) and also there isn't a readme text how to use;
example: if you want remove the "add wishlist" button you must remove comment in .module file; I notice only because look at code;

**
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET UTF8 */' at line 1 query: ALTER TABLE uc_products DROP `hide_price` /*!40100 DEFAULT CHARACTER SET UTF8 */ ; in /...../includes/database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET UTF8 */' at line 1 query: ALTER TABLE uc_products DROP `disable_add_to_cart` /*!40100 DEFAULT CHARACTER SET UTF8 */ ; in /...../includes/database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET UTF8 */' at line 1 query: ALTER TABLE uc_products DROP `disable_wishlist` /*!40100 DEFAULT CHARACTER SET UTF8 */ ; in /...../includes/database.mysql.inc on line 172.