Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2006
    Posts
    128
    Plugin Contributions
    0

    Default Quantity in cart not showing correctl

    I do have a half finished template installed, the 'programmer' abandoned the job after receiving most of their payment.

    I am trying to fix some of the easier bugs myself until I can find reliable help. - pardon me if I use incorrect terminology.

    Problem:

    Quantity in cart always shows '1' even if there is more than one item in cart, calculated price is CORRECT.

    I think the problem is here:

    ----website: http://www.kwmagic.com--------------...--------------
    File: includes/templates/evoluzion/templates/tpl_shopping_cart_default.php

    Line #75 : echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];

    Line #77 : echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];

    ----------------------------------------

    value="1" - I think I need this to be the variable for quantity in cart.

    Could anyone guide me as to what the variable is AND how if it is possible to change the value="1" to Value = product in cart.

    any help appreciated,

    thanks

    Phil

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Quantity in cart not showing correctl

    Are you running access restriction?

    As a guest I'm not able to view products just your header, categories and footer.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3
    Join Date
    Jan 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Quantity in cart not showing correctl

    Just a glitch I think, I was trying a fix, descriptions are back now.

    I can add multiple quantities to the cart, and the total is correct, but the shopping cart only says '1'

    thanks for looking

  4. #4
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Quantity in cart not showing correctl

    Thanks, I can see your quantity input is incorrect now, the input-mini line is not stock.

    Test One:
    What happens when you use the default Classic Template?

    Test Two:
    My next guess would be to replace your tpl_shopping_cart_default.php in the current Evoluzion Template with a stock v1.51.

    Results?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  5. #5
    Join Date
    Jan 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Quantity in cart not showing correctl

    Thanks for the reply

    reverting the file did fix the problem, however there are now layout problems.

    I used winmerge to compare the files:

    this is what is in the stock:

    echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];

    This is in the evoluzion template:

    if($product['flagStockCheck'] > 0){

    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];

    }else{

    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];

    }

  6. #6
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Quantity in cart not showing correctl

    This is in the evoluzion template:
    <?php
    if($product['flagStockCheck'] > 0){
    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    }else{
    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
    }
    ?>

    This is stock:
    <?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'];
    }
    ?>

    So this would take the stock code and use the template class
    <?php
    if ($product['flagShowFixedQuantity']) {
    echo $product['showFixedQuantityAmount'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    } else {
    echo $product['quantityField'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    }
    ?>

    The question, where did this come from?
    <?php
    if($product['flagStockCheck'] > 0){
    ?>

    Because if you're going to keep using it we need to add it back into the code...
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  7. #7
    Join Date
    Jan 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Quantity in cart not showing correctl

    Thanks for your help on this, it is very much appreciated:

    I might be in a little over my head here - I have butchered the code that is on the site right now.

    This is the code as it sits in the evoluzion before I started trying to fix this today.

    <?php
    if ($product['flagShowFixedQuantity']) {
    if($product['flagStockCheck'] > 0){
    echo $product['showFixedQuantityAmount'] . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    }else{
    echo $product['showFixedQuantityAmount'] . '<br /><br />' . $product['showMinUnits'];
    }
    } else {
    if($product['flagStockCheck'] > 0){
    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    }else{
    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
    }
    }
    ?>

  8. #8
    Join Date
    Jan 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Quantity in cart not showing correctl

    This is the code I am using, there are alignment issues now, but the functions seem to work:

    <?php
    if ($product['flagShowFixedQuantity']) {
    if($product['flagStockCheck'] > 0){
    echo $product['showFixedQuantityAmount'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    } else {
    echo $product['quantityField'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    }
    } else {
    if($product['flagStockCheck'] > 0){
    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
    }else{
    echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
    }
    }
    ?>

  9. #9
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Quantity in cart not showing correctl

    Looks like you've almost got it...

    your CSS needs this change:
    .input-mini{width:60px;}

    to this:
    .input-mini{width:30px; text-align:center;}

    to make the quantity box a reasonable size.

    Then the <td> has a class="cartQuantity", you'll want to center it as well.

    Anything else?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. v151 Add to Cart text and quantity box not showing.
    By line1 in forum General Questions
    Replies: 1
    Last Post: 19 Oct 2012, 05:01 PM
  2. Quantity discount not showing in cart
    By shami in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 29 Aug 2011, 05:25 PM
  3. Quantity box not showing up for add to cart.
    By ufi911 in forum General Questions
    Replies: 6
    Last Post: 27 Sep 2010, 05:23 AM
  4. Add to Cart/Quantity box not showing up
    By red_hatorade in forum Basic Configuration
    Replies: 4
    Last Post: 5 Oct 2009, 01:23 AM
  5. Add to cart button and quantity textbox not showing
    By atgeorge in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 19 May 2009, 05:12 AM

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