Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Product set as "one per order" -> refresh button removes last item from cart

Product set as "one per order" -> refresh button removes last item from cart

Locked

Started by nicholasbieber on 22 Jun 2009, 11:34 AM · Views: 1,968

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
22 Jun 2009, 11:34 AM
#1
nicholasbieber avatar

nicholasbieber

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Post #1 by nicholasbieber

Version: Zen Cart 1.3.0.2-l10n-jp-4

Behaviour: I have set one product as a free sample, limited to one per order. If I press the Refresh button (green circle thing, not the browser's button) on the cart page, the last item in the cart will disappear, and this will occur until the free sample product as been removed, at which point behavior returns to normal.

Changing the price does nothing: Changing the limit (to two) solves the problem.

This may be because I am using an older japanese fork (my japanese is very poor; I apologise for asking for advice here), and if this was a bug, could someone direct me to the fix / tell me of what files would be involved to remedy this problem.

Other than this issue, Zen Cart has been fairly... malleable!

Thanks very much!

23 Jun 2009, 4:00 AM
#2
nicholasbieber avatar

nicholasbieber

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Post #2 by nicholasbieber

I managed to find the answer to the problem!

The answer was at http://zen-cart.jp/bbs/viewtopic.php?t=3804

includes/classes/shopping_cart.php line 1488
Swap this...

if ( in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array())) or $_POST['cart_quantity'][$i]==0 ) {

With this ```php
if ((in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array())) or $_POST['cart_quantity'][$i]==0) && zen_get_products_qty_box_status($_POST['products_id'][$i])==1) {


and then in /includes/modules/pages/shopping_cart/header_php.php line 121
Swap this:
```php
$showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_Field('products_id[]', $products[$i]['id']) . zen_draw_hidden_Field('cart_quantity[]', 1);

with this:

$showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']); 

Sorry if this isn't relevant...