Need to change shipping amount when order is placed

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Need to change shipping amount when order is placed

Post by Mike718NY » Tue Aug 05, 2008 9:51 am

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Need to change shipping amount when order is placed

Post by mazhar » Tue Aug 05, 2008 10:16 am

I think you want it on the admin side, am i right?

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: Need to change shipping amount when order is placed

Post by Mike718NY » Tue Aug 05, 2008 10:29 am

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Need to change shipping amount when order is placed

Post by mazhar » Tue Aug 05, 2008 10:52 am

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

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: Need to change shipping amount when order is placed

Post by Mike718NY » Tue Aug 05, 2008 11:10 am

That worked, . . thanks mazhar

I have to get used to working and understanding with the admin,
I more used to working on code directly.

Post Reply