Post by sopranodesign » Thu Oct 24, 2013 8:39 am

I've added a delivery date in checkout's step 5 "delivery method" with this module. If the user selects a weekend, I need to add a 20% surcharge on the order.

Any ideas?

New member

Posts

Joined
Mon Dec 19, 2011 8:52 am

Post by butte » Thu Oct 24, 2013 9:55 am

The first one is, what are your version, theme, extensions, and question?

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by sopranodesign » Fri Oct 25, 2013 11:13 pm

Sorry, I wrote the post hastily. My OC is version 1.5.6

I've installed the Date Delivery Picker Shipping Option module, where the user selects the date when he wants his order delivered with the shipping cost $0. Here's what I'm trying to do at the moment: if the user selects a day that falls on a weekend a 20% surcharge should apply.

Once the user picks a date with the datepicker, I'm guessing I may need an ajax call with this date to a method of a controller which calculates if the date is on a weekend, and if so, to change the shipping cost (see screenshot below) from $0 to 20% of the order total (ex: if the order is worth $100, the shipping would be $20 but only for weekend orders).

Image

Any tips or ideas on how I can accomplish something like this?

New member

Posts

Joined
Mon Dec 19, 2011 8:52 am

Post by butte » Sat Oct 26, 2013 4:23 am

Okay, MTWTF zero, Saturday 20%, Sunday no dice. That could be a bit dicey on most TFs trying to beat timelines for Saturdays (2-day or 1-day, due Saturday) -- if on TF not getting it there on Saturday already owes to you rather than to carrier, you're stuck for the, um, booboo. You need to pass shipping date to checkout. Three practical ways out.

Don't allow week end deliveries. They mess up your own TF week days.

Let customer insert a date, run that straight through a php date/day converter, pass Saturday as $20, Sunday as M (some will inevitably pick Sunday), to the arithmetic stack, and be done with it.

Ditto but as a text entry in mandatory YYMMDD format.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by sopranodesign » Sun Oct 27, 2013 2:04 pm

I needed this for a catering business. I've started from scratch and created my own vqmod module:

I've duplicated the Flat Rate shipping, called it "Delivery" and set the cost to $0. This is my only shipping option. Then I've added a mandatory date & time picker on the checkout page on the "Delivery Details" step. On the next step, if the date selected previously, falls on a weekend (saturday or sunday) the cost is 20% of the order total, if not it's $0 (or whatever the setting is in Admin > Extensions > Shipping > Delivery > Cost).

If anyone wants this module, let me know and I'll upload it.

New member

Posts

Joined
Mon Dec 19, 2011 8:52 am

Post by butte » Sun Oct 27, 2013 10:33 pm

Kudos, to say the least. (Kudos, too, for having active patronage enough for you to need that.) A reason for editing above to add that as an attachment is that it will relate to your prior need resolved at http://forum.opencart.com/viewtopic.php?f=10&t=86973 , and there will be need for both distinctive variants of flat rate shipping.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am
Who is online

Users browsing this forum: No registered users and 1 guest