Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default quantity display in cart when using attributes quantity

    1.5.7c

    Follow-up of
    https://www.zen-cart.com/showthread....ntity-for-them

    I set up as suggested by dbltoe (post #2), and works fine.

    "Problem" is that in the cart it displays the attributes quantities under the product column, and in the actual quantity column it displays 1.

    Now I copied this snip to the quantity column, and it does display the attributes list (and quantities) in the quantity column as well.

    PHP Code:
    <?php
    if ($product['flagShowFixedQuantity']) {
    echo 
    $product['showFixedQuantityAmount'] . '' $product['flagStockCheck'] . '' $product['showMinUnits'];
    } else {
    echo 
    $product['quantityField'] . '' $product['flagStockCheck'] . '' $product['showMinUnits'];
    }
    ?>

    <?php // FZ taken from product column to show in quantity column
    echo $product['attributeHiddenField'];
    if (isset(
    $product['attributes']) && is_array($product['attributes'])) {
    echo 
    '<ul>';
    foreach (
    $product['attributes'] as $option => $value) {
    ?>
    <li>
    <?php
    echo $value['products_options_name'] . TEXT_OPTION_DIVIDER nl2br($value['products_options_values_name']);
    ?>
    </li>
    <?php
    }
    echo 
    '</ul>';
    }
    ?>
    ?>
    With the above it displays 1 (for the actual item), and the corresponding values for the given attributes i.e.

    1
    small - 0
    medium -2
    large -1

    My question:
    Is there a simple snip I can add to have only

    small - 0
    medium -2
    large -1

    basically an if/elseif/else situation
    I tried changing the else with elseif, and adding else for the attributes, but the page goes blank, so obviously I am missing something.

    The ideal would be to have quantity fields to update the attributes quantity like you would have with the single product, but maybe another time ... don't want to push my luck, for now just removing the 1 is a step forward. ;)

    Thank you

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,162
    Plugin Contributions
    11

    Default Re: quantity display in cart when using attributes quantity

    Perhaps you are overthinking? Look at it as you have sold one set of boxes containing two medium and one large. Seems like the problem would be if it didn't tell you how many of each size.

    As it is now, if the customer should order boxes twice, it keeps them separate.

    Only drawback I see is if the customer wants to change the quantity of one size. They would have to delete the item and re-add.

  3. #3
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: quantity display in cart when using attributes quantity

    Quote Originally Posted by dbltoe View Post
    Perhaps you are overthinking?
    Easily ;)

    Quote Originally Posted by dbltoe View Post
    Look at it as you have sold one set of boxes containing two medium and one large. Seems like the problem would be if it didn't tell you how many of each size.
    Trying to look at it from customer perspective, like they look at the quantity, and it says 1, whereas they ordered 3; but like you pointed out, I might be overthinking!

    Quote Originally Posted by dbltoe View Post
    As it is now, if the customer should order boxes twice, it keeps them separate.
    Not sure I understand what you are saying.

    Quote Originally Posted by dbltoe View Post
    Only drawback I see is if the customer wants to change the quantity of one size. They would have to delete the item and re-add.
    Yes, that is indeed the biggest limit.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: quantity display in cart when using attributes quantity

    Quote Originally Posted by keneso View Post
    Not sure I understand what you are saying.
    Right now, if a customer orders the above 0,2,1 quantity, but then goes back and orders a 0,0,1 quantity to bring the total to 0,2,2, the shopping cart will show "two" product. One made of the original 0,2,1 sequence and the other as 0,0,1. If they go back and order an additional 0,0,1 quantity then that product combo would show as a quantity of 2 of the 0,0,1 grouping.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: quantity display in cart when using attributes quantity

    Quote Originally Posted by mc12345678 View Post
    Right now, if a customer orders the above 0,2,1 quantity, but then goes back and orders a 0,0,1 quantity to bring the total to 0,2,2, the shopping cart will show "two" product. One made of the original 0,2,1 sequence and the other as 0,0,1. If they go back and order an additional 0,0,1 quantity then that product combo would show as a quantity of 2 of the 0,0,1 grouping.
    Got it thank you.

 

 

Similar Threads

  1. Replies: 17
    Last Post: 19 Feb 2013, 12:45 PM
  2. Quantity Discounts using attributes
    By buildingblocks in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 23 Apr 2011, 02:57 PM
  3. When using attributes, is there a way to also have a quantity box?
    By Household in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 Sep 2010, 02:54 PM
  4. Price by attributes - quantity discount and minimum quantity required
    By josefine in forum Setting Up Categories, Products, Attributes
    Replies: 14
    Last Post: 24 Sep 2009, 07:28 PM
  5. quantity discount for checked attributes NOT product quantity
    By adod in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 Mar 2009, 06:39 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