Jump to content


Recommended Posts

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?





Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...