Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

quantity box on on some pages


sackling

Recommended Posts

I have my site setup in html outside of oscommerce and then I have "buy now" buttons for instance which link to sts template pages for the cart portions.

 

Anyways I am making an order form and for certain products I need to add the quantity box. So all works well with my form if I chance includes/application_top from:

 

$HTTP_POST_VARS['id']))+1

 

to

 

$HTTP_POST_VARS['id']))+$quantity

 

however all the other product pages I have that do not have quantity boxes do not work anymore obviously.

 

Is there a way to have both and let oscommerce know that if there is no quantity entered it is just +1?

 

Any help is greatly appreciated as always.

Link to comment
Share on other sites

In that code, you could try

$HTTP_POST_VARS['id']))+(isset($quantity) ? $quantity : 1)

Where are you setting $quantity? It might be better to write

$HTTP_POST_VARS['id']))+(isset($HTTP_POST_VARS['quantity']) ? $HTTP_POST_VARS['quantity'] : 1)

You could also add a hidden field for quantity on those pages that don't have a quantity box and set its value to 1.

Always back up before making changes.

Link to comment
Share on other sites

In that code, you could try
$HTTP_POST_VARS['id']))+(isset($quantity) ? $quantity : 1)

Where are you setting $quantity? It might be better to write

$HTTP_POST_VARS['id']))+(isset($HTTP_POST_VARS['quantity']) ? $HTTP_POST_VARS['quantity'] : 1)

You could also add a hidden field for quantity on those pages that don't have a quantity box and set its value to 1.

 

 

Thank you so much the first one you posted worked perfectly!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...