OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Tip: Remove [Add to Cart] button
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
Arctic Fox
I hate installing a bunch of code for something simple. I've a few things that I either am not actually selling (free downloads), or am displaying an item that is not/no longer for sale, but information might need to stay on my site (for a history of reviews).

So when I don't want the [Add to Cart] button to show up on one or two pages (or 50), I use this bit of code in the "Products Description":

CODE
<style>
TD.main input {display:none;}
</style>



It's a hack job, I know - I got that idea from messing with my MySpace page. It works.
Arctic Fox
Another idea I may work on is a PHP script that will remove the [Add to Cart] button if my supplier's inventory is < #.
EricK
You can easily hide the Add to Cart button on catalog/product_info.php using this contribution.

Easy Call for Price v1.0
http://addons.oscommerce.com/info/3211

When you set a product's price to zero, the script displays whatever you want. I replaced my Add to Cart button code with this:
CODE
<?php // bof: BEGIN EASY CALL FOR PRICE v1.0
    if ($product_info_values['products_price'] == CALL_FOR_PRICE_VALUE){
     echo '<a href=contact_us.php>' . TEXT_CALL_FOR_PRICE . '</a>';
    } else {
    echo tep_image_submit('button_add_to_cart.gif', IMAGE_BUTTON_ADD_TO_CART); }
// eof: END EASY CALL FOR PRICE v1.0
?>

Cheers,
EricK
jerrymc
Eric:

Where is the cart button code located? What page? The Easy Call For Price v1.0 directs one to alter code on products_info.php but that page does not exist in my new, clean install (2.2). I'd really like to use the contrib but I'm stumped.

thanks,


QUOTE (Arctic Fox @ Jan 1 2008, 01:37 PM) *
Another idea I may work on is a PHP script that will remove the [Add to Cart] button if my supplier's inventory is < #.
Coopco
QUOTE (jerrymc @ Feb 23 2008, 09:46 AM) *
Eric:

Where is the cart button code located? What page? The Easy Call For Price v1.0 directs one to alter code on products_info.php but that page does not exist in my new, clean install (2.2). I'd really like to use the contrib but I'm stumped.

thanks,

It is in the catalog dircetory, or root directory if store is in the root.
desiredin
QUOTE (Arctic Fox @ Jan 1 2008, 09:37 PM) *
Another idea I may work on is a PHP script that will remove the [Add to Cart] button if my supplier's inventory is < #.

Beautiful. Helped me out of a couple hours of bashing my head aimlessly before giving up, while trying to work out an update to the Hide Add To Cart contribution.
http://www.oscommerce.com/community/contributions,1765

I've used that contribution on a couple stores to disable the product when books, DVDs, etc go out of print. I still want those products listed because most of them eventually will get a second printing run done so I don't want to lose my search engine status for those pages.

I want this now for my new shop which will be selling downloadable instructional videos. There are pre-requisite knowledges needed for the downloads, so I've bundled the products as a Get 1 Free ( http://www.oscommerce.com/community/contributions,4990 ) item, but I do not want to sell that file. Just have it as a download. So I want customers to not be able to add it through the reviews, and product listings.

I prefer the Hide Add To Cart contribution, as I can see all the products that have their add to cart button listed in a couple clicks. Plus I can also quickly change it by removing the manufacturer listing. But I'm having a heck of a time changing the code over to work with my OSC2.2 RC2.

$25 Paypal to anyone who can update that contribution to work with OSC2.2 RC2 in the next few days. It isn't much, but I'm serious....... [/incentive].
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.