Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-09-2014 17:56:21

JDLS88
Member
From: Maryland, USA
Registered: 07-06-2011
Posts: 102
Website

Disable a free shipping option if discount code used?

Is there a way to check for a discount code in a shipping script?

Basically I've got a custom shipping script setup with 3 shipping methods free, regular, expedited. In order to qualify for free, you need to spend at least x amount of dollars. I want to set it up so that if someone uses for a discount code for x% off the subtotal, it'll disable that shipping option and force a flat fee.


Jeremy D.

Offline

 

#2 06-10-2014 03:30:54

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: Disable a free shipping option if discount code used?

I've asked a similar question before, and the answer was basically no.

The shipping script is run before you get to checkout and therefore the discounts are not known at that point.

You can run through the shopping cart contents in the shipping script to work out if any discounts are applicable, and if so do what ever you need to do. The problem then is you are assuming the customer will actually enter the discount code in the box.


Rob

Offline

 

#3 06-11-2014 09:32:35

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Disable a free shipping option if discount code used?

+1 for Zanart's response.  The shipping calc is done before discount calculations (because discounts can apply to shipping).


Nick Hendler

Offline

 

Board footer