How to send a copy of an order to a mail address chosen by the customer?

  • Posts: 13
  • Thank you received: 1
7 years 8 months ago #265411

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.4.45

Hi,

I need to implement a way to have a copy of an order be sent to a specific address the customer chooses from a list during check-out.
Any suggestion is welcome!

Regards,
cpix

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
7 years 8 months ago #265413

Hi,

You can create a custom field of the table "order" via the menu Display>Custom fields to have such list in the HikaShop checkout.
That information will be stored with the order and you can then customize the code of the emails via the menu Display>Emails to add the value of that field, stored in $data->XXX where XXX is the custom field column name, as BCC of the email.
www.hikashop.com/forum/orders-management...ustomers.html#188279
www.hikashop.com/support/forum/4-how-to/...firmation-email.html

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

  • Posts: 13
  • Thank you received: 1
7 years 8 months ago #265489

Hi Nicolas,

Thanks a lot for your rapid answer!

nicolas wrote: You can create a custom field of the table "order" via the menu Display>Custom fields to have such list in the HikaShop checkout.


Ok, in the meantime I've created that field and I wrote a PHP script to populate the custom field with all possible e-mail addresses from an external database. Is there a way to import those values from a CSV file?

nicolas wrote: That information will be stored with the order and you can then customize the code of the emails via the menu Display>Emails to add the value of that field, stored in $data->XXX where XXX is the custom field column name, as BCC of the email.
www.hikashop.com/forum/orders-management...ustomers.html#188279
www.hikashop.com/support/forum/4-how-to/...firmation-email.html


Ok, thanks for these precious tipps!

cpix

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

  • Posts: 13
  • Thank you received: 1
7 years 8 months ago #265533

Hi Nicolas,

I have the next question, which is related to this problem. The custom field used for the mail address is shown as a simple dropdown menu. I have to ensure that the customer really chooses an address, so I've put a dummy entry at the first list position. How can I check that this entry is not chosen?

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
7 years 8 months ago #265503

Hi,

There is no import system in HikaShop for custom field values.
You could potentially export/import the data from the hikashop_field table via your PHPMyAdmin.

If the default option of the select has a value with an empty string (the text of the option can be whatever you want), and if you turn on the "required" setting of the custom field, the system won't validate the form where the custom field is unless the customer selects another option in the select.

Last edit: 7 years 8 months ago by nicolas.

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

  • Posts: 13
  • Thank you received: 1
7 years 8 months ago #265548

Hi Nicolas,

nicolas wrote: There is no import system in HikaShop for custom field values.
You could potentially export/import the data from the hikashop_field table via your PHPMyAdmin.



Ok, good point. In this case I solved the problem by directly updating the hikashop_field table.

If the default option of the select has a value with an empty string (the text of the option can be whatever you want), and if you turn on the "required" setting of the custom field, the system won't validate the form where the custom field is unless the customer selects another option in the select.


That solved my problem! Thank you very much!

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

Time to create page: 0.067 seconds
Powered by Kunena Forum