Email Configuration

  • Posts: 136
  • Thank you received: 1
13 years 9 months ago #7264

Hi,

I've modified the email content that goes out when payments are created and then confirmed.

What I'd like to do is disable the Order Creation Email - instead, I would like to send that content once the order is confirmed - or once the payment has been processed from Paypal.

Problem is when I cancel payments, at the paypal screen - the Order Creation Email still sends. How can I disable this?

I was thinking if I disable the Order Creation Notification and place that content in to Order Status Notification? I'm also going to be sending different emails if someone purchases as a gift - through the use of some additional fields. I haven't enabled this functionality yet.

Would like some advice as to the best way to approach this please.

I'm using the Paypal integration and business version of Hikashop if that helps.

Thank you

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #7266

Hi,

Disabling the order creation email can be done by adding the line below to the email (when you edit it via the menu System->Emails):
$data->customer->user_email = '';

The order status notification won't contain all the data which is available for the order creation email, so just copying the code from one to the other won't do it.
You'll have to wait for next version (1.4.5) which should be out tomorrow or the next day and add at the beginning of the email the code:
$class = hikashop::get('class.order');
$data = $class->get($data->order_id);
$data->cart = $class->loadFullOrder($data->order_id,true,false);

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

  • Posts: 136
  • Thank you received: 1
13 years 9 months ago #7268

Are you able to let me know as soon as the new version is released?

Thanks in advance,

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #7269

Sure.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #7450

Hi,

The new version is out. You can download it on our website and install it over your previous version.

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

  • Posts: 136
  • Thank you received: 1
13 years 9 months ago #8353

Hi Nicolas,

I have now disabled the email creation notification, and modifying the content sent in the order status notification.

I am trying to display new fields which i've created and populated from the database table, products.

Need to display the content from these fields, in the Order Status Notification email. Below is the code I'm trying to add to the email - the first row with headings is appearing, but the second row, with references to the fields, is displaying blank cells.

---start code snippet


<table width="100%" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; cellspacing: 0px; cellpadding:0px;">
<tr>
<td><h1 style="background-color:#FFFFFF;color:#CC3232;font-size:12px;width:100%;padding:0px;">Scoop Includes</h1></td>
<td><h1 style="background-color:#FFFFFF;color:#CC3232;font-size:12px;width:100%;padding:0px;">Scoop Conditions</h1></td>
<td><h1 style="background-color:#FFFFFF;color:#CC3232;font-size:12px;width:100%;padding:0px;">Opening Hours</h1></td>
</tr>
<tr>
<td><?php echo $item->scoop_includes; ?></td>
<td><?php echo $item->scoop_conditions; ?></td>
<td><?php echo $item->opening_hours; ?></td>
</tr>
</table>

end code snippet-

I believe that it doesn't know which table to look in - what code should I add, to get these columns from the products table?

Also, there will only ever be 1 product in the cart. Not sure if this helps.

Thank you again, your support is amazing.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #8393

Hi,

Did you put that snippet of code inside the foreach which goes through the products in the cart ? Because if it's outside, it won't work.

The data should be loaded in the $data->cart->products so you should be able to access it without loading additional data.

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

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #10379

Hi Nicolas,

Can you please tell me which part of the code below is referencing the table and column.

$data->cart->products

Thanks in advance,

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

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #10380

Hi again Nicolas,

The (modified as per our previous correspondence) Order-status-notification-subject email currently draws data from the following tables:
jos_hikashop_order
jos_hikashop_order_product

but it seems to be using aliases for the column names.


However we would like to get the data from this table:
jos_hikashop_product

from these custom fields:
addressline1
addressline2
phone
website
scoop_includes
scoop_conditions
opening_hours

How can I reference these columns/get data from them? Are they using aliases?

The fields in common with the first two tables are 'product_id' and 'product_code'.

You mentioned pasting code into a foreach statement - however there are 8 in total, and more than one of these begin with
foreach($data->cart->products as $item){


Could you please paste a full example of how to get data from these custom fields, and output them. I can then place your code inside of a <td></td> where it is meant to appear.


Secondly - inside the Hikashop backend, the orderID is prefixed by a character, however this is not stored anywhere in the database tables that I can see; where is this stored?

Thank you very much,
Jacqueline

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10387

The data of the hikashop_product table is not loaded when loading the order data. You would have to have something like this:
$productClass = hikashop::get('class.product');
foreach($data->cart->products as $item){
$productData = $productClass->get($item->product_id);
echo $productData->addressline1;
echo $productData->addressline2;
// etc...
}

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

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #10392

Perfect, thanks!

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

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #10792

Hi Nicolas,

I have my email notification working perfectly now so thank you for your assistance.

There are some custom fields that I have created and displayed at the checkout for the user to input if they are purchasing the item as a gift. If these fields are populated, I'd like to send an alternative email to the gift recipient. With slight changes to the email content that is sent out.

What I'd like to know is if it's possible to create a new email file under System > Emails? I'd like to keep the emails as separate files. If so, how can I achieve this.

If not, I suppose the alternative is to modify the standard emails that are sent out. If this is the case, could you please give an example of how I would achieve this. The email notification I'm using is the status change notification, as per the previous posts.

Thank you again,
Jacqueline

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #10798

Hi,

You can't create additional emails. You should edit your email and do something like this (supposing that you created custom ORDER fields):

if($data->CUSTOM_FIELD_COLUMN=='CUSTOM_FIELD_VALUE'){
//display messages for when the user entered the value CUSTOM_FIELD_VALUE in the custom field
}else{
//display messages for when the user entered another value in the custom field
}

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

Time to create page: 0.077 seconds
Powered by Kunena Forum