Product Limit by Yearly Doesn't work

  • Posts: 249
  • Thank you received: 21
4 years 5 months ago #313121

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.13

I have some products set to limit the quantity yearly but it only limits per cart. The limit works fine in a single cart but the customer can come back and create a new order as often as they like. We need the limit to be a yearly total.

A screen shot of the settings is attached. As you can see there should be a limit of 4 products from the selected category per year for users in the Vita-FT user group.

Attachments:

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 5 months ago #313127

Hi,

I see that you set a restriction to the "Store-polos" category. Please note that in that case, the limit will only apply to the products directly linked to that category.
So if you have products in sub categories of that category, this restriction won't apply to them.
Could this explain why the limit doesn't work for you ?

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

  • Posts: 249
  • Thank you received: 21
4 years 5 months ago #313189

The product is directly in that category but we are talking about variants of the product. The limit as set works on individual carts, just not as a yearly limit.

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 5 months ago #313224

Hi,

I did some tests on my end to try to reproduce but I don't have the issue.
Could you provide a user account with the issue, precise instructions to reproduce, a backend access to check your settings, a FTP access to do some debugging and a link to this thread for reference via our contact form so that we can look into the issue in depth ?
www.hikashop.com/support/contact-us.html

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

  • Posts: 249
  • Thank you received: 21
4 years 4 months ago #313286

Thanks Nicolas. I just caught on another project but will come back to you on this.

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

  • Posts: 4508
  • Thank you received: 610
  • MODERATOR
4 years 4 months ago #313295

Hello,

When you provide any backend reference via our Contact us form, don't forget to add in your message an Url link to this topic in order to keep the link with your elements.

Regards

Last edit: 4 years 4 months ago by Philip.

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

  • Posts: 249
  • Thank you received: 21
4 years 2 months ago #315835

Finally back on this project. Further testing confirms that the limit by product category doesn't work but we resolved this by listing the products instead.
Update, on further testing this is not working either. It seems to be that product variants are not limited beyond the number allowed in the cart. Previous orders even of the same variant are not being counted in the yearly total. I created a limit for a single product with no variants and the limits work as expected whether I selected the product or the product category in the limit config. When I change the category or product to one where the products have variants, the yearly limits are ignored. I've set up a test site for this client and will send the access and ftp details via contact page

Last edit: 4 years 1 month ago by rodfarrell. Reason: Changed results on testing.

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 1 month ago #315896

Hi,

I think I know what is the problem.
Replace the file administrator/components/com_hikashop/classes/limit.php by the one in the zip below and that should hopefully fix the problem.

File Attachment:

File Name: limit.zip
File Size:8 KB

Attachments:
Last edit: 4 years 1 month ago by nicolas.

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

  • Posts: 249
  • Thank you received: 21
4 years 1 month ago #315900

Thanks Nicolas, that seems to have solved the problem so long as we nominate the category the product is in rather than the product but its easy to create an additional category when needed so this is all we need. The client is testing further but my tests have all worked.

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

  • Posts: 249
  • Thank you received: 21
4 years 1 month ago #316499

Hey Nicolas, I just noticed some strange behaviour with the limits. We have more than one product with limits based on categories and they all work as expected. The popup messages are also working correctly except in this one circumstance.

1. I have added a product that is subject to a limit to the cart succesfully (correct behaviour).
2. I try to add a different product that has its own limit (completely separate rule to the first product) to the cart but I choose too high a quantity for this product's limit. This product is not added to the cart (correct behaviour) but no popup message appears.

The popup message works in all other instances including when products that are not subject to any limits are in the cart.

Note that the site is using the modified limits.php file that you provided earlier.

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 1 month ago #316504

Hi,

First, I would recommend updating to the 4.2.3 and check if you still have the issue.
If you do, then please provide precise instructions so that we can reproduce the issue on your shop.
Please also provide a backend access and a FTP access with a link to this thread via our contact form so that we can analyze the situation:
www.hikashop.com/support/contact-us.html

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

  • Posts: 249
  • Thank you received: 21
4 years 1 month ago #316560

Thanks Nicolas,
Does 4.2.3 include the changes in the limit.php file or do I need to replace it again?

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 1 month ago #316570

Hi,

Yes the change is included so no need to redo it.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum