Jump to content
Sign in to follow this  
nathanwheeler

no cart image when product quantity = 0

Recommended Posts

I am using a simple "hack" to avoid displaying a cart for a product that has the quantity set to 0.

In almost all files i get it working great except product_listing.php.....

 

From product_listing.php:

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

break;

}

 

 

The script idea i can use in other pages except this product_listing:

//start no button if quantity 0

<?php

if ( $product_info['products_quantity'] > 0 ) {

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

 

} else {

}

?>

//end no button if quantity 0

 

 

 

Anyone an idea how to do it for right now whatever i do with the function i get :

a Shoppingcart even when Qunatity=0 for a particular product.

OR and that is veryt strange: it displayes the price....

 

btw: i use TotalB2B contribution but i cannot see how that is connected for the case 'PRODUCT_LIST_BUY_NOW': shouldbe used anyway.

 

 

Thanks a lot!

Share this post


Link to post
Share on other sites
I am using a simple "hack" to avoid displaying a cart for a product that has the quantity set to 0.

In almost all files i get it working great except product_listing.php.....

 

From product_listing.php:

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

break;

}

The script idea i can use in other pages except this product_listing:

//start no button if quantity 0

<?php

if ( $product_info['products_quantity'] > 0 ) {

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

 

} else {

}

?>

//end no button if quantity 0

Anyone an idea how to do it for right now whatever i do with the function i get :

a Shoppingcart even when Qunatity=0 for a particular product.

OR and that is veryt strange: it displayes the price....

 

btw: i use TotalB2B contribution but i cannot see how that is connected for the case 'PRODUCT_LIST_BUY_NOW': shouldbe used anyway.

Thanks a lot!

 

if ( $listing['products_quantity'] > 0 ) {


Treasurer MFC

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×