no invoice number for such orders

  • Posts: 6
  • Thank you received: 0
5 years 9 months ago #294112

-- HikaShop version -- : HikaShop Business: 3.4.0
-- Joomla version -- : 3.8.6

Is it possible to block the invoice number to be generated only for such orders? I need base it on a custom field to generate or not the invoice number.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
5 years 9 months ago #294115

Hi,

It's kind of possible.
I think you should be able to do that with a mass action:
www.hikashop.com/support/documentation/167-massaction-form.html
With a trigger "on after order updated", you could have a filter "order column" (for a custom order field) or "user column" (for a custom user field), and actions "update the values" on the columns "order_invoice_number", "order_invoice_id", "order_invoice_created" to empty their values.
That way the system would generate the invoice but it would be wiped out directly after being generated.

The following user(s) said Thank You: urampa

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

  • Posts: 6
  • Thank you received: 0
5 years 9 months ago #294185

I've modified massaction_order plugin because the trigger onAfterOrderUpdate makes no result. I have copied part of onBeforeOrderUpdate settings:
$o = clone $order;
if(!empty($order->old)){
foreach($order->old as $key => $value) {
if(!isset($o->$key))
$o->$key = $value;
}
}
$orders = array($o);
instead of
$orders = array($order);
and now the massaction return correct value.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
5 years 9 months ago #294187

Thank you for your feedback.
We'll add that on our end.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum