Hi!
Using OC 3.0.2.0. Freights are weight based. Commonly, customers pay right away with card. Then it's no problems. Occasionally, customers prefer Cash On Delivery. I.e. they don't pay when purchasing online but to the post office when they collect the package. That's extra fee (fixed sum regardless of weight).
But how on earth do I add this extra fee during the checkout? I don't know if I have explained well enough, so I'll exemplify.
Joe buys a thingy that cost USD 10 and weighs 1 kilo. He selects payment via credit card (via PayPal in my case). Total cost is USD 10 for the thingy and USD 5 for weight based freight. All well and ordered received.
Bill buys the same thingy for USD 10 and it still weight 1 kilo. But Bill doesn't have a credit card so he select the option for COD (Cash On Delivery). He'll pay USD 10 fpr the gadget, USD 5 for weight based freight, but also an additional USD 3 for the COD.
How do I set this up?
Using OC 3.0.2.0. Freights are weight based. Commonly, customers pay right away with card. Then it's no problems. Occasionally, customers prefer Cash On Delivery. I.e. they don't pay when purchasing online but to the post office when they collect the package. That's extra fee (fixed sum regardless of weight).
But how on earth do I add this extra fee during the checkout? I don't know if I have explained well enough, so I'll exemplify.
Joe buys a thingy that cost USD 10 and weighs 1 kilo. He selects payment via credit card (via PayPal in my case). Total cost is USD 10 for the thingy and USD 5 for weight based freight. All well and ordered received.
Bill buys the same thingy for USD 10 and it still weight 1 kilo. But Bill doesn't have a credit card so he select the option for COD (Cash On Delivery). He'll pay USD 10 fpr the gadget, USD 5 for weight based freight, but also an additional USD 3 for the COD.
How do I set this up?
Danne
----------------------------
https://proformica.com
The catalog/model/extension/payment/cod.php file would need to be edited.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
OK. I suppose I need to change true/false in a couple of instances?
Code: Select all
<?php
class ModelExtensionPaymentCOD extends Model {
public function getMethod($address, $total) {
$this->load->language('extension/payment/cod');
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('payment_cod_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if ($this->config->get('payment_cod_total') > 0 && $this->config->get('payment_cod_total') > $total) {
$status = false;
} elseif (!$this->cart->hasShipping()) {
$status = false;
} elseif (!$this->config->get('payment_cod_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}
$method_data = array();
if ($status) {
$method_data = array(
'code' => 'cod',
'title' => $this->language->get('text_title'),
'terms' => '',
'sort_order' => $this->config->get('payment_cod_sort_order')
);
}
return $method_data;
}
}
Danne
----------------------------
https://proformica.com
Since this is an extension module, the rest is up to you to decide.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi,
Thanks, but I don't have a clue what to decide.
What I'm after is a way to show an option for customers that prefer Cash on Delivery. It should be the same weight based shipping costs as if they paid right away with credit card, only that it would add an additional handling fee.
Please help me out here..
Thanks, but I don't have a clue what to decide.

What I'm after is a way to show an option for customers that prefer Cash on Delivery. It should be the same weight based shipping costs as if they paid right away with credit card, only that it would add an additional handling fee.
Please help me out here..
Danne
----------------------------
https://proformica.com
You need an Order Total extension (not a Shipping extension) that can add a fee based on payment method. If you want to code it yourself, look at the structure of Order Total extensions like the Handling Fee, and that should get you started.
If you want an extension that can do it, Simple Payment Fee can do basic flat rate or percentage fees, and Payment-Based Fee/Discount can do more complex fees, like those based on weight or quantity. Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.
If you want an extension that can do it, Simple Payment Fee can do basic flat rate or percentage fees, and Payment-Based Fee/Discount can do more complex fees, like those based on weight or quantity. Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.
Hi,Occasionally, customers prefer Cash On Delivery. I.e. they don't pay when purchasing online but to the post office when they collect the package. That's extra fee (fixed sum regardless of weight).
I can help you. Please read your PM.
Cheers
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
Who is online
Users browsing this forum: No registered users and 8 guests