Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

no cart image when product quantity = 0


Guest

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!

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...