Skip to main content

No tax on SveaWebpay plugin after update

More
9 years 4 months ago #269896 by Stroppen
-- url of the page with the problem -- : www.belysningsimporten.se
-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.7.0
-- PHP version -- : 7.0.18

Hello

After updating to 3.0.1, the VAT for the products will not be sent to Svea, it will be displayed correctly with VAT at checkout and backend in hikashop, but not at Svea webpay.

Has anything been changed, any setting you need to do after the update?

Regards
Henrik

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago - 9 years 4 months ago #269917 by nicolas
Hi,

I4ve checked the code of the plugin and as it was developed by a sub contractor, they didn't use the standard way we do in other payment plugins to send the taxes.
Try changing the code:
Code:
if(isset($product->order_product_tax_info[0]->tax_rate) && $product->order_product_tax_info[0]->tax_rate > 0) { $product_tax = 100 * ($product->order_product_tax_info[0]->tax_rate); }
to:
Code:
if(isset($product->order_product_tax) && $product->order_product_tax > 0) { $product_tax = 100 * $product->order_product_tax; }
in the file plugins/hikashoppayment/sveawebpay/sveawebpay.php
That should hopefully solve the problem.
Let us know how it goes so that we can include the patch for the next version.
Last edit: 9 years 4 months ago by nicolas.

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #269943 by Stroppen
Hi Nicolas

I have now tried to replace the code but unfortunately did not work.
As you can see in the pictures, the sum sent to Svea is now much larger than the order value.

Regards
Henrik

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #269947 by nicolas
Hi,

Ok. I see the problem.
Then please replace that code by:
Code:
if(isset($product->order_product_tax_info)) { $tax = reset($product->order_product_tax_info); if($tax->tax_rate > 0) $product_tax = 100 * $tax->tax_rate; }
That should be much better.
The following user(s) said Thank You: Stroppen

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #270037 by Stroppen
Hi Nicolas

It worked great, thank you!

Regards,
Henrik

Please Log in or Create an account to join the conversation.

Time to create page: 0.195 seconds
Powered by Kunena Forum