Limit order: Hikashop for restaurants

  • Posts: 5
  • Thank you received: 0
3 years 11 months ago #318312

-- url of the page with the problem -- : saborartecieza.es
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.18
-- PHP version -- : 7.3

Hello, I need to modify hikashop for restaurants.

I need to have a limit of orders, for example 50. When you reach 50 orders whose status is in preparation that the rest of the users cannot order until they change their status.

Is it possible to do something like this with hikashop?

Thank you!

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

  • Posts: 5
  • Thank you received: 0
3 years 11 months ago #318315

I'm doing tests, if I set a time for the store to close my purchases, that same function works for me. But instead of closing the cart at certain times, I need it to close once the maximum number of orders has been reached

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
3 years 11 months ago #318314

Hi,

There is no solution for that for now.
But it would be possible to do with the development of a plugin to handle that restriction.

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

  • Posts: 5
  • Thank you received: 0
3 years 11 months ago #318392

Could it be used to modify it shopclosehours.phpmore or less like this?


/*trigger_error("No se puede dividir por cero", E_USER_ERROR);

$db = JFactory::getDBO();
$query = "select count(*) as cuenta from w2car_hikashop_order where order_status = 'pending'";
$db->setQuery($query);
$itemData = json_decode($db->loadResult());
if(!empty($itemData->cuenta)){
$data = $itemData->cuenta;
if (intval($data) < 1 ) {
return true;
} else {
return false;
}
}*/

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
3 years 11 months ago #318400

Hi,

Yes, I think you can do something like that.
Note that you don't need to do a json_decode as the value returned will already be an integer.
So $itemData is what you want to use directly in your

if (intval($data) < 1 ) {
check.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum