Order submits unexpectedly when using quantity refresh button at checkout

  • Posts: 31
  • Thank you received: 2
3 years 3 weeks ago #336641

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 3.10.3
-- PHP version -- : 7.4
-- Browser(s) name and version -- : Chrome

Thankfully, a user was kind enough to report this bug to me today.

During checkout with PayPal selected, attempting to use the quantity reload button (circular arrows) causes the order to submit unexpectedly.

I tested and confirmed the issue.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
3 years 3 weeks ago #336651

Hi,

Well, yes and no.
If you change the quantity input field and then click on refresh, it won't submit the order.
It only will if you don't change the input field because the data of the form has been submit without any change and thus it assumes you want to go to the next step.
But you're right that it should not be case.
Edit the file components/com_hikashop/views/layouts/tmpl/quantity.php and change the code:

input.form.onsubmit && !input.form.onsubmit()
near the end to::
input.value == \'<?php echo $current_quantity; ?>\' || (input.form.onsubmit && !input.form.onsubmit())
and it will check that the quantity has been changed in the corresponding input field before sending the data to the server so that nothing will happen when you click the refresh icon if you don't change the input.
If fact, we should even hide the refresh icon as long as the quantity hasn't been changed.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum