Zen Cart Logo
Forums / General Questions / function to get the total weight?

function to get the total weight?

Locked

Views: 1,258

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Nov 2007, 6:11 AM
#1
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

function to get the total weight?

Hi.

I'm trying to get the total weight of the shopping cart contents, however if I try to use this function: $weight = $_SESSION['cart']->show_weight();, the shipping module does not load in the admin area....i tried putting this in one of the shipping modules and no luck....

i've tried this on a fresh install of zencart 1.3.7.1 and it's not working....

..any advice?

thanks

8 Nov 2007, 7:31 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: function to get the total weight?

That is the correct function; however, it cannot be run when in admin mode.

So, that means that you're either running it in the wrong spot of the module, or you need to tell that line of code not to run when in admin mode by wrapping an "if" statement around it with this condition:** (IS_ADMIN_FLAG === false) **
Yes, that IS three equal signs.

You're most likely asking for weight in the wrong place. What exactly are you trying to do?

8 Nov 2007, 1:12 PM
#3
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: function to get the total weight?

ahh so that's what it is :)

thanks for that info :) I was trying to limit flat rate to show up only on a certain range of weight total....so I placed it in flat.php in my modules -> shipping area... but everytime i try to go to my admin section -> modules -> shipping, the shipping don't load up....

thanks!