After update to v4.4.0 minimum weight restriction in PayPal not respected

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324311

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.4.1
-- Browser(s) name and version -- : Chrome

Hi, I just updated to 4.4.0 and noticed that the PayPal payment plugin does not respect minimum weight restriction: I have 2 PayPal plugins, one for software with max weight of 0.01 g and the other for tangible goods with min weight of 0.02 g. When buying a software with 0 Kg weight, in the checkout both payments are present. Before in 4.3 just the forst was correctly shown.
Could you please check?
thanks

Giuse

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324328

Hello Giuse,

I just tested it on my and and it worked fine, can you show us screenshots of how you configured :
- Your Paypal Payment method via "Hikashop->System->Configuration->Payment methods"
- The products weight/dimensions that were used during your tests via "Hikashop->Products"

So that we can reproduce it on our end with the same configuration ? Thank you.

Kind regards,
Mohamed.

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324337

Sure, here you have:

  • checkout where both paypal plugins now appear
  • restriction of payment plugins
  • product variant configuration with no weight
let me know if you need more info
thanks and best regards

Giuse

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324362

Hello,

Well, that's weird I wasn't able to reproduce your issue on my end with the same configuration.

Can you send us a temporary access to your back-end so that we can directly test and reproduce it on your website ? Thank you.
You can send it using our contact form. Please, don't forget to specify a link to that thread in your message :
www.hikashop.com/support/contact-us.html

Kind regards,
Mohamed

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324403

hi, done through contact form.
cheers

Giuse

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324421

Hello Giuse,

That's weird, even if I restrict your payment method to your shipping method, it's still displayed with a weightless product.

Can you download the last Hikashop version through our website, install it and test it again ? Thank you.

Kind regards,
Mohamed.

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324458

Hi, I just tried but no change: the payment for tangible goods (weight > 0) is still displayed in checkout, with HikaShop 4.3 the problem was not there..

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324481

Hello,

I'm actually using the last Hikashop version and I wasn't able to reproduce it on my end, can you test it after clearing your website and browser's cache, and also with one of Joomla's default template ? Thank you.

If you're still having the same issue, can you send us a temporary FTP access to your website so that we can directly debug the code ? Thank you
www.hikashop.com/support/contact-us.html

Please, don't forget to add a link to that thread in your message.

Kind regards,
Mohamed

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324578

hi, just sent you the ftp access
cheers

Giuse

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324608

Hello Giuse,

We actually don't have the rights to write on your files, so we can't properly debug it.

Can you edit the file "administrator/components/com_hikashop/helpers/paymentplugin.php" and change that line :

if(bccomp((float)$method->payment_params->payment_min_weight, (float)$order->weight, 3) == 1){
By :
if(bccomp(sprintf('%.3F',$method->payment_params->payment_min_weight), sprintf('%.3F',$order->weight), 3) == 1)

And that line :
if(bccomp((float)$method->payment_params->payment_max_weight, (float)$order->weight, 3) == -1){
By :
if(bccomp(sprintf('%.3F',$method->payment_params->payment_max_weight), sprintf('%.3F',$order->weight), 3) == -1)

Thank you !

Kind regards,
Mohamed.

Last edit: 3 years 5 months ago by Mohamed Thelji.

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324616

It seems as not to solve. I just gave you grant for write in helpers folder for additional tests.
cheers

Giuse

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324663

Hello Giuse,

I'm actually having a "530 Login incorrect." error message when I test it with the credentials you sent, can you please check it ? Thank you.

Kind regards,
Mohamed.

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324667

hi, very strange, I tested without problem on my side, I just resent them via contact form
cheers

Giuse

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324692

Hello Giuse,

That's great I just added a fix on your website using the FTP access you sent us, can you test it and tell us if you are having any other issue ? Thank you.

Kind regards,
Mohamed.

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

  • Posts: 86
  • Thank you received: 5
3 years 5 months ago #324706

Hi and thanks. Now the weight restriction seems to work correctly.
Your patch added some logs to the front end as attached that should be removed.
When will this patch be included in the official download to update real sites?
thanks

Giuse

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #324713

Hello,

You're right, some debug code was left, it should be better now. Thank again for your feedback !

Yes, we'll add it through the next Hikashop version.

Kind regards,
Mohamed.

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

Time to create page: 0.096 seconds
Powered by Kunena Forum