Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default grab shipping total amount separately

    Hello, been at this and can't seem to extract just the shipping amount from order total... here is what I poked at...

    (Shipping Type) - $x.xx

    PHP Code:
    <?php echo substr(str_replace($united$usps$order->info['shipping_method']), 038) . $break $order->totals[$i]['text']; ?>
    It is grabbing the shipping total, but if there are other totals involved (Tax, insurance etc), then it grabs that $ instead. How do I specify ONLY ot-shipping-Amount?
    It also displays $0.00 and other times nothing at all, quite sporadic.... very odd.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: grab shipping total amount separately

    not all ot_xxxx records are for shipping, hence your sporadic stuff. If you want ot_shipping specifically, select only the ot_ records that are for 'ot_shipping'

    and if you use 'value' instead of 'text' you'll get just the amount instead of any related descriptions
    .

    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
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: grab shipping total amount separately

    thanks for making me think! This did the trick...

    00 were in the mix, so I chopped them off.

    PHP Code:
    <?php 
       $shiptotal 
    $db->Execute("select value from orders_total where class='ot_shipping' and (value > 0 or text='PAID') and orders_id='" . (int)$oID "'");
       
    ?>
       <?php echo substr(str_replace($united$usps$order->info['shipping_method']), 038) . $breakm number_format((float)($shiptotal->fields['value']), 2'.'''); ?>

 

 

Similar Threads

  1. v139h Hide/show shipping options by cart total dollar amount.
    By Barf in forum Addon Shipping Modules
    Replies: 4
    Last Post: 13 Nov 2014, 03:27 AM
  2. shipping cost for total order amount over $200
    By george_usa in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 17 Dec 2010, 11:35 AM
  3. Coupon lowers order total below Free shipping amount requirement
    By abko in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 24 Mar 2009, 05:59 PM
  4. Tax amount excluded from total amount transferred to Paypal
    By Rykmann in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 1 Dec 2007, 11:29 PM
  5. Shipping charge as a % of the total order amount
    By JayZhen in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 25 May 2006, 05:26 AM

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