Results 1 to 6 of 6
  1. #1

    Default shopping cart - hide the Cart Quantity Update button when not needed

    I found it inconvenient that the cart quantity update button is always visible even for articles where the quantity can not be changed.
    In such cases the button does not have any function and should better be hidden.

    Here is a fix that I created:

    in tpl_shopping_cart_default.php look for these lines:
    Code:
    <?php
      if ($product['buttonUpdate'] == '') {
        echo '' ;
      } else {
        echo $product['buttonUpdate'];
      }
    ?>
    and change them to:
    Code:
    <?php
      if ($product['buttonUpdate'] == '' || $product['flagShowFixedQuantity'] ) {
        echo '' ;
      } else {
        echo $product['buttonUpdate'];
      }
    ?>
    BTW: $product['flagShowFixedQuantity'] and $product['showFixedQuantity'] seem identical to me. Is there any reason why there are two fields in the array holding the same information? Thanks!

  2. #2

    Default Re: shopping cart - hide the Cart Quantity Update button when not needed

    One thing that is bothering me:
    I just found that this modification does not only remove the Cart Quantity Update button but also a hidden input field that I don't quite understand:
    Code:
    <input name="products_id[]" value="11:f3c45f2df15c4d1605fbe80af8038a78" type="hidden">
    Q: Should this input field better be preserved or can I remove it without any danger when removing the cart quantity update button? (and what does it do?)
    Thanks!

  3. #3

    Default Re: shopping cart - hide the Cart Quantity Update button when not needed

    one more question:

    Evaluating the condition
    Code:
     if ($product['buttonUpdate'] == '')
    does not seem to make much sense in the first place. To me it looks like $product['buttonUpdate'] is never an empty string as I found when looking at the code in
    includes/modules/pages/shopping_cart/header_php.php:

    somewhere around line 140:
    Code:
    $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);
    ($buttonUpdate gets later assigned to $productArray['buttonUpdate'])
    Is that an error or have I missed something? Thanks!

  4. #4

    Default Re: shopping cart - hide the Cart Quantity Update button when not needed

    Hi,

    I agree with the above problem description and I have the same issue.

    I think having two "update cart" buttons is not necessary (the "top" one next to the product image and text, and the "bottom" one next to "continue shopping").

    I want to remove the top one. I found that if I comment out line 80 in my tpl_shopping_cart_default.php :

    echo $product['buttonUpdate'];

    the top button does disappear but the function "update cart" stops working (when clicking the bottom button).

    Any help ?

    Denis

  5. #5

    Default Re: shopping cart - hide the Cart Quantity Update button when not needed

    Ooops... posted to quickly, found the solution :

    http://www.zen-cart.com/wiki/index.p...ration_-_Stock (bottom of the page) :

    ================

    Show Shopping Cart - Update Cart Button Location
    (Admin - Catalog)

    Controls the location of the Update Cart button in the Shopping Cart.
    Options are:

    * 1 = Next to each Qty Box
    * 2 = Below all Products
    * 3 = Both Next to each Qty Box and Below all Products

    Default: 3


    ================

    Dause, even that does not explain how to completely remove the button for fixed quantity products, it still looks better having one button below rather than a button next to the product.


    Denis

  6. #6
    Join Date
    Sep 2009
    Posts
    78
    Plugin Contributions
    0

    help question Re: shopping cart - hide the Cart Quantity Update button when not needed

    Quote Originally Posted by dlg_ie View Post
    even that does not explain how to completely remove the button for fixed quantity products, it still looks better having one button below rather than a button next to the product.
    I agree. In my case the shopping cart can have only one item of each product (per order).

    I managed to remove the the Cart Quantity Update button next to each product ( Admin > Configuration > Stock > Show Shopping Cart - Update Cart Button Location = 2).

    Is the only way to remove the shared (bottom) Cart Quantity Update button via hacking tpl_shopping_cart_default.php as dause described?

    Thanks.

 

 

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. quantity update button in the cart - not saving changes
    By carl7081 in forum General Questions
    Replies: 10
    Last Post: 24 Oct 2010, 07:20 PM
  3. Not able to update product quantity in shopping cart
    By bstoppel in forum General Questions
    Replies: 5
    Last Post: 3 Aug 2009, 06:15 PM
  4. Remove Update Button From Shopping Cart when priced by attributes?
    By khaber in forum Customization from the Admin
    Replies: 7
    Last Post: 30 Jul 2008, 02:55 PM
  5. Show quantity in cart only when the product is already in shopping cart
    By e81ny in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 8 Sep 2007, 03:34 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR