Delivery Cost by distance

beachi

Avatar: beachi

2011-09-14 16:14

<?php
Hi all
,

is it possible to integrate deliverycost by distance?
I am still using Quickcart 2.1

So far I have managed with php 
and ajax to get the distance in kilometer after the customer puts in the zipcodeThe kilometer appears in a <div>.

Now i am stuck.
I dont know how I can get the kilomters Courier cost from delivery page to orders print and emailI am also using TaxAndDiscount because we have different tax for delivery and products.

Can anybody help on this one?
?>

» Quick.Cart v2.x

beachi

beholder

Avatar: beholder

2011-09-14 20:50

Hello, it is possible to integrate it. But you would probably have to integrate it in js and also in php - almost separately (because you can't rely on JS for it being hackable).

Now, the function you're looking for is ordersCouriers() in file js/orders.js. Modify it to get the content of your div and actually check if it has any.. This might not be very simple.
Perhaps your plugin taxAndDiscount also includes this function but in a modified form. In such a case, edit that one.

Next you need to edit php code to get the distance and include the distance price calculation in throwCourierPayment() perhaps. But I am not even sure if you have this function in your QC 2.1 code.

http://cicmanec.sk/easyplugins/

beachi

Avatar: beachi

2011-09-15 07:48

Hi beholder,
thanks for answering. Well the distance and the new calculated deliveryCost shows up on the delivery page where it is supposed to be as deliveryCost. So far I have accomplised it.

My problem is that this calculated deliveryCost doesn't get carried over to the order print nor the Email. It only shows the static courierCost which I set up in admin.

Do you have an idea how I can accomplish this or where I need to look?
I appreciate your help. Thanks.

beachi

beachi

Avatar: beachi

2011-09-17 12:21

No one can help, please?

beachi

beholder

Avatar: beholder

2011-09-18 15:22

Yes, that's why you still need to carry out the calculation of distance to the PHP. Look, basically, a customer chooses distance in a form. You take the distance from $_POST in php and then you calculate a new delivery cost, which is of course different than the original delivery cost of the carrier. Then you save this delivery somehow (or save whole order for that matter). I don't remember the QC 2.1 code very well to write you specifically where to edit. But if you understand PHP then it should not be a problem for you.

If it is a problem, I am able to help you out commercially. Lately I've been editing QC 2.x to several customers satisfaction. Do let me know on my email in such a case.

http://cicmanec.sk/easyplugins/

beachi

Avatar: beachi

2011-09-19 01:07

Hi beholder,
what is your email?
Can't find it? Or are you Tyler at the url in your signature?

beachi

beholder

Avatar: beholder

2011-09-22 22:30

This has been done to Beachi's satisfaction.

Back to top
about us | contact