Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jun 2004
    Posts
    135
    Plugin Contributions
    0

    Default Error with Minimum Order Function, I think.

    I am getting the following error when viewing my shopping cart, the error does not allow anyone to checkout.

    Code:
    Fatal error: Call to a member function show_total() on a non-object in /home2/xxxxxx/public_html/includes/templates/template_default/templates/tpl_shopping_cart_default.php on line 220
    This is line 220 in the template

    Code:
    if ($cart->show_total() <= MIN_ORDER_AMOUNT) {
    This was all working just fine forever, I don't understand what broke it. Nothing has changed.

    Your help would be most appreciated.

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

    Default Re: Error with Minimum Order Function, I think.

    Two things are giveaways that you're using code from another shopping cart:
    a) Zen Cart doesn't have a line that looks like that on line 220 of that file. I checked v1.1.4, v1.2.4, v1.2.7 to verify.
    b) Zen Cart uses $_SESSION['cart'], not $cart, so that's clearly not Zen Cart code, and would never have worked on Zen Cart.

    PLUS, if you're using a v1.2.x or older version of Zen Cart then you're using antiquated software, and have security vulnerabilities on your site that could allow a hacker in very easily. You need to upgrade to the latest version immediately.
    .

    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
    Jun 2004
    Posts
    135
    Plugin Contributions
    0

    Default Re: Error with Minimum Order Function, I think.

    I'm not sure why you think this is code from another cart because this is zencart. I've never joined code from other carts into this one. This minimum order function is standard with this version of ZC, I think. It might be an addon.

    I know I'm using an old version of ZC but it's so complicated and daunting to upgrade that I just don't want to do it.

    I want to scrap the whole site all together and start from scratch but I want to make sure I can easily import all the products and pictures into the new version. Can this be done?

    Can this minimum order issue be fixed in the interim? We are losing sales while the cart is down.

    I've attached the whole template file for your perusal.

    Thank you
    Attached Files Attached Files

  4. #4
    Join Date
    Jun 2004
    Posts
    135
    Plugin Contributions
    0

    Default Re: Error with Minimum Order Function, I think.


  5. #5
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Error with Minimum Order Function, I think.

    QUESTION: When did this problem first start for you?

    That line of code is definitely not coming from any officially-released version of Zen Cart.

    After searching numerous old versions to try and guess which version you're using (Please always state your actual version number in your posts), your attached template file appears to have come from code akin to v1.2.0, with the *only* difference in that template file being exactly the section of code you're quoting from:
    Code:
      <?php
      // minimum order total
          if ($cart->show_total() <= MIN_ORDER_AMOUNT) {
      ?>
            <tr>
              <td class="stockWarning" align="center"><br><?php echo sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format(MIN_ORDER_AMOUNT)); ?></td>
            </tr>
      <?php
          }
      ?>
    As I said, Zen Cart does not use $cart as a variable name. The fact that you've got it in your template tells me you copied it from either an addon or someplace that's quoting or offering code suggestions for other software that had a similar initial base as Zen Cart did in its early days.

    AS A BANDAGE you could change the reference to $cart-> to $_SESSION['cart']-> .... BUT if MIN_ORDER_AMOUNT and TEXT_ORDER_UNDER_MIN_AMOUNT aren't defined anywhere else then you'll end up with errors or broken functionality, because that functionality did not exist in that version.
    I REPEAT: That is MERELY A BANDAGE, and not a proper complete fix.
    .

    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.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Error with Minimum Order Function, I think.

    Quote Originally Posted by prosam View Post
    I know I'm using an old version of ZC but it's so complicated and daunting to upgrade that I just don't want to do it.
    It's no more complicated than rebuilding your site from scratch.
    Quote Originally Posted by prosam View Post
    I want to scrap the whole site all together and start from scratch but I want to make sure I can easily import all the products and pictures into the new version. Can this be done?
    Yes. The official upgrade procedure has always retained your data from older versions.
    You'll need to upgrade to 1.3.9h first, and then upgrade to 1.5.x afterward, since v1.5.x dropped support for upgrading v1.2.x and older versions since they're more than 6-8 years old and officially no longer supported.
    .

    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.

  7. #7
    Join Date
    Jun 2004
    Posts
    135
    Plugin Contributions
    0

    Default Re: Error with Minimum Order Function, I think.

    I'm running 1.2.1 patch 1 atm. Can I go straight from there to 1.3.9h or do I need to upgrade from 1.2.1 to something in between first?

  8. #8
    Join Date
    May 2010
    Location
    WA State
    Posts
    1,678
    Plugin Contributions
    3

    Default Re: Error with Minimum Order Function, I think.

    I'm not sure why you think this is code from another cart because this is zencart.
    Take a look at some of the files in your Zen Cart installation. Guess who's handle you'll see appearing in the author information section for many of them. That would be DrByte.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Error with Minimum Order Function, I think.

    Quote Originally Posted by prosam View Post
    I'm running 1.2.1 patch 1 atm. Can I go straight from there to 1.3.9h or do I need to upgrade from 1.2.1 to something in between first?
    Upgrades involve upgrading (actually rebuilding) your PHP, etc files AND upgrading your database data.

    You can actually upgrade to 1.5.0 directly as far as all the PHP, etc files are concerned.
    But when it comes to upgrading your database data, you'll need to do that in two steps:
    a) use the zc_install from v1.3.9h to upgrade the database from 1.2.x to v1.3.9h. It will give you several checkboxes so that you can step through the upgrades for each version that is in-between, finally ending up with a database ready for v1.3.9h.
    b) then use the zc_install from v1.5.x to upgrade from 1.3.9h to v1.5.x
    .

    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.

  10. #10
    Join Date
    Jun 2004
    Posts
    135
    Plugin Contributions
    0

    Default Re: Error with Minimum Order Function, I think.

    Thanks DrByte. You are awesome as always.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Apply coupon with minimum order
    By jeking in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 3 Sep 2011, 03:06 PM
  2. Problem with Minimum Order amount.
    By Fett in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 16 Mar 2010, 12:57 AM
  3. Minimum order with dual pricing
    By Sunabac in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 22 May 2007, 09:27 PM
  4. minimum order with dual pricing
    By Sunabac in forum General Questions
    Replies: 0
    Last Post: 17 Jan 2007, 06:43 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