Passing a value to the confirmation E-Mail

  • Posts: 3
  • Thank you received: 0
10 years 11 months ago #161986

-- url of the page with the problem -- : valleycraft.com/stage/
-- HikaShop version -- : Business 2.3.1
-- Joomla version -- : 2.5.19
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Firefox 30.0

I have the need to include in the administrator email notification of an order the confirmation number received from a shipping plugin. I am able to get the value in the raw XML return I receive but am having a hard time getting it into the email along with the order information. It is critical as this is needed for the shipping company to honor the quoted price the day the order is created.

I am by no means a PHP expert, but know enough that I should be able to do this without asking.

Can you please advise?

Thanks

Isaac Corey

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

  • Posts: 83932
  • Thank you received: 13588
  • MODERATOR
10 years 11 months ago #162046

Hi,

First, create a custom order field via the menu Display>Custom fields and turn off its "frontend" display option.
Then, in your plugin you can use such code:
$class = hikashop_get('class.order');
$order = new stdClass();
$order->order_id = $order_id;
$order->column = 'VALUE';
$class->save($order);

where column is the column name of your custom field and VALUE the value of the custom field.
Then, in the emails, you should be able to use such tag in order to display the value you entered in the custom field for your order:
{VAR:order.column}
where column is the column name of your custom field.

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

Time to create page: 0.053 seconds
Powered by Kunena Forum