Page 1 of 1
Need to change shipping amount when order is placed
Posted: Tue Aug 05, 2008 9:51 am
by Mike718NY
When the "Place Order" button is clicked, I need to use this code:
If (SubTotal < 70.00)
shippingAmt = 5.95
Else
shippingAmt = 0.00
I can't find where to insert this code. I'm looking in:
/ConLib/Custom/OnePageCheckout.ascx
Can anyone assist me on where/how I can do this? thanks
Re: Need to change shipping amount when order is placed
Posted: Tue Aug 05, 2008 10:16 am
by mazhar
I think you want it on the admin side, am i right?
Re: Need to change shipping amount when order is placed
Posted: Tue Aug 05, 2008 10:29 am
by Mike718NY
If the order is over $70.00, shipping is free, otherwise $5.95.
I could add shipping options for this, . . but,
this should be automatic without the customer having to select it.
I will need to have the correct Shipping Amount total (either 5.95 or 0.00)
written to that field in the database.
For example, on the BasketTotalSummary.ascx page, I added:
if (subtotal < 70M)
{
Shipping.Text = "$5.95";
}
else
{
Shipping.Text = "FREE";
}
But this is just for display . . . more importantly, I need to change
the value of the actual shipping amount field that is used in the database.
I just can't locate it yet. Do you know what page or control it is in? thanks
Re: Need to change shipping amount when order is placed
Posted: Tue Aug 05, 2008 10:52 am
by mazhar
You must not change the shipping amount using your code. AbleCommerce process the amount on it own in the back end. So changing the amount directly will cause unpredictable results. You have to configure the shipment methods from the admin. You can do this by creating two shipment method of type very by cost.
For the first specify the that if order price is more then 70 then shipping amount 0 and for the second specify that if the order amount is between 1 to 70 then shipping amount is 5.95
Re: Need to change shipping amount when order is placed
Posted: Tue Aug 05, 2008 11:10 am
by Mike718NY
That worked, . . thanks mazhar
I have to get used to working and understanding with the admin,
I more used to working on code directly.