Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default [Done v156] Shopping cart class, invalid function parameters

    Looking through the /includes/classes/shopping_cart.php class, I found that the calculate method is supplying an incorrect number of arguments. The following code segment starts at line 887 for an unmodified version of that module from zc1.5.5f:
    Code:
                // attributes_qty_prices_onetime
                $added_charge = 0;
                if ($attribute_price->fields['attributes_qty_prices_onetime'] != '') {
                  $chk_price = zen_get_products_base_price($products_id);
                  $chk_special = zen_get_products_special_price($products_id, false);
                  $added_charge = zen_get_attributes_qty_prices_onetime($attribute_price->fields['attributes_qty_prices_onetime'], $qty);
                  $totalOnetimeCharge += $added_charge;
            // calculate Product Price without Specials, Sales or Discounts
                  $added_charge = zen_get_attributes_qty_prices_onetime($chk_price, $chk_price, $attribute_price->fields['attributes_price_factor_onetime'], $attribute_price->fields['attributes_price_factor_onetime_offset']);
                  $totalOnetimeChargeNoDiscount += $added_charge;
                }
    The first use of the highlighted function contains the correct number of parameters.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Shopping cart class, invalid function parameters

    I believe the 2nd instance should be shortened to:

    Code:
    $added_charge = zen_get_attributes_qty_prices_onetime($attribute_price->fields['attributes_qty_prices_onetime'], 1);
    https://github.com/zencart/zencart/pull/1985/files
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,621
    Plugin Contributions
    123

    Default Re: Shopping cart class, invalid function parameters

    Earlier changes were made in this area; see also:
    https://github.com/zencart/zencart/issues/1252
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Shopping cart class, invalid function parameters

    Oh, right. Same outcome. Just different branch.
    Will mark as done.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v156 can not add product to shopping cart.
    By davewest in forum General Questions
    Replies: 3
    Last Post: 24 Jul 2018, 10:31 PM
  2. Replies: 1
    Last Post: 22 Dec 2014, 08:55 PM
  3. passing parameters from poduct info page to shopping cart.
    By gmartakis in forum General Questions
    Replies: 11
    Last Post: 3 Jul 2013, 05:06 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