Results 1 to 10 of 17

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: Update cart Quantity

    Just found what I think is a solution to this problem. I wanted to allow customers to edit the quantity box in their shopping cart, disregarding the fact that I only allow them to add one at a time from the product info page and product listing pages.

    The solution was found by commenting out some lines in templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php

    At around line 67 you will find the following:
    Code:
    <?php
      if ($product['flagShowFixedQuantity']) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      }
    ?>
    Delete or comment out the if statement and what would be processed if the statement was true. We want to leave the code after the else statement. This will ensure that the quantity field will always be update-able in the shopping cart page. I just commented the said lines out so that reversal is easy:

    Code:
    <?php
    //  if ($product['flagShowFixedQuantity']) {
    //    echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    //  } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    //  }
    ?>
    Last edited by johnswan; 25 Oct 2007 at 08:24 AM. Reason: typos

  2. #2
    Join Date
    Mar 2008
    Posts
    51
    Plugin Contributions
    0

    Default Re: Update cart Quantity

    Thank you! I just came across this same problem of products with 'Show Products Quantity Box' set to OFF not allowing the Qty box to be editable in the shopping cart.

    This custom code did the trick. It works great with the product Attribute Grid mod now, since that mod uses it's own quantity boxes.

    Quote Originally Posted by johnswan View Post
    The solution was found by commenting out some lines in templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php

    At around line 67 you will find the following:
    Code:
    <?php
      if ($product['flagShowFixedQuantity']) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      }
    ?>
    Delete or comment out the if statement and what would be processed if the statement was true. We want to leave the code after the else statement. This will ensure that the quantity field will always be update-able in the shopping cart page. I just commented the said lines out so that reversal is easy:

    Code:
    <?php
    //  if ($product['flagShowFixedQuantity']) {
    //    echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    //  } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    //  }
    ?>

 

 

Similar Threads

  1. v155 Update Button of Shopping Cart Reduces Quantity in Cart
    By mc12345678 in forum Bug Reports
    Replies: 2
    Last Post: 29 Jul 2016, 12:26 PM
  2. shopping cart - hide the Cart Quantity Update button when not needed
    By dause in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Oct 2009, 04:28 AM
  3. Quantity update empties cart
    By daisytwist in forum General Questions
    Replies: 2
    Last Post: 10 Apr 2009, 12:37 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
  •  
disjunctive-egg