If this is your first visit, check our documentation. To post, register or login.
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Order Total Discount - possible Solution

Order Total Discount - possible Solution

Locked

Started by crazycucumber on 4 Sep 2006, 8:34 PM · Views: 3,704

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
4 Sep 2006, 8:34 PM
#1
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Order Total Discount - possible Solution

HI , after reading the forums for a solution to my clients request that any order over 150 GBP should have an automatic 10% discount , and not finding one , I attemted to write my own.

With only basic knowledge I got this to half work :- By changing the ot_total.php in the modules/order_toal directory with this bit of simple code :-

    function process() {
      global $order, $currencies;
      if ($order->info['total'] > 150) { 
      
      
       $this->title = 'Order Total less 10% Discount';
      
      
      $this->output[] = array('title' => $this->title . ':',
                              'text' => $currencies->format($order->info['total']-($order->info['total']*0.1), true, $order->info['currency'], $order->info['currency_value']),
                              'value' => ($order->info['total']-(($order->info['total'])*0.1)));
                              } else {
                              
      $this->output[] = array('title' => $this->title . ':',
                              'text' => $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']),
                              'value' => ($order->info['total']));
                              }
    }

This seemed to work when going through the checkout process until you pass the payment to worldpay , then it reverts to the original total before the discount.

Can anyone help with this ? as I have reached the limits of my programming knowledge !

Thanks all

Various Zen cart sites !

4 Sep 2006, 9:06 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Order Total Discount - possible Solution

Why don't you just use Quantity Discounts? It's already done.

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=235

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Sep 2006, 9:12 PM
#3
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: Order Total Discount - possible Solution

OK but thought that module was based on a order quantity . i.e when you have ordered 10 of something , rather than when your order reaches $150 get a total discount of 10%

Im just installing your mod to see what it does !

Thanks for the reply

Various Zen cart sites !

4 Sep 2006, 9:23 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,758
Plugin Contributions:
56

Re: Order Total Discount - possible Solution

It's not hard to go from number of items to dollars spent. PM me if you need help.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Sep 2006, 9:25 PM
#5
crazycucumber avatar

crazycucumber

Zen Follower

Join Date:
Jan 2006
Posts:
403
Plugin Contributions:
0

Re: Order Total Discount - possible Solution

ah ok I see , Take your module and adapt it ! .... ok , a PM may come your way when I have had a few hours playing !

Thanks

MARK

Various Zen cart sites !