Withdrawal window based on order creation date

  • Posts: 45
  • Thank you received: 6
2 months 3 days ago #371882

-- HikaShop version -- : 6.3.0
-- Joomla version -- : 5.4.5
-- PHP version -- : 8.3.6
-- Browser(s) name and version -- : Firefox 150.0.1 (64-bit)

Hi,
in the configuration there is a setting called 'Number of days after delivery for withdrawal window' which (I assume) starts counting after an order has its status set to 'Delivered'.

How would I go about changing this to start counting from order creation instead?

Cheers.

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

  • Posts: 85883
  • Thank you received: 14120
  • MODERATOR
2 months 2 days ago #371888

Hello,

You can do this entirely from the backend with a mass action, no code change needed. The withdrawal window is calculated from the reference date stored on the order ("order_shipped" for the Shipped status, "order_delivered" for the Delivered status, "order_invoice_created" for the Confirmed status). HikaShop only writes those date columns once, when the order first reaches each status (see back/classes/order.php:168, the assignments are guarded by an empty() check). So if you pre-fill them with the order creation date before the order ever reaches those statuses, HikaShop will leave them alone afterwards and the withdrawal window will naturally start from order creation.

Steps to set this up:

1. Go to HikaShop > System > Mass actions and click New.
2. Give it a name (e.g. "Align shipping/delivery dates to order creation"), make sure it is published and set Trigger to "After an order is created".
3. Set the table to Order. You can leave the filters empty so it applies to every order, or add a "Filter on a specific order field" if you want to scope it (for example only orders below a given order id, etc.).
4. Add two actions of type "Update values":
- Field: order_delivered = (operation) order.order_created
- Field: order_shipped = (operation) order.order_created
The "operation" type tells HikaShop to evaluate the right side as a column reference rather than a literal value, so each new order gets its own creation timestamp copied over.
5. Save the mass action.

After that, the system will compute the 14-day window from the value of order_delivered (or order_shipped), which is now the order creation timestamp. The standard "Number of days after delivery for withdrawal window" setting in HikaShop > Configuration > Main keeps working as the duration of the window, only its starting point shifts.

One legal note worth flagging, in case it is relevant to your shop: the EU Directive 2023/2673 (and the older 2011/83/EU it replaces) sets the 14-day withdrawal window to start when the consumer takes physical possession of the goods, not when the order is placed. Starting the window from the order creation date can give EU consumers less than 14 days of actual withdrawal time after delivery, which would not be compliant with the directive for physical goods. If you are selling digital goods or services only, or if you are outside the EU, the rule is different and this approach is fine. Worth double-checking against your jurisdiction before pushing it live.

The following user(s) said Thank You: NTV

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

  • Posts: 45
  • Thank you received: 6
2 months 2 days ago #371896

Hi nicolas,

got it set up, should be working now - thanks!

Next step:
What about digital goods, is there a way to set the 'no_refund' value automatically once a product is downloaded?

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

  • Posts: 85883
  • Thank you received: 14120
  • MODERATOR
2 months 2 days ago #371902

Hi,

There is no no_refund field as such, but we just pushed an update that does exactly what you describe automatically, no configuration needed. The new behaviour:

For fully-digital orders (no shipping method on the order), the "Withdraw from contract" button now disappears as soon as the customer downloads one of the files attached to a product of the order. This matches the EU Directive 2023/2673 rule that the withdrawal right on digital content is lost as soon as the consumer starts the download. Orders with a shipping method keep their existing withdrawal window unchanged, since the physical part of the order may still be returned.

Please download the latest 6.4.1 build from your member area and reinstall it. The download log HikaShop has been keeping for every frontend download is what the check reads, so this also retroactively closes the withdrawal window on orders whose customers had already downloaded before the update.

The following user(s) said Thank You: NTV

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

  • Posts: 45
  • Thank you received: 6
1 month 3 weeks ago #371962

Very cool, thanks!

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

  • Posts: 45
  • Thank you received: 6
6 days 4 hours ago #372549

Hi,

I tested this after updating and it does not seem to be working - orders can still be cancelled after the product is downloaded.

My HikaShop version is 6.5.0.

Side question: Where can I change the text that appears in the dialog to confirm order cancellation? The german translation is quite bad.

EDIT: Found out how to set the Language Override - the Constant in question is "HIKA_CONFIRM_CANCEL_ORDER".

EDIT2: Noticed there are some modifications to the View in question, will write again when I removed those and tested again.

Last edit: 6 days 1 hour ago by NTV.

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

  • Posts: 85883
  • Thank you received: 14120
  • MODERATOR
6 days 15 minutes ago #372551

Hi,

The download check is working, it just acts on a different button than the one you tested.

An order can show two different buttons:

- "Withdraw from contract", the legal right of withdrawal. This is the one the update closes: on a fully digital order (no shipping method), it disappears as soon as the customer downloads a file of that order through the frontend.
- "Cancel order", the one whose confirmation dialog you found (HIKA_CONFIRM_CANCEL_ORDER). This one is separate. It is shown purely from the order status, via the config setting that lists which statuses allow cancellation, and downloads do not affect it.

So "still cancellable after a download" is expected: cancelling and withdrawing are two different actions. To check the new behaviour, look at "Withdraw from contract", not "Cancel order". Use a digital order that has reached Confirmed or Shipped (the default download-eligible statuses), download a file as the customer, then reload the order. The withdraw button should be gone.

If your downloadable orders sit in another status such as Created or Delivered, the check is skipped for them by design. Tell me which status they are in and I will point you to the setting that aligns it.

On the German text: you are right, the default was a stiff, literal translation of the English and did not read naturally. We have reworded the shipped German (de-DE, de-AT, de-CH) to "Möchten Sie die Bestellung ORDER_NUMBER wirklich stornieren?", so a future update will carry it. HIKA_CONFIRM_CANCEL_ORDER is the correct override to use in the meantime.

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

  • Posts: 45
  • Thank you received: 6
1 day 5 hours ago #372620

Hi,
a bit confusing that there are two similar functions. If it has to be this way I would suggest changing the name of the setting "Number of days after delivery for withdrawal window" as it (also) applies to order cancellation, if I'm not mistaken.

Is it possible to mirror the withdrawal behavior for cancellation?

Example:
Order confirmed -> User downloads file -> Cancellation becomes unavailable

The new German translation is very good.

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

  • Posts: 85883
  • Thank you received: 14120
  • MODERATOR
18 hours 35 minutes ago #372621

Hi,

Order cancellation has been in HikaShop for years. And it is used all over the world.
"Withdrawal" is a mechanism with strict rules, specific to the EU and with things that people outside the EU don't want.
So both systems live side by side.
The setting you're talking about is specific to "withdrawal".
I don't see the point of mirroring the withdrawal behavior for cancellation. The whole point of having them side by side is that you can choose to use one or the other based on your needs. If both do the same thing, then there is no point in having both anymore.

As a German shop, I would recommend turning off order cancellation and only using withdrawal.

The following user(s) said Thank You: NTV

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

  • Posts: 45
  • Thank you received: 6
4 hours 46 minutes ago #372643

Hi,
that makes sense.

While I do see the value of disabling order cancellation after the user has downloaded his E-Book, we can make do with only offering a withdrawal form.

EDIT: Concerning the mass action setting order_delivered to order_created: I recommend using another mass action to retroactively set that value for all previous orders, otherwise you will receive cancellation requests for orders that have been created years ago.

Last edit: 4 hours 29 minutes ago by NTV.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum