Skip to main content

Limit order: Hikashop for restaurants

More
6 years 5 months ago #318312 by isfpvesta
-- 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.

More
6 years 5 months ago #318315 by isfpvesta
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.

More
6 years 5 months ago #318314 by nicolas
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.

More
6 years 5 months ago #318392 by isfpvesta
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.

More
6 years 5 months ago #318400 by nicolas
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
Code:
if (intval($data) < 1 ) {
check.

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

Time to create page: 0.168 seconds
Powered by Kunena Forum