Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    283
    Plugin Contributions
    0

    Default freeship after discounts - code

    Im working on fixing the age old problem of free shipping . If free shipping is offered (via Modules > Order Total > Shipping) for "order amounts" over xxx.xx it should only be applied after discount coupon has been applied and based on a the new subtotal that has the coupon amount deducted.. In order to do this. I need to have the variable $od_amount['total'] from ot_coupon.php available to function process() in ot_subtotal.php Can a zen guru enlighten me on how I can make this variable available to that function?

    Also, if you see an error in my logic feel free to let me know.

    Thanks
    Last edited by makenoiz; 3 Feb 2011 at 05:26 AM.
    22 stores and counting! Ive been zenned.

  2. #2
    Join Date
    Mar 2006
    Posts
    283
    Plugin Contributions
    0

    Default Re: freeship after discounts - code

    So a little more on this -need some coders to jump in and help if you can.


    Im trying set a redirect to the shipping page in the checkout_confirmation header as follows:


    Code:
     if ($_SESSION['shipping']['id']=='free_free' && ($_SESSION['subTotAfterDisc'] < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)){ 
        
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); 
    }
    $_SESSION['subTotAfterDisc'] is set in ot_subtotal at the end of process() as follows

    Code:
    $_SESSION['subTotAfterDisc'] = $currencies->format(($order->info['subtotal']- $_SESSION['discountCoupon']), true, $order->info['currency'], $order->info['currency_value'])
    And $_SESSION['discountCoupon']) is set in ot_coupon at the end of process() as follows:
    Code:
    $_SESSION['discountCoupon']=$od_amount['total'];
    Once the process hits the header.php of the checkout_confirmation the session variable I have set is wiped out.

    I have not coded any unsets on that Session Variable. Any coders have an idea of whats happening. If anyone can help with the code or the logic, I would greatly appreciate it.

    Thanks
    Last edited by makenoiz; 7 Feb 2011 at 09:53 PM.
    22 stores and counting! Ive been zenned.

 

 

Similar Threads

  1. Shoppingcart/Freeship in Header support
    By gjh42 in forum All Other Contributions/Addons
    Replies: 180
    Last Post: 20 Aug 2015, 04:07 AM
  2. Error on page after checkout after using COWOA code.
    By vedavyas govardhanam in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Oct 2009, 12:46 PM
  3. Help on Promo-Code or Discounts!
    By mrernesto in forum Managing Customers and Orders
    Replies: 1
    Last Post: 20 Dec 2008, 09:14 PM
  4. calculate VAT after discounts
    By rlparker in forum General Questions
    Replies: 2
    Last Post: 3 Jul 2008, 08:10 PM
  5. Calculate shipping after discounts?
    By deb in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 28 Nov 2007, 08:26 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