Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Shopping cart page - unable to update product quantity

    This one got me puzzled (client site): When on the shopping cart page, I am unable to update the quantity in cart of any given product. I can change the quantity in the box but pressing the update icon does nothing.

    Site is bubs2grubsknitting[dot]com[dot]au
    ZC version 1.5.5e
    PHP 5.6.30

    I have scoured through virtually every similar thread dealing with this issue, to no avail.

    Compared the files

    includes/modules/pages/shopping_cart/header_php.php
    includes/templates/bubs/template/tpl_shopping_cart_default.php

    to relevant stock files and can't find any differences (other than css / display changes in the override template file).

    Thanks guys

  2. #2
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Shopping cart page - unable to update product quantity

    Quote Originally Posted by frank18 View Post
    This one got me puzzled (client site): When on the shopping cart page, I am unable to update the quantity in cart of any given product. I can change the quantity in the box but pressing the update icon does nothing.

    Site is bubs2grubsknitting[dot]com[dot]au
    ZC version 1.5.5e
    PHP 5.6.30

    I have scoured through virtually every similar thread dealing with this issue, to no avail.

    Compared the files

    includes/modules/pages/shopping_cart/header_php.php
    includes/templates/bubs/template/tpl_shopping_cart_default.php

    to relevant stock files and can't find any differences (other than css / display changes in the override template file).

    Thanks guys
    looks like your form is closing before the quantity input field and update button. should be below input or just above the shipping estimator section.
    Dave
    Always forward thinking... Lost my mind!

  3. #3
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Shopping cart page - unable to update product quantity

    Quote Originally Posted by davewest View Post
    looks like your form is closing before the quantity input field and update button. should be below input or just above the shipping estimator section.
    Thanks Dave, but that is not the case. Form closes just above the shipping estimator section, exactly the same as it is in the stock template_default/templates/tpl_shopping_cart_default.php file - no difference.

  4. #4
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Shopping cart page - unable to update product quantity

    Here is the actual tpl_shopping_cart_default.php file:

    PHP Code:
    <?php
    /**
     * Page Template
     *
     * Loaded automatically by index.php?main_page=shopping_cart.<br />
     * Displays shopping-cart contents
     *
     * @package templateSystem
     * @copyright Copyright 2003-2016 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: Author: DrByte  Thu Jan 7 22:38:14 2016 -0500 Modified in v1.5.5 $
     */
    ?>
    <div class="centerColumn" id="shoppingCartDefault">
    <?php
      
    if ($flagHasCartContents) {
    ?>

    <?php
      
    if ($_SESSION['cart']->count_contents() > 0) {
    ?>
    <div class="forward"><?php echo TEXT_VISITORS_CART?></div>
    <?php
      
    }
    ?>

    <h1 id="cartDefaultHeading"><?php echo HEADING_TITLE?></h1>

    <?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>

    <?php echo zen_draw_form('cart_quantity'zen_href_link(FILENAME_SHOPPING_CART'action=update_product'$request_type), 'post''id="shoppingCartForm"'); ?>



    <?php 
        $page_query 
    $db->Execute("SELECT pages_html_text FROM ezpages WHERE pages_title='Shopping Cart Info'");
        
    $shoppingcartinfo_text $page_query->fields['pages_html_text'];
        echo 
    $shoppingcartinfo_text;
    ?>

    </div>


    <?php if (!empty($totalsDisplay)) { ?>
      <div class="cartTotalsDisplay important"><?php echo $totalsDisplay?></div>
      <br class="clearBoth" />
    <?php ?>

    <?php  if ($flagAnyOutOfStock) { ?>

    <?php    if (STOCK_ALLOW_CHECKOUT == 'true') {  ?>

    <div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT?></div>

    <?php    } else { ?>
    <div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT?></div>

    <?php    //endif STOCK_ALLOW_CHECKOUT ?>
    <?php  
    //endif flagAnyOutOfStock ?>

    <table  border="0" width="100%" cellspacing="0" cellpadding="0" id="cartContentsDisplay">
         <tr class="tableHeading">
            <th scope="col" id="scQuantityHeading"><?php echo TABLE_HEADING_QUANTITY?></th>
            <th scope="col" id="scUpdateQuantity">&nbsp;</th>
            <th scope="col" id="scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS?></th>
            <th scope="col" id="scUnitHeading"><?php echo TABLE_HEADING_PRICE?></th>
            <th scope="col" id="scTotalHeading"><?php echo TABLE_HEADING_TOTAL?></th>
            <th scope="col" id="scRemoveHeading">&nbsp;</th>
         </tr>
             <!-- Loop through all products /-->
    <?php
      
    foreach ($productArray as $product) {
    ?>
         <tr class="<?php echo $product['rowClass']; ?>">
           <td class="cartQuantity">
    <?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'];
      }
    ?>
           </td>
           <td class="cartQuantityUpdate">
    <?php
      
    if ($product['buttonUpdate'] == '') {
        echo 
    '' ;
      } else {
        echo 
    $product['buttonUpdate'];
      }
    ?>
           </td>
           <td class="cartProductDisplay">
    <a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' $product['flagStockCheck'] . '</span>'?></span></a>
    <br class="clearBoth" />


    <?php
      
    echo $product['attributeHiddenField'];
      if (isset(
    $product['attributes']) && is_array($product['attributes'])) {
      echo 
    '<div class="cartAttribsList">';
      echo 
    '<ul>';
        
    reset($product['attributes']);
        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>';
      echo 
    '</div>';
      }
    ?>
           </td>
           <td class="cartUnitDisplay"><?php echo $product['productsPriceEach']; ?></td>
           <td class="cartTotalDisplay"><?php echo $product['productsPrice']; ?></td>
           <td class="cartRemoveItemDisplay">
    <?php
      
    if ($product['buttonDelete']) {
    ?>
               <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART'action=remove_product&product_id=' $product['id']); ?>"><?php echo zen_image($template->get_template_dir(ICON_IMAGE_TRASHDIR_WS_TEMPLATE$current_page_base,'images/icons'). '/' ICON_IMAGE_TRASHICON_TRASH_ALT); ?></a>
    <?php
      
    }
      if (
    $product['checkBoxDelete'] ) {
        echo 
    zen_draw_checkbox_field('cart_delete[]'$product['id']);
      }
    ?>
    </td>
         </tr>
    <?php
      
    // end foreach ($productArray as $product)
    ?>
           <!-- Finished loop through all products /-->
          </table>

    <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL?> <?php echo $cartShowTotal?></div>
    <br class="clearBoth" />

    <!--bof shopping cart buttons-->
    <div class="buttonRow forward"><?php echo '<a href="' zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL') . '">' zen_image_button(BUTTON_IMAGE_CHECKOUTBUTTON_CHECKOUT_ALT) . '</a>'?></div>
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPINGBUTTON_CONTINUE_SHOPPING_ALT) . '</a>'?></div>
    <?php
    // show update cart button
      
    if (SHOW_SHOPPING_CART_UPDATE == or SHOW_SHOPPING_CART_UPDATE == 3) {
    ?>
    <div class="buttonRow back"><?php echo zen_image_submit(ICON_IMAGE_UPDATEICON_UPDATE_ALT); ?></div>
    <?php
      
    } else { // don't show update button below cart
    ?>
    <?php
      
    // show update button
    ?>
    <!--eof shopping cart buttons-->
    </form>

    <br class="clearBoth" />
    <?php
        
    if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
    ?>

    <div class="buttonRow back"><?php echo '<a href="javascript:popupWindow(\'' zen_href_link(FILENAME_POPUP_SHIPPING_ESTIMATOR) . '\')">' .
     
    zen_image_button(BUTTON_IMAGE_SHIPPING_ESTIMATORBUTTON_SHIPPING_ESTIMATOR_ALT) . '</a>'?></div>
    <?php
        
    }
    ?>

    <!-- ** BEGIN PAYPAL EXPRESS CHECKOUT ** -->
    <?php  // the tpl_ec_button template only displays EC option if cart contents >0 and value >0
    if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
      include(
    DIR_FS_CATALOG DIR_WS_MODULES 'payment/paypal/tpl_ec_button.php');
    }
    ?> 
    <!-- ** END PAYPAL EXPRESS CHECKOUT ** -->

    <?php
          
    if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '2') {
    /**
     * load the shipping estimator code if needed
     */
    ?>
          <?php require(DIR_WS_MODULES zen_get_module_directory('shipping_estimator.php')); ?>

    <?php
          
    }
    ?>
    <?php
      
    } else {
    ?>

    <h2 id="cartEmptyText"><?php echo TEXT_CART_EMPTY?></h2>

    <?php
    $show_display_shopping_cart_empty 
    $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);

    while (!
    $show_display_shopping_cart_empty->EOF) {
    ?>

    <?php
      
    if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_FEATURED_PRODUCTS') { ?>
    <?php
    /**
     * display the Featured Products Center Box
     */
    ?>
    <?php 
    require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
    <?php 
    ?>

    <?php
      
    if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_SPECIALS_PRODUCTS') { ?>
    <?php
    /**
     * display the Special Products Center Box
     */
    ?>
    <?php 
    require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
    <?php 
    ?>

    <?php
      
    if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_NEW_PRODUCTS') { ?>
    <?php
    /**
     * display the New Products Center Box
     */
    ?>
    <?php 
    require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
    <?php 
    ?>

    <?php
      
    if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_UPCOMING') {
        include(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS));
      }
    ?>
    <?php
      $show_display_shopping_cart_empty
    ->MoveNext();
    // !EOF
    ?>
    <?php
      
    }
    ?>
    </div>

  5. #5
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Shopping cart page - unable to update product quantity

    If you're questioning the files (though there are many others that support even what is seen in the code above and there are database settings to boot), then upon submission of the form, the general process would include:
    includes/auto_loaders/config.base.php which loads
    includes/init_includes/init_cart_handler.php which loads
    includes/main_cart_actions.php which is expected to load
    All of the includes/extra_cart_actions files which may prevent "update" or change of the total amount/quantity before feeding back to have the shopping_cart page load again. After those files (if present) are parsed/acted upon then there is the shopping_cart class itself found in includes/classes. Then through all this there is the possibility of one or more observers that could be taking action to prevent changing the total quantity in the cart. There also could be a cart override "class" that is loaded ahead of the default shopping_cart class to take its place and that may have something involved.

    Lots of possibilities. Would suggest identifying what has been installed that might have modified any of those files or that process, differences in the overall system, and anything else that might be further helpful.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Shopping cart page - unable to update product quantity

    Quote Originally Posted by frank18 View Post
    This one got me puzzled (client site): When on the shopping cart page, I am unable to update the quantity in cart of any given product. I can change the quantity in the box but pressing the update icon does nothing.

    Site is bubs2grubsknitting[dot]com[dot]au
    It is a JavaScript problem. If JS is disabled the quantity can updated.

    Further checking showed you are loading jQuery twice, and two different versions.

    Results of viewing page source shows:

    #25
    Code:
    <script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="//code.jquery.com/jquery-1.12.0.min.js"%3E%3C/script%3E'));</script>
    #153 - #157
    Code:
    <link rel="stylesheet" type="text/css" href="includes/templates/bubs/css/zen_lightbox.css"><script type="text/javascript">
            if (typeof jQuery == 'undefined') {  
      document.write("<scr" + "ipt type=\"text/javascript\" src=\"//code.jquery.com/jquery-1.11.3.min.js\"></scr" + "ipt>");
      }
    </script>
    Lines #153 - #157 should be removed as 'zen_lightbox.css' was previously loaded as was 'jquery-1.12.0.min.js'.

    Even better is to not use Slimbox but some other script.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Shopping cart page - unable to update product quantity

    Zen Colorbox is about to be updated, just verifying the installation script and then will be submitting as an update to: https://www.zen-cart.com/downloads.php?do=file&id=1322

    Current version includes documentation to support manually applying the SQL; however, the version currently on the site needs massaging (expecting to upload it, but didn't yesterday). The issues with the sql are that some do not identify the fields to which the value is to be applied so in some queries if the associated table had been modified there might be an error/issue, also that NULL is used to assign to the configuration_id that auto-numbers and that could be an issue depending on the system/database to which it is applied (some expect '' instead of NULL). Anyways, that software is available at https://github.com/mc12345678/zen-co...ree/z4a-master.

    There is currently an auto-install script provided. It can be used or ignored. To remove it or not use it, simply remove (prior to navigating the admin after upload of the files) or do not upload the file admin/includes/auto_loaders/config.zcb.php
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Shopping cart page - unable to update product quantity

    Quote Originally Posted by mc12345678 View Post
    If you're questioning the files (though there are many others that support even what is seen in the code above and there are database settings to boot), then upon submission of the form, the general process would include:
    includes/auto_loaders/config.base.php which loads
    includes/init_includes/init_cart_handler.php which loads
    includes/main_cart_actions.php which is expected to load
    All of the includes/extra_cart_actions files which may prevent "update" or change of the total amount/quantity before feeding back to have the shopping_cart page load again. After those files (if present) are parsed/acted upon then there is the shopping_cart class itself found in includes/classes. Then through all this there is the possibility of one or more observers that could be taking action to prevent changing the total quantity in the cart. There also could be a cart override "class" that is loaded ahead of the default shopping_cart class to take its place and that may have something involved.

    Lots of possibilities. Would suggest identifying what has been installed that might have modified any of those files or that process, differences in the overall system, and anything else that might be further helpful.
    None of the files listed above have been altered or are missing, all are standard ZC 1.5.5e files.

  9. #9
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Shopping cart page - unable to update product quantity

    Quote Originally Posted by Website Rob View Post
    It is a JavaScript problem. If JS is disabled the quantity can updated.
    Had that inkling, need to look into this further.


    Quote Originally Posted by Website Rob View Post
    Lines #153 - #157 should be removed as 'zen_lightbox.css' was previously loaded as was 'jquery-1.12.0.min.js'.....
    Did that, no change...

  10. #10
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Shopping cart page - unable to update product quantity

    Two things I noticed.

    You mentioned using 1.5.5e but it looks like some links are hard-coded, old code? Reason being is I see 'main_page=page&id' instead of 'main_page=page&amp;amp;id' in a lot of links.

    Code:
    • <ul>
    • <li><a href="index.php?main_page=page&id=13">Shipping</a></li>
    • <li><a href="index.php?main_page=page&id=6">Ordering</a></li>
    • <li><a href="index.php?main_page=page&id=4">Payment</a></li>
    • <li><a href="index.php?main_page=page&id=10">Returns Policy</a></li>
    • <li><a href="index.php?main_page=page&id=26">Q &amp; A</a></li>
    • <li><a href="index.php?main_page=page&id=9">Privacy Policy</a></li>
    • </ul></li>



    The other is when editing was done to the Shopping page there was an incorrect placement of HTML code.

    Edit should be like so:

    Code:
    <form name="cart_quantity" action="https://bubs2grubsknitting.com.au/index.php?main_page=shopping_cart&amp;action=update_product&amp;zenid=removed_by_WR" method="post" id="shoppingCartForm"><input type="hidden" name="securityToken" value="removed_by_WR" />
    
    <div>
    <p style="text-align: center;">
    <strong style="font-family: Verdana; color: rgb(255, 0, 0);">If ordering discontinued product please do not order more than current stock holding as these are also unavailable at the suppliers.</strong></p>
    <p style="text-align: center;">
    <br />
    <span style="color:#800080;"><span style="font-size: 12px;"><span style="font-family: Verdana;"><strong>If your order is over $100 and contains mainly discontinued yarns payment of postage would be much appreciated as these are priced out at cost + 10% GST.</strong></span></span></span></p>
    <p style="text-align: center;">
    <span style="color:#0000ff;"><span style="font-size: 12px;"><span style="font-family: Verdana;"><strong>$10 Flate rate - if you order fits in a 3kg satchel it will be posted via express post</strong></span></span></span><br />
    &nbsp;</p>
    </div>

    As it is currently, a <div> tag is missing and the FORM is not properly coded. This may or may not solve the Quantity problem but it is coding that needs to be corrected.

    Speaking of which, I found the above problems using the validator.w3.org which is always a handy tool--regardless of having problems or not.

 

 
Page 1 of 2 12 LastLast

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. v153 No Quantity Box In Shopping Cart To Update
    By inklingsolutions in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 20 Nov 2014, 04:48 PM
  3. Unable To Update Cart Count On Product Page Or Cart
    By Earnest-Enterprises in forum General Questions
    Replies: 9
    Last Post: 26 Jan 2011, 01:25 AM
  4. 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
  5. 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

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