Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Plugin Contributions

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

    Version: Zen Cart

    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!

  2. #2
    Join Date
    Jun 2009
    Plugin Contributions

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

    I managed to find the answer to the problem!

    The answer was at

    includes/classes/shopping_cart.php line 1488
    Swap this...
    PHP Code:
    if ( in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array())) or $_POST['cart_quantity'][$i]==) { 
    With this
    PHP Code:
    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 Code:
    $showFixedQuantityAmount $products[$i]['quantity'] . zen_draw_hidden_Field('products_id[]'$products[$i]['id']) . zen_draw_hidden_Field('cart_quantity[]'1); 
    with this:
    PHP Code:
    $showFixedQuantityAmount $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]'$products[$i]['quantity']); 
    Sorry if this isn't relevant...



Similar Threads

  1. Adding a free item to cart when customer order over "X" amount of product?
    By petro in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 25 Jan 2014, 07:07 PM
  2. Can I make the "add to cart" button refresh the product listing page?
    By quarrymen1 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 Jun 2010, 02:47 PM
  3. Replies: 26
    Last Post: 19 Feb 2010, 02:56 AM
  4. Adding more than one button "add to cart" on product info page....
    By Celebrimbor in forum General Questions
    Replies: 14
    Last Post: 4 Feb 2010, 05:41 PM
  5. How to Remove just one "Display Product Add to Cart Button"?
    By scottwww1 in forum General Questions
    Replies: 12
    Last Post: 29 Oct 2009, 12:39 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Zen-Cart, Internet Selling Services, Klamath Falls, OR