Pick-up delivery with a fixed date

  • Posts: 2
  • Thank you received: 0
  • Hikashop Business
1 month 5 days ago #363940

-- HikaShop version -- : 5.1.1
-- Joomla version -- : 4.
-- PHP version -- : 8.2.20
-- Browser(s) name and version -- : Firefox131.0.2 (64 bits)
-- Error-message(debug-mod must be tuned on) -- : --

Hi
I organize the sale with a delivery to pick up at the store one Saturday per month, how to automatically communicate this date in the order confirmation?

Best regards.
Yanick

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
1 month 5 days ago #363941

Hi,

Well, there are a few ways based on your needs and skills :

- One option would be to create a custom order field ( www.hikashop.com/support/documentation/4...shop-field-form.html ) of the type "text" via the menu Display>Custom fields. In its display settings, you could activate the display in the emails. And in each order, you could edit the additional information area to fill that input field with the date you plan for the delivery. This requires manually providing the date in each order, so it's more to manage in the long run, but that's the solution with the most fine grained control and doesn't require any coding knowledge.

- One option would be to do the same but instead of filling the custom field manually, you could use a mass action ( www.hikashop.com/support/documentation/167-massaction-form.html ) with trigger "after an order is created" and an action "run PHP code" where you could calculate the date of the last saturday of the month ( stackoverflow.com/questions/6478796/how-...-monday-of-the-month ) and then run a MySQL query to update the value of the custom field with something like:

$date = ''; // custom PHP code to get the last saturday of the month in a human readable format
$db = JFactory::getDBO();
$db->setQuery('UPDATE #__hikashop_order SET xxx='.$db->quote($date).' WHERE order_id={order_id}');
$db->execute();
where xxx is the column name of the custom order field.
That way, you could automate the process, but it requires knowledge in PHP.

- One option would be to not use a custom field and directly modify the email via the System>Emails menu. There, you could add your PHP code to the HTML version to calculate the next pickup date and outputting it.
That also requires PHP knowledge, and you can't easily adjust the date for some orders if necessary, but it's a bit simpler to implement.

- One option would be to just use a translation override ( www.hikashop.com/download/languages.html#modify ) of a text already in the mail notification to include a message about the delivery being on the next last Saturday of the month, without providing the exact date.
This is the easiest and doesn't require complex setup or management.

The following user(s) said Thank You: yanick8

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

  • Posts: 2
  • Thank you received: 0
  • Hikashop Business
1 month 5 days ago #363943

Hi,
I'll take your first suggestion, create a custom order field. Then, maybe a mass action.

Thank you very much.
Best regards.
Yanick

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

Time to create page: 0.065 seconds
Powered by Kunena Forum