[Skip to main content](#vessel-content)

#   Clarification

##

- **[SLLLC](/forum/user/514-slllc "View SLLLC's Profile")**
- [![SLLLC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/514-slllc "View SLLLC's Profile") Topic Author
- [ Offline](/forum/user/514-slllc)

Less More

- Posts: 48
- Thank you received: 1
-
-

15 years 7 months ago [\#12651](#12651) by [SLLLC](/forum/user/514-slllc "View SLLLC's Profile")  *[Clarification](/forum/4-how-to/12651-clarification#12651 "I had read the post on how to add a customer address to the email sent when an order is confirmed using paypal   www.hikashop.com/en/support/forum/4-how-...istributor.html#6803  below is how I understand the code in the post should be added/placed to the paypal.php. Am I correct?  }else{ $order-&gt;order&#95;status = $element-&gt;payment&#95;params-&gt;pending&#95;status; $order&#95;text = JText::sprintf('CHECK&#95;DOCUMENTATION',HIKASHOP&#95;HELPURL.'payment-paypal-error#pending').&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text; } $order-&gt;mail&#95;status=$statuses&#91;$order-&gt;order&#95;status&#93;; $mailer-&gt;setSubject(JText::sprintf('PAYMENT&#95;NOTIFICATION','Paypal',$vars).$order&#95;subject); $body = str&#95;replace('',&quot;&#92;r&#92;n&quot;,JText::sprintf('PAYMENT&#95;NOTIFICATION&#95;STATUS','Paypal',$vars)).' '.JText::sprintf('ORDER&#95;STATUS&#95;CHANGED',$order-&gt;mail&#95;status).&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text;  $orderClass&gt;loadAddress($dbOrder&gt;order&#95;shipping&#95;address&#95;id,$dbOrder,'shipping','name','frontcomp'); $orderClass-&gt;loadAddress($dbOrder-&gt;order&#95;billing&#95;address&#95;id,$dbOrder,'billing','name','frontcomp'); $orderClass-&gt;loadProducts($dbOrder);  $mailer-&gt;setBody($body); $mailer-&gt;Send(); $orderClass-&gt;save($order);")* was created by *[SLLLC](/forum/user/514-slllc "View SLLLC's Profile")*

I had read the post on how to add a customer address to the email sent when an order is confirmed using paypal
[ www.hikashop.com/en/support/forum/4-how-...istributor.html#6803](http://www.hikashop.com/en/support/forum/4-how-...istributor.html#6803)

below is how I understand the code in the post should be added/placed to the paypal.php. Am I correct?

}else{
$order-&gt;order_status = $element-&gt;payment_params-&gt;pending_status;
$order_text = JText::sprintf('CHECK_DOCUMENTATION',HIKASHOP_HELPURL.'payment-paypal-error#pending')."\r\n\r\n".$order_text;
}
$order-&gt;mail_status=$statuses[$order-&gt;order_status];
$mailer-&gt;setSubject(JText::sprintf('PAYMENT_NOTIFICATION','Paypal',$vars).$order_subject);
$body = str_replace('&lt;br/&gt;',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Paypal',$vars)).' '.JText::sprintf('ORDER_STATUS_CHANGED',$order-&gt;mail_status)."\r\n\r\n".$order_text;

$orderClass&gt;loadAddress($dbOrder&gt;order_shipping_address_id,$dbOrder,'shipping','name','frontcomp');
$orderClass-&gt;loadAddress($dbOrder-&gt;order_billing_address_id,$dbOrder,'billing','name','frontcomp');
$orderClass-&gt;loadProducts($dbOrder);

$mailer-&gt;setBody($body);
$mailer-&gt;Send();
$orderClass-&gt;save($order);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEyNjUxLWNsYXJpZmljYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

15 years 7 months ago [\#12664](#12664) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Clarification](/forum/4-how-to/12651-clarification#12664 "I had read the post on how to add a customer address to the email sent when an order is confirmed using paypal   www.hikashop.com/en/support/forum/4-how-...istributor.html#6803  below is how I understand the code in the post should be added/placed to the paypal.php. Am I correct?  }else{ $order-&gt;order&#95;status = $element-&gt;payment&#95;params-&gt;pending&#95;status; $order&#95;text = JText::sprintf('CHECK&#95;DOCUMENTATION',HIKASHOP&#95;HELPURL.'payment-paypal-error#pending').&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text; } $order-&gt;mail&#95;status=$statuses&#91;$order-&gt;order&#95;status&#93;; $mailer-&gt;setSubject(JText::sprintf('PAYMENT&#95;NOTIFICATION','Paypal',$vars).$order&#95;subject); $body = str&#95;replace('',&quot;&#92;r&#92;n&quot;,JText::sprintf('PAYMENT&#95;NOTIFICATION&#95;STATUS','Paypal',$vars)).' '.JText::sprintf('ORDER&#95;STATUS&#95;CHANGED',$order-&gt;mail&#95;status).&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text;  $orderClass&gt;loadAddress($dbOrder&gt;order&#95;shipping&#95;address&#95;id,$dbOrder,'shipping','name','frontcomp'); $orderClass-&gt;loadAddress($dbOrder-&gt;order&#95;billing&#95;address&#95;id,$dbOrder,'billing','name','frontcomp'); $orderClass-&gt;loadProducts($dbOrder);  $mailer-&gt;setBody($body); $mailer-&gt;Send(); $orderClass-&gt;save($order);")*

Hi,

The link you posted doesn't work.

Your code loads the addresses from the database.
But you don't use them to add the information in the email.

You should have something like this as well before sending the email :
$body .="\r\n".$dbOrder-&gt;billing_address-&gt;address_firstname.' '.$dbOrder-&gt;billing_address-&gt;address_lastname.' '.$dbOrder-&gt;billing_address-&gt;address_street.' '.$dbOrder-&gt;billing_address-&gt;address_post_code.' '.$dbOrder-&gt;billing_address-&gt;address_city.' '.$dbOrder-&gt;billing_address-&gt;address_state.' '.$dbOrder-&gt;billing_address-&gt;address_country;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEyNjUxLWNsYXJpZmljYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[SLLLC](/forum/user/514-slllc "View SLLLC's Profile")**
- [![SLLLC's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/514-slllc "View SLLLC's Profile") Topic Author
- [ Offline](/forum/user/514-slllc)

Less More

- Posts: 48
- Thank you received: 1
-
-

15 years 7 months ago [\#12724](#12724) by [SLLLC](/forum/user/514-slllc "View SLLLC's Profile")  Replied by *[SLLLC](/forum/user/514-slllc "View SLLLC's Profile")* on topic *[Re: Clarification](/forum/4-how-to/12651-clarification#12724 "I had read the post on how to add a customer address to the email sent when an order is confirmed using paypal   www.hikashop.com/en/support/forum/4-how-...istributor.html#6803  below is how I understand the code in the post should be added/placed to the paypal.php. Am I correct?  }else{ $order-&gt;order&#95;status = $element-&gt;payment&#95;params-&gt;pending&#95;status; $order&#95;text = JText::sprintf('CHECK&#95;DOCUMENTATION',HIKASHOP&#95;HELPURL.'payment-paypal-error#pending').&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text; } $order-&gt;mail&#95;status=$statuses&#91;$order-&gt;order&#95;status&#93;; $mailer-&gt;setSubject(JText::sprintf('PAYMENT&#95;NOTIFICATION','Paypal',$vars).$order&#95;subject); $body = str&#95;replace('',&quot;&#92;r&#92;n&quot;,JText::sprintf('PAYMENT&#95;NOTIFICATION&#95;STATUS','Paypal',$vars)).' '.JText::sprintf('ORDER&#95;STATUS&#95;CHANGED',$order-&gt;mail&#95;status).&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text;  $orderClass&gt;loadAddress($dbOrder&gt;order&#95;shipping&#95;address&#95;id,$dbOrder,'shipping','name','frontcomp'); $orderClass-&gt;loadAddress($dbOrder-&gt;order&#95;billing&#95;address&#95;id,$dbOrder,'billing','name','frontcomp'); $orderClass-&gt;loadProducts($dbOrder);  $mailer-&gt;setBody($body); $mailer-&gt;Send(); $orderClass-&gt;save($order);")*

the correct link is

[ www.hikashop.com/en/support/forum/4-how-...istributor.html#6803](http://www.hikashop.com/en/support/forum/4-how-to/6802-autosend-an-e-mail-to-my-distributor.html#6803)

thank you for feedback, felt I was lacking something

so, as I understand you the code I added to load address from data base is not required for what I am trying to achieve. Should I insert the code you provided in its place/location?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEyNjUxLWNsYXJpZmljYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

15 years 7 months ago [\#12744](#12744) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Clarification](/forum/4-how-to/12651-clarification#12744 "I had read the post on how to add a customer address to the email sent when an order is confirmed using paypal   www.hikashop.com/en/support/forum/4-how-...istributor.html#6803  below is how I understand the code in the post should be added/placed to the paypal.php. Am I correct?  }else{ $order-&gt;order&#95;status = $element-&gt;payment&#95;params-&gt;pending&#95;status; $order&#95;text = JText::sprintf('CHECK&#95;DOCUMENTATION',HIKASHOP&#95;HELPURL.'payment-paypal-error#pending').&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text; } $order-&gt;mail&#95;status=$statuses&#91;$order-&gt;order&#95;status&#93;; $mailer-&gt;setSubject(JText::sprintf('PAYMENT&#95;NOTIFICATION','Paypal',$vars).$order&#95;subject); $body = str&#95;replace('',&quot;&#92;r&#92;n&quot;,JText::sprintf('PAYMENT&#95;NOTIFICATION&#95;STATUS','Paypal',$vars)).' '.JText::sprintf('ORDER&#95;STATUS&#95;CHANGED',$order-&gt;mail&#95;status).&quot;&#92;r&#92;n&#92;r&#92;n&quot;.$order&#95;text;  $orderClass&gt;loadAddress($dbOrder&gt;order&#95;shipping&#95;address&#95;id,$dbOrder,'shipping','name','frontcomp'); $orderClass-&gt;loadAddress($dbOrder-&gt;order&#95;billing&#95;address&#95;id,$dbOrder,'billing','name','frontcomp'); $orderClass-&gt;loadProducts($dbOrder);  $mailer-&gt;setBody($body); $mailer-&gt;Send(); $orderClass-&gt;save($order);")*

Both are required. The first one from the other thread is necessary to load the addresses information from the database. This one is necessary to add the address information to the email.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEyNjUxLWNsYXJpZmljYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.162 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
