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

#   Display text depending on shipping method

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 7 months ago -  10 years 7 months ago [\#234642](#234642) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#234642 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?

I use this code below to display text depending of the order status.
Code:

&lt;?php if($data-&gt;order_status == 'shipped'){ ?&gt;&lt;?php echo JText::_( 'CUSTOM_SHIPPING_MESSAGE_END' ); }?&gt;

Regards

Last edit: 10 years 7 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MzQ0MS1kaXNwbGF5LXRleHQtZGVwZW5kaW5nLW9uLXNoaXBwaW5nLW1ldGhvZD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14299
-
-

10 years 7 months ago [\#234673](#234673) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#234673 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Hi,

You can use such code: Code:

if($data-&gt;order_status == 'shipped' &amp;&amp; $data-&gt;cart-&gt;order_shipping_id==XXX){ //my code }

where XXX is the id of the shipping method for which you want to display something.

The following user(s) said Thank You: [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 7 months ago [\#234738](#234738) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#234738 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Thank you Nicolas

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago -  10 years 6 months ago [\#237094](#237094) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237094 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Hi,

This is the code i use to display text in order/listing view depending on order status.
Code:

&lt;?php $url = JText::_( 'CUSTOM_POST_HYPERLINK' ); $url2 = JText::_( 'ORDER_TRACKING_AWAITING_PAYMENT' ); $url3 = JText::_( 'ORDER_TRACKING_AWAITING_SHIPMENT' ); $url4 = JText::_( 'NO_ORDER_TRACKING_NUMBER' ); if($row-&gt;order_status == 'shipped'){ echo '&lt;a href="'.$url. $row-&gt;siuntosnumeris.'" target="_blank"&gt;'. $row-&gt;siuntosnumeris. '&lt;/a&gt;'; }elseif ($row-&gt;order_status == 'created'){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_created"&gt;'.$url2.'&lt;/span&gt;'; }elseif ($row-&gt;order_status == 'confirmed'){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_confirmed"&gt;'.$url3.'&lt;/span&gt;'; }elseif ($row-&gt;order_status == 'refunded'){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_refunded"&gt;'.$url4.'&lt;/span&gt;'; }elseif ($row-&gt;order_status == 'cancelled'){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_cancelled"&gt;'.$url4.'&lt;/span&gt;'; }else{ echo JText::_( 'NO_ORDER_TRACKING_NUMBER' ); } ?&gt;

Now, how can i display text depending on order status + payment method or shipping method?

Tried something like this:
Code:

}elseif ($row-&gt;order_status == 'created' &amp;&amp; $row-&gt;order_payment_id== 8){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_created"&gt;'.$url3.'&lt;/span&gt;';

Or this:
Code:

}elseif ($row-&gt;order_status == 'created' &amp;&amp; $data-&gt;cart-&gt;order_shipping_id==XXX){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_created"&gt;'.$url3.'&lt;/span&gt;';

But none worked.

Maybe because i do change payment method manually in back-end? Just to see if it works....

Also, where i could find payment or shipping id's? I only could see it with firebug...

Regards

Last edit: 10 years 6 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MzQ0MS1kaXNwbGF5LXRleHQtZGVwZW5kaW5nLW9uLXNoaXBwaW5nLW1ldGhvZD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14299
-
-

10 years 6 months ago [\#237102](#237102) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237102 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Hi,

It should be that: Code:

}elseif ($data-&gt;cart-&gt;order_status == 'created' &amp;&amp; $data-&gt;cart-&gt;order_shipping_id==XXX){

You can see the id of a payment/shipping method at the end of the URL in the address bar when you edit it in the backend.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago -  10 years 6 months ago [\#237340](#237340) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237340 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Hi,

Are you sure this is correct code?
I tried to add this:
Code:

}elseif ($data-&gt;cart-&gt;order_status == 'created' &amp;&amp; $data-&gt;cart-&gt;order_shipping_id==17){ echo '&lt;span class="hikashop_order_listing_status hikashop_order_status_confirmed"&gt;'.$url3.'&lt;/span&gt;';

And it didn't work.
So just to check I have changed in my code above from this:
Code:

$row-&gt;order_status == 'created'

to this:
Code:

$data-&gt;cart-&gt;order_status == 'created'

and it doesn't work anymore...

It seems $row is working but not $data
What is the difference?

I am trying to display text in order listing view file....

Thank you

Last edit: 10 years 6 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MzQ0MS1kaXNwbGF5LXRleHQtZGVwZW5kaW5nLW9uLXNoaXBwaW5nLW1ldGhvZD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14299
-
-

10 years 6 months ago [\#237352](#237352) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237352 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Hi,

I thought that you were in the order notification email.
On the order listing, then yes it's $row-&gt;order_status and $row-&gt;order_shipping_id
Just do a var_dump() of $row and you can see all the available variables for it.

The following user(s) said Thank You: [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#237446](#237446) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237446 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Now it works.

Thank you

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago -  5 years 2 days ago [\#237550](#237550) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237550 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Nicolas can you help me once more please?

I am trying to add text in email notification. first text depending on status and second text depending on status + payment method
but it seems elseif isn't working for me and I am not sure why and what I am doing wrong.
Here is the code:
Code:

&lt;?php if($data-&gt;cart-&gt;order_status == 'shipped' &amp;&amp; $data-&gt;cart-&gt;order_payment_id==18){ echo JText::_( 'CUSTOM_SHIPPING_MESSAGE'); }elseif ($data-&gt;cart-&gt;order_status == 'shipped'){ echo JText::_( 'CUSTOM_SHIPPING_MESSAGE_CASH' ); } ?&gt;

As I have 4 payment methods I need display other text for orders with one of these payment methods

Thank you

Last edit: 5 years 2 days ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile"). Reason: fixed code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MzQ0MS1kaXNwbGF5LXRleHQtZGVwZW5kaW5nLW9uLXNoaXBwaW5nLW1ldGhvZD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14299
-
-

10 years 6 months ago [\#237553](#237553) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237553 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Hi,

On the elseif you're using $data-&gt;order_status instead of $data-&gt;cart-&gt;order_status
That's all I can see in your code.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#237668](#237668) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Display text depending on shipping method](/forum/4-how-to/883441-display-text-depending-on-shipping-method#237668 "Hi,  I need to show text in email order status notification depending on shipping method and order status. Is this possible? What code I could use?  I use this code below to display text depending of the order status.  Regards")*

Ahh, my bad. Seems i am blind...

Thank you Nicolas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MzQ0MS1kaXNwbGF5LXRleHQtZGVwZW5kaW5nLW9uLXNoaXBwaW5nLW1ldGhvZD90bXBsPW1hcmtkb3du) 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.074 seconds

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