outlet.ee Posted March 20, 2010 Share Posted March 20, 2010 I have COD installed and I want to get 20% down payment after the customer has confirmed the order. On payment choices there is field 'The total amount of your order is [total amount]. Is there any way of having this modified so that the total amount shown will be 20% of the original amount?Basically I need a modification of the line on the code which multiplies the order amount by 20%. Link to comment Share on other sites More sharing options...
rocky Posted March 20, 2010 Share Posted March 20, 2010 To change the total on the cash on delivery payment confirmation page, you can change the following code on line 18 of modules/cashondelivery/validation.tpl from: {convertPrice price=$total} to: {convertPrice price=$total*0.2} You could do the same on line 18 of order-payment.tpl in your theme's directory to change the total of the payment choices page. Link to comment Share on other sites More sharing options...
outlet.ee Posted March 20, 2010 Author Share Posted March 20, 2010 Thanks again! It works perfectly. Now on the next step, order-confirmation, there are instructions for making the down payment - bank account #, company name, I would like to have the amount for 20% and order # to be shown there as well, so all the necessary details for the payment would be together but this way it doesn't work there, it displays 0 for amount and order # both.And last question: how can I enable the cashondelivery mail to be emailed automatically to the customer after the order confirmation button has been pressed? It sends the email once the order status is manually set to COD. Link to comment Share on other sites More sharing options...
rocky Posted March 21, 2010 Share Posted March 21, 2010 You'll need to modify the hookPaymentReturn function in modules/cashondelivery/cashondelivery.php. The $params variable contains the IDs of the order and module. I think $params[0] should get you the order ID. You can add code like the following before the return line: $order = new Order($params[0]); $smarty->assign('totalPaid', $order->total_paid); This will pass the total of the order into modules/cashondelivery/confirmation.tpl.I'm sure how to tackle the email problem. Perhaps you can add another line to the code above to send an email. Link to comment Share on other sites More sharing options...
outlet.ee Posted March 21, 2010 Author Share Posted March 21, 2010 Thanks once again!Inserted the line: public function hookPayment($params) { if (!$this->active) $order = new Order($params[0]); $smarty->assign('totalPaid', $order->total_paid); return ; global $smarty; // Check if cart has product download foreach ($params['cart']->getProducts() AS $product) { $pd = ProductDownload::getIdFromIdProduct(intval($product['id_product'])); if ($pd AND Validate::isUnsignedInt($pd)) return false; } $smarty->assign(array( 'this_path' => $this->_path, 'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); } and in confirmation.tpl used this: {convertPrice price=$total*0.2} Where here I made the error as it is displaying just zeros for both the order # and total in confirmation page. Link to comment Share on other sites More sharing options...
rocky Posted March 26, 2010 Share Posted March 26, 2010 Sorry, that was meant to be before the second return line, not the first, and it should be $totalPaid*0.2, not $total*0.2. Link to comment Share on other sites More sharing options...
outlet.ee Posted March 26, 2010 Author Share Posted March 26, 2010 In bankwire it gives me the amount $0, no errors here so the php must be on order; in cashondelivery i did put it like this: if (!$this->active) return ; $order = new Order($params[0]); $smarty->assign('totalPaid', $order->total_paid); return $this->display(__FILE__, 'confirmation.tpl'); and there is an error (won't load the confirmation page at all). Link to comment Share on other sites More sharing options...
outlet.ee Posted March 29, 2010 Author Share Posted March 29, 2010 Kind worked it out myself, looks like it's working: copied a line 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, false), and added it as 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, false), 'total_to_pay_20p' => Tools::displayPrice($params['total_to_pay']*0.2, $params['currencyObj'], false, false), Then in payment-return.tpl used the variable {convertPrice price=$total_to_pay_20p} Is this all right? I mean, there will be no sudden errors in the future if I keep it this way? Link to comment Share on other sites More sharing options...
clemclem Posted July 2, 2010 Share Posted July 2, 2010 hi,This feature also interests me, do you found a solution ? Link to comment Share on other sites More sharing options...
outlet.ee Posted July 2, 2010 Author Share Posted July 2, 2010 Yes, it did, I don't remember what exactly I did there but it works. I can PM the files of the module if you like. Link to comment Share on other sites More sharing options...
clemclem Posted July 2, 2010 Share Posted July 2, 2010 If you can send it, it will be great !thank you ! Link to comment Share on other sites More sharing options...
Krokodiel Posted August 17, 2010 Share Posted August 17, 2010 ... and does someone know how I can change the code so the customer receives an order confirmation when he chooses the COD method?ThnxFilip Link to comment Share on other sites More sharing options...
outlet.ee Posted August 17, 2010 Author Share Posted August 17, 2010 The confirmation email is sent anyway no matter what payment was used. In the email there is the payment method mentioned already. I did put all the extra information regarding COD in that email, at the end it says like 'If you choose the COD, here is the information for you: ...' Link to comment Share on other sites More sharing options...
Krokodiel Posted August 17, 2010 Share Posted August 17, 2010 Not in my shop... if they choose an other payment method (paypal or bank wire) they receive a confirmation e-mail of their order. If they choose the COD method... they receive nothing... Link to comment Share on other sites More sharing options...
outlet.ee Posted August 17, 2010 Author Share Posted August 17, 2010 Check in your BO - Orders - Statuses - whether you have enabled the email if the order is set to that status (COD). Link to comment Share on other sites More sharing options...
caly16 Posted September 20, 2010 Share Posted September 20, 2010 Hi,how to do to round, two numbers after point ? example: 50/3 = 16.6667 => 16.67 (or 16.66)With : 'total_to_pay_20p' => Tools::displayPrice($params['total_to_pay']*0.2, $params['currencyObj'], false, false), {convertPrice price=$total_to_pay_20p} And them, to email could you give code to "*0.2" with : '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false), '{total_to_pay_20p}' => *0.2 ??????? I try to change in modulePayment.php:'{total_to_pay_20p}' => Tools::displayPrice($order->total_paid *0.2, $currency, false, false),and in modules/mailalerts.php:'{total_to_pay_20p}' => Tools::displayPrice($order->total_paid*0.2, $currency),In the mails/mail.html i write :{total_to_pay_20p}but it is not that.Very Thanks (sorry my writing english) Link to comment Share on other sites More sharing options...
Telmo E. Julião Posted September 20, 2011 Share Posted September 20, 2011 I would like to know this too. I've checked several files and couldn't find a solution for this (change the value of total_paid) Link to comment Share on other sites More sharing options...
Telmo E. Julião Posted November 1, 2011 Share Posted November 1, 2011 Bump? Link to comment Share on other sites More sharing options...
rahulr85r Posted October 30, 2012 Share Posted October 30, 2012 hey team, i have installed this cod module, I was wondering if i could have one more step added into the process where the downpayment is payable immediately (with the existing payment gateways). for example (as per the first post) ... ones the customer selects COD, he is taken to the order confirmation page where it shows the downpayment price. on clicking next instead of confirming, it shows him the payment gateways to pay up the downpayment. Any tips on this please ?? (if there is any paid modules to do the same i dont mind purchasing either). Thanks, R Link to comment Share on other sites More sharing options...
mohitaggarwal Posted March 29, 2013 Share Posted March 29, 2013 Hello Everyone, I need something similar to what "rahulr85r" has posted. Can someone please help ? Thanks, Mohit hey team, i have installed this cod module, I was wondering if i could have one more step added into the process where the downpayment is payable immediately (with the existing payment gateways). for example (as per the first post) ... ones the customer selects COD, he is taken to the order confirmation page where it shows the downpayment price. on clicking next instead of confirming, it shows him the payment gateways to pay up the downpayment. Any tips on this please ?? (if there is any paid modules to do the same i dont mind purchasing either). Thanks, R Link to comment Share on other sites More sharing options...
panoramis Posted April 4, 2013 Share Posted April 4, 2013 Hello, sorry for my English is very bad and I do not understand most modifications, someone can upload the modified full module for version 1.5.3??? Thanks in advance. Link to comment Share on other sites More sharing options...
OEM+ Performance Posted April 28, 2013 Share Posted April 28, 2013 (edited) hey team, i have installed this cod module, I was wondering if i could have one more step added into the process where the downpayment is payable immediately (with the existing payment gateways). for example (as per the first post) ... ones the customer selects COD, he is taken to the order confirmation page where it shows the downpayment price. on clicking next instead of confirming, it shows him the payment gateways to pay up the downpayment. Any tips on this please ?? (if there is any paid modules to do the same i dont mind purchasing either). Thanks, R Hello Everyone, I need something similar to what "rahulr85r" has posted. Can someone please help ? Thanks, Mohit I also need something similar. Help needed! I'm using COD with fee v1.8 Thanks, Victor Edited April 28, 2013 by OEM+ Performance (see edit history) Link to comment Share on other sites More sharing options...
waseem007 Posted November 19, 2013 Share Posted November 19, 2013 Hello,Can you please send me the COD module and files in which you made the changes.Thanks In Advance. Link to comment Share on other sites More sharing options...
lovecustomart Posted May 18, 2014 Share Posted May 18, 2014 Hi all new to prestashop and I need the 20% deposit as well - since it has been some time - does the solution still work or perhaps there is a better one now? I would appreciate if one of you could let me know before I start digging myself into the setup of prestashop Thanks Link to comment Share on other sites More sharing options...
ABANGWEB Posted August 17, 2015 Share Posted August 17, 2015 Any solution display TOTAL DP in email and Invoice... ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now