different charge on differenet payment options
Dear friends,
We are running a live store, we are accepting 2 types of payments. 1 is cc other is money order. with cc it is ok. but we need that when a customer selects, money order, we want to make %4 discount and show on invoice, in admin and ... is it possbile? charge total amount % 4 so the customer will see how much he has to transfer to our bank accounts any help is welcome. sincerely, Onur Caki |
Just cleaning up the forum and wanted to know if this request was fulfilled yet? If not, please let me know and I will keep the thread. Thanks! :)
|
Here's what we just implemented. This is with 4.0.14. Our conditions are payment method "Checks/Money Orders" and non-Wholesale customers.
1. Pass the paymentid by changing cart.php around line 587 from: Code:
# Code:
# 2. Accept the paymentid by changing include/func.php around line 1007 from: Code:
function func_calculate($cart, $products, $login, $login_type) { Code:
function func_calculate($cart, $products, $login, $login_type, $paymentid="") { 3. In the same file and function, pass the paymentid again by changing the following around line 1019: Code:
$result = func_calculate_single ($cart, $products, $login, $login_type); Code:
$result = func_calculate_single ($cart, $products, $login, $login_type, "", $paymentid); Code:
$result = func_calculate_single ($cart, $_products, $login, $login_type, $provider_for); Code:
$result = func_calculate_single ($cart, $_products, $login, $login_type, $provider_for, $paymentid); Code:
$result = func_calculate_single ($cart, $_products, $login, $login_type); Code:
$result = func_calculate_single ($cart, $_products, $login, $login_type, "", $paymentid); 4. In the same file, adjust function func_calculate_single to accept the paymentid by changing: Code:
function func_calculate_single($cart, $products, $login, $login_type, $provider_for="") { Code:
function func_calculate_single($cart, $products, $login, $login_type, $provider_for="", $paymentid) { 5. In the same file and function, add the following towards the end of the function: Code:
if ( ($customer_info[membership] != "Wholesale") && ($paymentid == 5) ) { Code:
# 6. Adjust skin1/customer/main/cart_totals.tpl by adding the following after the if block for "if $cart.discount gt 0": Code:
{if ( ($userinfo.membership ne "Wholesale") and ($smarty.get.paymentid eq 5) )} To also display this information in the order history and invoice: 7. Add the following to function func_order_data in include/func.php towards the bottom just above the return: Code:
if ( ($order[membership] != "Wholesale") && ($order[payment_method] == "Checks/Money Orders") ) { 8. Add the following to skin1/mail/html/order_data.tpl after the if block for "if $order.discount gt 0": Code:
{if ( ($order.membership ne "Wholesale") and ($order.payment_method eq "Checks/Money Orders") )} If anyone has any improvements to this, please post. :) |
can the mod move this to completed mods forum?
|
Done :)
|
thank you will try to implent and improve
|
why wil this not work for wholesale
Why wont this work voor wholesale?
I have two types of customers. one which pays the normal price. The other are the wholesale and they get 5% discount. Thanks for anyhelp. |
Re: why wil this not work for wholesale
Quote:
|
Thanks for quick response
I thought it was not possible because of the requirement above. but I wil give it a try
|
All times are GMT -8. The time now is 09:30 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.