Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Turn off Update Button when maximum quantity is 1

    99% of my products have only item available, so normally (but not always) the update cart button is redundant, and maybe even confusing for some customers.

    Unforutately I cannot simply turn the button off in admin, because occasionally customers do buy multilple-quantity products.

    What I would like to see, is for the update button to disappear when all cart items have max. quantity of 1, and appear if the customer adds a multiple-quantity item to the cart.

    Has anyone done something like that?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Turn off Update Button when maximum quantity is 1

    The Update button is also used to delete things from the cart ...

    Would setting the Update Button to only show below the Products in the shopping_cart work?

    Also, Hide Quantity box might make sense on these Products with Maximum of 1 as well ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: Turn off Update Button when maximum quantity is 1

    Thanks Ajeh

    Quote Originally Posted by Ajeh View Post
    The Update button is also used to delete things from the cart ...
    Because most items have unchangeable quantity of 1, I imagine customers would intuitively use the delete button to delete an item from cart. The update cart button actually doesn't do anything when I click it.

    But I realise the update button is occasionally useful when customers buy a product that has a quantity input box. That's why I can't turn it off in admin.

    Quote Originally Posted by Ajeh View Post
    Would setting the Update Button to only show below the Products in the shopping_cart work?
    Yes that's a very smart idea! It took me a while to work out that since the update button is useless for 99% of the products, I might as well place it below the #cartContentsDisplay table rather than next to every single product in the cart. It is much better now, but not perfect. I still have a single update button that is redundant 99% of the time, but not all the time, so I cannot turn it off. This button is very cheeky!

    Quote Originally Posted by Ajeh View Post
    Also, Hide Quantity box might make sense on these Products with Maximum of 1 as well ...
    Done that. I've also removed the "max: 1" from product listing page (great tip from you on another thread http://www.zen-cart.com/forum/showthread.php?t=39737), shopping cart page (if anyone wants to know, by commenting out $product['showMinUnits'] in line 69 of tpl_shopping_cart_default), and product info page (I think I did this one in admin).

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Turn off Update Button when maximum quantity is 1

    What Im doing is: I have a single update button, when people click on that the whole cart will be updated.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Turn off Update Button when maximum quantity is 1

    Do note the admin setting in the Configuration ... Stock ...
    Show Shopping Cart - Update Cart Button Location
    Show on Shopping Cart Update Cart Button Location as:

    1= Next to each Qty Box
    2= Below all Products
    3= Both Next to each Qty Box and Below all Products
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: Turn off Update Button when maximum quantity is 1

    Quote Originally Posted by Ajeh View Post
    Do note the admin setting in the Configuration ... Stock ...
    Ajeh I'm not sure how that helps me. At the moment I've got it set at 2, below all products. But as I said, I prefer to see it disappear when customers have no use for it (which would be most of the time).

  7. #7
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: Turn off Update Button when maximum quantity is 1

    Let me use a pic as example. I've used the default template. See how customers would have no use for the update button in this scenario.


  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Turn off Update Button when maximum quantity is 1

    You could look into the shopping_cart class for this section of code and use the function to calculate how many products are Max 1 vs the quantity in the cart ... and when they match don't show the button ...
    PHP Code:
      /**
       * Method to calculate the number of items in a cart based on an abitrary property
       *
       * $check_what is the fieldname example: 'products_is_free'
       * $check_value is the value being tested for - default is 1
       * Syntax: $_SESSION['cart']->in_cart_check('product_is_free','1');
       *
       * @param string product field to check
       * @param mixed value to check for
       * @return integer number of items matching restraint
       */
      
    function in_cart_check($check_what$check_value='1') { 
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: Turn off Update Button when maximum quantity is 1

    Thanks Ajeh! This is into php codes but I'll try to work it out .

 

 

Similar Threads

  1. Changing minimum / maximum quantity based off of attributes
    By emeryc in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 9 Jun 2013, 09:09 AM
  2. Position quantity update button under quantity box
    By JC.M in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Feb 2010, 02:43 PM
  3. 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
  4. Turn off Quantity
    By conboy in forum General Questions
    Replies: 24
    Last Post: 22 Dec 2008, 09:40 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