Hello @redwiregareth
Thank you for reaching out to us, we are here to help.
Without any details on your site, we cannot really do anything, so I would advise the same as Femi did on the older thread. This issue should not occur if you only use WooCommerce and our plugin, so you might want to perform some conflict testing to find out what is causing this.
Please provide the system report and logs, so we can take a look. If you don’t feel comfortable sharing those details on a public forum, please open a ticket with our service desk. You can find the instruction for this here: https://paypal.inpsyde.com/docs/request-support/
(please add the URL of this thread in the ticket as well)
Kind regards,
Joost
Can you point me to the correct file/function in your code that grabs the total before sending to Paypal? If you can do that I’ll be able to work the rest out myself.
Thanks you.
Hello @redwiregareth
This is not really possible, because it depends on what exactly you are looking for. You need to provide his custom code and clear steps to reproduce the problem, then we can try to reproduce the issue and see what we can provide to help. Ideally, this would be done in a private support ticket, so we can easier exchange details of the setup/situation.
So far, we have not received any details from your end, and we have little idea of what to provide you in order to help.
Kind regards,
Joost
Sure no problem, I am using the woocommerce_before_calculate_totals hook to alter the cart and discount it for the user before paying.
I have tried two different ways to discount the price but neither work with your plugin.
Solution 1:
Whilst looping the basket items I alter the price of an item using the set_price() function and reduce it.
Solution 2:
I add a negative cart fee which produces the discount e.g.
$cart->add_fee( ‘Promotional discount’, -$discount, true );
I have tested both these solutions with the following payment methods and they work fine:
- Stripe
- Worldpay
- Cash on delivery
- PayPal Standard
- Direct bank transfer
It even works with the old PayPal Standard integration, but not with the Woocommere PayPal Payments plugin.
Thanks in advance.
Hello Gareth,
When you say “did not work” you mean that the PayPal popup does not show the correct amount, but I do think that the correct amount would be charged in the end.
Typically, most payment gateways initiate the payment procedure after the WooCommerce order creation. However, the PayPal Payments plugin creates the PayPal order before the WooCommerce order. That’s why the updated order totals may not be visible on the PayPal popup when they were changed too late in the process.
That being said, the customer would be charged the correct amount in the end regardless of what is shown in the popup window as the final capture amount is taken from the WooCommerce order, which would include the discount.
I am seeing you also have a private engagement open with us via our WooCommerce support channel (#172387). I would suggest continuing there to see if there is anything we can do to support your custom checkout. However, as said in this private engagement, this is a custom setup, and it might be that this is not supported by default, since it is something that you have created. You might need to get a WooCommerce developer in order to help with this.
Kind regards,
Joost
Hi Joost,
Thanks for your reply. FYI I am a WooC Developer. You say “Typically, most payment gateways initiate the payment procedure after the WooCommerce order creation. However, the PayPal Payments plugin creates the PayPal order before the WooCommerce order.”
Can you please point me to where the PayPal order is created in your code. If I can understand better how your plugin works I can implement my discount rules before and I can stop bothering you with questions.
I would reply to the private support ticket, but the agent there said they can’t help me, hence why I tried here.
I will continue with you on the private thread and we can post any findings here later.