Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Assistance required please


MarthaD

Recommended Posts

I need to limit the quanity of an item to ONE in the shopping cart as the products are ONE of a kind...

 

How can i do this. Help is urgently required.

 

Thank you.

 

not tested but:

 

in shopping_cart.php around line 152 is:

 

$info_box_contents[$cur_row][] = array('align' => 'center',

'params' => 'class="productListing-data" valign="top"',

'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

 

this is the text field to change quantity, change this to just diaplay the figure 1 and add a new hidden field setting the quantity to 1 like:

 

$info_box_contents[$cur_row][] = array('align' => 'center',

'params' => 'class="productListing-data" valign="top"',

'text' => '1' .tep_draw_hidden_field('cart_quantity[]', '1'). tep_draw_hidden_field('products_id[]', $products[$i]['id']));

 

think that will do it

Link to comment
Share on other sites

So that works and again thank you. Now how do i prevent the QTY from even shoing on the shopping cart page, as thr above still displays the quantity of "1" on the page....

 

ok change code to:

 

$info_box_contents[$cur_row][] = array('align' => 'center',

'params' => 'class="productListing-data" valign="top"',

'text' => tep_draw_hidden_field('cart_quantity[]', '1'). tep_draw_hidden_field('products_id[]', $products[$i]['id']));

 

glad it worked

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...