Forums / Templates, Stylesheets, Page Layout / Flat rate shipping change

Flat rate shipping change

Locked

Views: 1,385

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
20 Feb 2010, 7:57 PM
#1
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

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:

      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
20 Feb 2010, 8:43 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

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

20 Feb 2010, 9:13 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Flat rate shipping change

Change your IF to include:
IS_ADMIN_FLAG

if ([B]!IS_ADMIN_FLAG && [/B]($_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!

20 Feb 2010, 10:05 PM
#4
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

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
20 Feb 2010, 10:09 PM
#5
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

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
21 Feb 2010, 12:17 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ... :cool:

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? :lamo:

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!

21 Feb 2010, 12:20 AM
#7
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

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
21 Feb 2010, 1:18 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Flat rate shipping change

Thanks you kindly ... we appreciate the support to help keep us awake and coding ... and coding ... and coding ... :P

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!