Trouble with Limits

  • Posts: 16
  • Thank you received: 0
12 years 2 months ago #62024

I am having some trouble setting up limits for some of our products on our site. I only want a user to be able to purchase certain items once. I have it setup correctly in the product to be only able to add it once to the cart and that works fine. But users can check out again buy one of the item again. I have a limit setup for the product to be only able to purchase one yearly, but it doesn't seem to be doing anything at all? Is there a plugin or configuration option I am missing somewhere? Attached is a picture of the setup options for the limit, I have tried with and without dates, different order status levels, with and without category. Any help is much appreciated!

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #62195

Hi Myra,

I tried your configuration on my end, and it seems to be working as wanted.
Are you sure that the status of your order is "created", "confirmed" ? And not for example "shipped" ?

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

  • Posts: 16
  • Thank you received: 0
12 years 2 months ago #62247

1) The order status is definitely confirmed. I tested it with All Status checked anyway to be sure, and it still did nothing. I have added more user access levels since adding the limits. I changed the access level for this limit to Custom -> Registered, Save and then back to All. They seem to all be working now. So I have no idea if that is what fixed it or what, because I purchased the same item like 7 times yesterday.

2) Anyway, how do you reset the limit at a time of your choosing? A year is too long and a quarter is too short. Deleting the order for the purchase of the limited item doesn't allow you to purchase again and deleting the limit and setting up a new one for the same item doesn't either. How do I allow everyone who purchased this item to be able to purchase it again on or after a date of my choosing? Is there a limits record file I can delete or something?

3) If someone adds an item they are limited on while not checked in, then logs in after it is in the cart, the can re-purchase the item they have bought already. The limit is only checked when adding to Cart? Which doesn't work if they aren't logged in at the time. Anyway around that? Can items not be added to the Cart at all without being logged in or is there a better way to fix this?

4) And completely unrelated, does trying to checkout through Paypal Sandbox not work at all for anyone else on Firefox? I get some long error code. Its working perfectly on Chrome.
Error: 400 Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

Cookie: (Very long string of stuff here)

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #62371

Hi Myra,

A check was missing, try to add the code:

					$oldQty = $product->cart_product_quantity;
					$this->_checkQuantity($product,$product->cart_product_quantity,$cart->products);
					if($oldQty!=$product->cart_product_quantity){
						$notUsable[$product->cart_product_id]=0;
						continue;
					}
after:
			$notUsable = array();
			foreach($cart->products as $k => $product){
				if(empty($product->product_id)){
					continue;
				}
				if(!empty($product->cart_product_quantity)){
In the file \administrator\components\com_hikashop\classes\cart.php in the function loadFullCart().

This will check the quantity when the user log in.

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

  • Posts: 16
  • Thank you received: 0
12 years 2 months ago #62423

That is perfect, thank you! Now it gives the Limit error and removes from Cart when you log in if it has already been purchased.


Question: A limit of 1 year on an item prevents a user from purchasing that item again for a year from their purchase? Or a year from the setup of the limit?

And is there a way to reset the limit on an item purchase for everyone with deleting the orders out of the backend?

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

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 2 months ago #62493

It's one year from purchasing.

You don't even need to delete the orders even though that's also a possibility. Just set them to a status which isn't selected in your limit options.

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

  • Posts: 16
  • Thank you received: 0
12 years 2 months ago #62498

Ah, that's true. I would rather not lose the previous years sales records. I don't suppose there's anyway to change the status of a few hundred orders at once, is there? Heh. And thank you very much for both of yours assistance.

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

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 2 months ago #62667

There is no option for that indeed. You would have to either do it via the database with a MySQL query or one by one via the interface.

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

Time to create page: 0.086 seconds
Powered by Kunena Forum