PDA

View Full Version : Buy It Now



r_fulton13
12-05-2005, 02:33 PM
Heya peeps! Was just wondering if there is any way to hide the Buy It Now Button in sold out products and the products yet to come. I want my customers to be able to see the products but not be able to add them to the cart..... I realise that these items can't be purchased anyway but it would be so much neater if I could just get rid of the button on certain items.... Thanks guys
:lol: please don't leave me hanging!!!! :lol:

groggory
01-26-2006, 06:48 PM
this would be fantastic. Any pointers, I'll look into the code if I just get a few tips. :-)

groggory
01-26-2006, 08:46 PM
the button for the 'add to cart' is:


<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

You'll need to do an if statement in php wherever that button is, I don't know the proper syntax, but it'd be something like:

if [quantity.product()>0){
<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
}

I don't know PHP very well, and don't feel like looking in my ref books for the code, but you get the idea.

r_fulton13
01-27-2006, 05:44 AM
Ok. Thats cool. I'm a little confused about where this text is changed though. Is it in product_listing or content? Tried doing an if statement beofre successfully but couldn't get this partuicular thing to work because I don't know where it needs to go. Thanks for your help though!!!

Rob
www.adoptafurby.com/catalog

groggory
01-27-2006, 01:07 PM
Where it is depends on what template you are using. For my case, it was in 'template/fallback/content/product_info.tpl.php ' But needless to say, it was in the template directory. I can't recommend dreamweaver 8 enough for doing this, it handles CSS wonderfully. Just make sure to sync your local site to your remote site and your life will be easy. It'll do a site-wide code check fast!