Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add quantity box to product info page - Is there a way to make this on the main page?


Guest

Recommended Posts

I'm using contrib "Add quantity box to product info page" which works great on the product info page, however, I can't seem to get this to work on the products_new.php page. I am able to get the box to appear, but when I enter in a number like 7 and add it to the cart it's only putting 1 in the cart. I'm very confused since the code is identical and it's still looking at application_top, so I'm not sure what it's not working. Any ideas?

 

Nate

Link to comment
Share on other sites

Well I think I figured it out, I just don't know how to fix it...

 

On the new products page it's pulling from Buy It Now, which is this in application_top

 

// performed by the 'buy now' button in product listings and review page

case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

} else {

$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

Now if I change the +1 to +$HTTP_POST_VARS['quantity'] when something is added to the cart it just says 'your cart is empty,' I notice that for buy it not it says HTTP_GET_VARS and not HTTP_POST_VARS, but changing it to +$HTTP_GET_VARS['quantity'] didn't work either. I'll keep guessing and checking w/the code, but if anyone knows the right line it would be appreciated.

 

Nate

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...