atomreaktor Posted April 5, 2014 Share Posted April 5, 2014 Hello guys,I'm running one stores with two payment gateways, Paypal and Print Order Form. How can I add a percent discount (-3% to basket) by selecting print order form? I've tried to add the discount like this (in /modules/gateway/Print_Order_Form/gateway.class.php) $transData['amount'] = $order_summary['total']*0.97; But it didn't help. Where should I add the percent discount? Regards, Atomreaktor Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 5, 2014 Share Posted April 5, 2014 That will be a challenge as CubeCart has calculated the bottom line before the gateway is chosen. You may be able to add some language to the form itself, and maybe do some calculations, to indicate an adjusted total to be remitted. Then, when the payment comes in and clears the bank, you will need to manually adjust the Grand Total of the Order Summary when you move the order to Completed. Quote Link to comment Share on other sites More sharing options...
atomreaktor Posted April 5, 2014 Author Share Posted April 5, 2014 ok... what's about to add a fifth checkout step between Payment step and Complete step? I'll give a try on my testing site. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 5, 2014 Share Posted April 5, 2014 In the file /classes/cubecart.class.php, near line 1545, the function _displayGateways() will either list all available gateways (or auto jump if only one), or have the gateway do its processing. At two places in the code (line 1551 and 1587), CubeCart will update the Order Summary record with the name of the gateway used. We can take this opportunity to also change the discount and total columns as well. if $name == "Print_Order_Form", $this->_basket['discount'] and $this->_basket['total'] can be adjusted. $GLOBALS['db']->update('CubeCart_order_summary', array('gateway' => $name, 'discount' => $this->_basket['discount'] + 2.50, 'total' => $this->_basket['total'] - 2.50), array('cart_order_id' => $this->_basket['cart_order_id'])); The next step is to figure the math to recalculate the tax. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.