Error when displaying some product: range(): Argument #3 ($step)

  • Posts: 33
  • Thank you received: 2
2 years 4 months ago #346443

-- url of the page with the problem -- : softdune.com/index.php/fr/orita-amelie/c...1-scrap-paper-amelie
-- HikaShop version -- : 4.6.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 8.0.25
-- Error-message(debug-mod must be tuned on) -- : range(): Argument #3 ($step) must not exceed the specified range

Hi,

Since the last days we receive the following error when displaying some product ranges.
We had this issue for one category yesterday, but the issue stopped after a while.
Now we receive the issue in another category.
The issues only appears for logged in users.

range(): Argument #3 ($step) must not exceed the specified range

Attached the input from debug mode.

File Attachment:

File Name: Argument3.txt
File Size:4 KB

This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:

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

  • Posts: 83401
  • Thank you received: 13494
  • MODERATOR
2 years 4 months ago #346444

Hi,

The error appears because the minimum quantity configured in the product is higher than the maximum quantity (15 by default) of the quantity dropdown.

Now, add the line:
$increment = min($increment, $max_quantity);
before the line:
$r = range($min_quantity, $max_quantity, $increment);
in the file /components/com_hikashop/views/product/tmpl/show_quantity.php (two places) and it will avoid the error message, even if the product is not configured properly.
We'll add the modification on our end for the next version of HikaShop.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum