Andrejkov Posted August 1, 2023 Share Posted August 1, 2023 (edited) Hello, I need to make some changes in order-detail.tpl file. To do this i need to use {IF} {ELSE} condition. I Want to do something like this: 1. {if {$order.carrier.ID} == 1} AAAAA {else} BBBBB {/if} 2. {if {$order.history.current.ostate.id} == 1} AAAAA {else} BBBBB {/if} What variable i should use in {if} condition to get: 1. Order carrier ID 2. Order current status ID Regards Edited August 1, 2023 by Andrejkov (see edit history) Link to comment Share on other sites More sharing options...
Daresh Posted August 2, 2023 Share Posted August 2, 2023 Try to add something like this: {$order|dump} It should show all the available variables. 1 Link to comment Share on other sites More sharing options...
AddWeb Solution Posted August 2, 2023 Share Posted August 2, 2023 18 hours ago, Andrejkov said: 1. Order carrier ID $order->id_carrier 18 hours ago, Andrejkov said: 2. Order current status ID $order->current_state Link to comment Share on other sites More sharing options...
AddWeb Solution Posted August 2, 2023 Share Posted August 2, 2023 (edited) Hi, Use something like {if $order.carrier.id == 1} ABC {else} BBBBB {/if} For this, use something like below {if $order.current_state == 1} ABC {else} BBBBB {/if} Thanks! and let me know If it works! Edited August 2, 2023 by AddWeb Solution (see edit history) 1 Link to comment Share on other sites More sharing options...
Andrejkov Posted August 2, 2023 Author Share Posted August 2, 2023 (edited) 2 hours ago, AddWeb Solution said: Hi, Use something like {if $order.carrier.id == 1} ABC {else} BBBBB {/if} For this, use something like below {if $order.current_state == 1} ABC {else} BBBBB {/if} Thanks! and let me know If it works! Hi, {if $order.carrier.id == 1} -> Works fine. {if $order.current_state == 1} -> doesnt work When i use: {$order|dump} i have(attachment) So $order.current_state == 6 should work but it doesn't Regards Edited August 2, 2023 by Andrejkov add image (see edit history) Link to comment Share on other sites More sharing options...
Daresh Posted August 2, 2023 Share Posted August 2, 2023 Try this: $order.history.current.id_order_state 1 1 Link to comment Share on other sites More sharing options...
Andrejkov Posted August 2, 2023 Author Share Posted August 2, 2023 3 hours ago, Daresh said: Try this: $order.history.current.id_order_state Its work, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now