Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Flat rate shipping change

    Hi everyone,

    I had modified my flat.php shipping rules in includes/modules/shipping/ to offer a flat rate if the checkout was less than $250.

    I put in this handy code that said:

    Code:
          if (($_SESSION['cart']->show_total()) < 250) {
            $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
          }
    Which worked perfect.

    But after transferring servers I now get the error:

    Fatal error: Call to a member function show_total() on a non-object in flat.php on line 41
    Can anyone tell me what I have to add to allow the $_SESSION['cart']->show_total() to work on the flat.php page?

    Thanks so much in advance.

    Adam.
    - pensive612

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Flat rate shipping change

    But after transferring servers I now get the error:
    Would really help to know the server details for both servers
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Flat rate shipping change

    Change your IF to include:
    IS_ADMIN_FLAG

    Code:
    if (!IS_ADMIN_FLAG && ($_SESSION['cart']->show_total()) < 250) {
    This way the Admin does not try to processes the code that isn't available to it ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Flat rate shipping change

    Aah. 2 of my favorite people in all of Zen Cart... :)

    The code worked perfect Linda. Thank you so much.

    Although, I wonder is it still processing the statement? Or does the flag just prevent it from running...

    And to Kobra. Thank you for asking... Both are Dedicated Quad-core Linux Servers administered with WHM.



    Adam.
    - pensive612

  5. #5
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Flat rate shipping change

    On another note. I just have to say. That as much competition as there is in open-source eCommerce. And while there is always undeniable pressure on developers to provide clients with the "latest and greatest" solutions....

    Zen Cart's support and community is unparalleled. I have never seen a community come even close to Zen Cart's. The both of you have been there since the beginning for me. And I can't tell you how much it means... You set an entirely different standard.

    I'm speechless.

    Thank you...
    - pensive612

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Flat rate shipping change

    You are most welcome ...

    The addition to the IF just says, IF I am the Admin ( !true meaning IS_ADMIN_FLAG is true but the ! says NOT) ... stop! don't look at the $_SESSION['cart'] as it don't exist here ...

    But in the Catalog ... it says IF I am I am NOT the Admin (IS_ADMIN_FLAG is false and !false is true) go! keep processing this IF statement as now the $_SESSION['cart'] does exist here ...

    Easy smeazy, eh?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Flat rate shipping change

    ha.... piece of cake.

    thanks for the explanation. I'm sure someone else is going to make good use of this page at some point too.

    Its a great way to have conditional shipping options...

    There's a cup of coffee and a donut in the mail for you too. Been a while.

    Have a good day.

    Adam.
    - pensive612

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Flat rate shipping change

    Thanks you kindly ... we appreciate the support to help keep us awake and coding ... and coding ... and coding ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Trying to change title of Flat Rate shipping
    By bubbadan in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 1 Feb 2012, 09:48 PM
  2. Rate Table Shipping plus Flat Rate Shipping
    By JRayfield in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Dec 2008, 12:23 AM
  3. Flat rate in US but flat rate + $1 for ea additional item - International?
    By bakdoor in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 19 Oct 2008, 12:07 AM
  4. Flat Rate shipping challenge - need a separate rate for a few heavier items
    By Nigel Lew in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 27 Jun 2008, 10:07 PM
  5. Flat rate, then another flat rate for certain heavy products?
    By JohneeMac in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 27 Mar 2007, 07:37 PM

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