ORDER_CREATION_NOTIFICATION email

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #50770

I have 3 custom fields that I want to display in the email. For some reason I can't seem to get it correct. I added three fields to the language file. I then added this to the email form and the language displays properly but not the data from the fields. Do I have the incorrect fields?

<?php echo JText::sprintf('CUSTOMER_DATE_REQUEST',$address->daterequested);?>
<br/>
<br/>
<?php echo JText::sprintf('CUSTOMER_DATE_PICKUP',$address-->pickupdate);?>
<br/>
<br/>
<?php echo JText::sprintf('CUSTOMER_IRS_EIN',$address->irs_ein);?>

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

  • Posts: 13201
  • Thank you received: 2322
12 years 5 months ago #50831

Hi olddirtret,

The values: $address->daterequested / $address->pickupdate / $address->irs_ein don't exist in the email variables, that's why you don't have the data from the fields.

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

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
12 years 5 months ago #50853

You can do like that:
<?php echo JText::sprintf('CUSTOMER_DATE_REQUEST', $data->cart->billing_address->daterequested); ?>

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

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #50873

Nicolas

<?php echo JText::sprintf('CUSTOMER_DATE_REQUEST', $data->cart->billing_address->daterequested); ?>
Doesn't work.
I see the Date of Customer Request title but no data from the address table daterequested field.. The placement on the email notification is exactly where I want them but no data.

Any thoughts.?

The three custom fields were added to the address table. Two date fields and one text field.

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

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
12 years 5 months ago #50938

Where did you add the code ?

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

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #50946

I'm using the Business version. Went to System->Emails and opened the Order Creation Notification email.

I edited the HTML version and added it at about line 21 right after this line.
<?php echo JText::sprintf('HI_CUSTOMER',@$data->customer->name);?>


Attachments:
Last edit: 12 years 5 months ago by olddirtret. Reason: Example of email added

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

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
12 years 5 months ago #51074

For the order creation email, the code is a bit different.
It should be:
<?php
$address =& $data->order_addresses[$data->cart->billing_address->address_id];
echo JText::sprintf('CUSTOMER_DATE_REQUEST', $address->daterequested); ?>

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

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #51080

Nicolas

I tried you suggestion
<?php
$address =& $data->order_addresses[$data->cart->billing_address->address_id];
echo JText::sprintf('CUSTOMER_DATE_REQUEST', $address->daterequested); ?>

Same results. No data but text like the example I posted.

All suggestions would be appreciated.

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

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #51175

Semi-success. This code almost works. Except the pickupdate field only displays the number 1 but not a date. Daterequested displays fine and
so does Customer_IRS_EIN.

<br/>
<br/>
<?php echo JText::_('CUSTOMER_DATE_REQUEST'); ?>
<?php $address =& $data->order_addresses[$data->cart->billing_address->address_id];
echo $address->daterequested; ?>
<br/>
<br/>
<?php echo JText::_('CUSTOMER_DATE_PICKUP'); ?>
<?php echo $address-->pickupdate; ?>
<br/>
<br/>
<?php echo JText::_('CUSTOMER_IRS_EIN'); ?>
<?php echo $address->irs_ein;?>
<br/>
<br/>

Attachments:

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

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
12 years 5 months ago #51239

Can you do a screenshot of the options of your custom field ?

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

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #51240

Screen shot of my custom fields

Attachments:

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

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
12 years 5 months ago #51346

It sounds fine.
What if you delete that custom field an create a new one for it ?
Does it work better ?

If not, could you give a link to your shop ?

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

  • Posts: 23
  • Thank you received: 2
12 years 5 months ago #51427

We changed the custom fields for the request date and the pickup date. We added them to the order table and removed them from the address table.
These two fields are now displayed with the order.

The IRS-EIN still remains in the address table. The following code resides at about line 21 of the email.

<br/>
<br/>
<?php echo JText::_('CUSTOMER_IRS_EIN'); ?>
<?php $address =& $data->order_addresses[$data->cart->billing_address->address_id];
<?php echo $address->irs_ein;?>
<br/>
<br/>

Had we realized the potential of the custom fields, it would have made it easier to do the customization.

The notification email and the administration email now work the way we want.

Thank you for all your help.

Here is the link to the Computer Ministry web site www.compministry.org/ . We are a non-profit ministry.

Consider this problem resolved...

Last edit: 12 years 5 months ago by olddirtret.
The following user(s) said Thank You: nicolas

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

  • Posts: 23
  • Thank you received: 2
10 years 5 months ago #157454

Joomla 2.5.20

Hikashop 2.23 Business

Website www.compministry.org

Needed to add to custom fields to the Order_Creation_Notification

2 years ago this thread took care of the problem with Hikashop 1.5.7

This thread fixed the problem. But now the CUSTOMER_IRS_EIN & CUSTOMER_EMAIL_ADDRESS field names are displayed. However the field data is not displayed. Here is the code that we have been using that was working.

<?php echo JText::_('CUSTOMER_IRS_EIN'); ?>
<?php $address =& $data->order_addresses[$data->cart->billing_address->address_id];
echo $address->daterequested; ?>
<?php echo $address->irs_ein;?>
<br/>
<br/>
<?php echo JText::_('CUSTOMER_EMAIL_ADDRESS'); ?>
<?php echo $address->emailaddress;?>

Any thoughts?

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

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
10 years 5 months ago #157484

Hi,

You can now do like that:

<?php echo $data->cart->billing_address->daterequested; ?>
<?php echo $data->cart->billing_address->irs_ein; ?>
<?php echo $data->cart->billing_address->emailaddress; ?>

The following user(s) said Thank You: olddirtret

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

  • Posts: 23
  • Thank you received: 2
10 years 5 months ago #157558

That fixed the problem.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum