Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    168
    Plugin Contributions
    0

    Default 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
    Last edited by bangsters; 8 Nov 2007 at 07:15 AM.

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

    Default 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?
    .

    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 2006
    Posts
    168
    Plugin Contributions
    0

    Default 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!

 

 

Similar Threads

  1. display the total weight In admin
    By dmagic in forum Managing Customers and Orders
    Replies: 4
    Last Post: 3 May 2011, 02:28 PM
  2. how to get rid of "total weight" in shopping cart.php?
    By Ms_X in forum General Questions
    Replies: 2
    Last Post: 26 Oct 2010, 02:26 PM
  3. Limit payment methods as function of the total buying price
    By sanji in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 13 Sep 2008, 06:36 AM
  4. UPS shipping total weight is incorrect, estimate weight button is correct
    By cmwords in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 27 Jun 2007, 05:43 AM
  5. How can I remove the total weight from the shopping cart?
    By weber in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Jun 2007, 04:41 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