High freqency orders issue

  • Posts: 241
  • Thank you received: 5
9 years 11 months ago #181612

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- Browser(s) name and version -- : chrome

Hi guys,

We run a event website and many / most events have multiple variants which have limits on quantity available.

Some of these events sell out very quickly (300 spots in 15 minutes) and this can create a issue on the last spot available.

If there is only one spot (or 2, 3) and more than one person puts it into their cart (it is 'created') the system will let the event checkout process continue. However when the customer finishes the transaction, only 1 will complete payment and the others will complete payment for $0.00 (a blank order receipt will be sent as well).

Is there a way to avoid this? Perhaps the cart retaining period / frequency check is the solution, but I want to enquire with you first.

Many thanks, Chris

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 11 months ago #181662

Hi,

I think that's a bug because we assume that when you confirm an order you were displaying a cart with valid products (which is the case, but the products got invalidated between the moment the customer saw the last page of the checkout and clicked on the finish button).
Add the code:

$cart = $this->initCart();
		if(empty($cart->products) || !is_array($cart->products) || !count($cart->products)){
			return false;
		}
after the line:
function check_cart(){
in the file components/com_hikashop/controllers/checkout.php and that should avoid such cases.

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

  • Posts: 241
  • Thank you received: 5
9 years 11 months ago #182027

Thank you. Will this likely be included in the next release?

I do note that the code displays the LIMIT_REACH_REMOVED message, but also includes our terms and conditions: awesomescreenshot.com/0fb3ydka79

I am not sure how to remove the terms and conditions message as it is not relevant.

Thanks again.

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

  • Posts: 241
  • Thank you received: 5
9 years 11 months ago #182029

one other scenario exists worth thinking about:

1 spot remains and two (or more) orders click "finish and pay" before either is marked "confirmed".

Both are "created" and are sent along to authorize.net for payment processing.

Are both spots sold, despite only one available?

Thanks.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 11 months ago #182133

1.
In my code, change the :
return false;
line by :
$app = JFactory::getApplication();
$app->redirect( $this->redirect_url, JText::_('CART_EMPTY'));
and that should avoid the problem.
We'll of course include that modification for the next version.

2.
The check on the cart products that I told you to add is done just before the order is created.
So having another order not confirmed should already reduce the stock to 0 and what you're describing shouldn't be possible unless both customers click on the button at 10 milliseconds of interval or less.
From what you're saying, it would mean that you activated the "Update the product stock on confirmed status" so that the stock is only deduced after the order confirmation.

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

Time to create page: 0.052 seconds
Powered by Kunena Forum