Create order in Backend

  • Posts: 213
  • Thank you received: 10
  • Hikashop Multisite
1 week 2 days ago #365657

-- HikaShop version -- : 5.1.3
-- Joomla version -- : 4.4.10

Hi,

My client has customers who create orders but don't finish the order before they got there weekly delivery.
He finishes the order himself in the backend (cart > create order).
This works fine but there are 2 small issues.

- We have an Advanced date picker field.
Because the customers never added a date, the desired deliverydate is always 30-11-1999
Can we change the default date to "today + 1 day" ?

- We use the option "Clean cart when order is Created"
It seems this only work in the frontend. Can we make this work when order is created in the backend?

Thanks in advance.
Jeroen

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

  • Posts: 83304
  • Thank you received: 13468
  • MODERATOR
1 week 2 days ago #365665

Hi,

- You can create a mass action with the trigger "after an order is created", with a filter where the custom field is empty, and with an action "update the values" on the custom field column with the operation mode, using the MySQL concat ( www.w3schools.com/sql/func_mysql_concat.asp ) and date functions ( dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html ) to set this up so that when you click on the created button, the date in the field gets automatically set to the correct value you want.

- This is indeed only linked to the frontend. In the backend, the cart is not deleted if you create the order from a cart.
You should be able to do it with another massaction with the trigger "after an order is created" and an action "run PHP code" like so:

$app = JFactory::getApplication();
$cart_id = hikashop_getCID('cart_id');
if($app->isClient('administrator') && !empty($cart_id)) {
 $cartClass = hikashop_get('class.cart');
 $cartClass->delete($cart_id);
  // $app->redirect(); you might want to redirect to the order edit page directly here
}

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

Time to create page: 0.059 seconds
Powered by Kunena Forum