jordiob Posted June 2, 2011 Share Posted June 2, 2011 Hi! Anybody knows how can I define something like{if paymentstatus == error}showThis{/else}showThat{/if}I can't find where payment status are defined.Thanks! Link to comment Share on other sites More sharing options...
jordiob Posted June 2, 2011 Author Share Posted June 2, 2011 Found thisid_order_stateID 2 is payment acceptedBut when I use it, it doesn't work properly{if $id_order_state == 2}showThis{else}showThat{/if}The result is showThat all the time Link to comment Share on other sites More sharing options...
tomerg3 Posted June 2, 2011 Share Posted June 2, 2011 Where are you trying to do this, are you sure $id_order_state is passed to that file? Link to comment Share on other sites More sharing options...
jordiob Posted June 2, 2011 Author Share Posted June 2, 2011 Well, maybe not. I'm trying it on order-detail.tplUPDATED: it's in line 74 id_order_state = intval($order->getCurrentState()); Link to comment Share on other sites More sharing options...
jordiob Posted June 3, 2011 Author Share Posted June 3, 2011 anybody please? Link to comment Share on other sites More sharing options...
shokinro Posted June 3, 2011 Share Posted June 3, 2011 which version of PrestaShop are you using?Assume you are using PS 1.4x, 1. In /controllers/OrderDetailController.php file, at bottom of preProcess() function, add following lines $id_order_state = intval($order->getCurrentState()); self:smarty->assign('id_order_state', $id_order_state); 2. Then use in your order-detail.tpl file {if $order->is_order_state == 2}showThis{else}showThat{/if} Good luck Link to comment Share on other sites More sharing options...
jordiob Posted June 3, 2011 Author Share Posted June 3, 2011 Thanks a lot for your help!I'm using 1.3.6 and did this:in order-detail.php add this after line 89 'order_state' => intval($id_order_state), //add this 'id_order_state' => intval($id_order_state), then, in order-detail.tpl: {if $id_order_state == 2}{else}Error{/if} Link to comment Share on other sites More sharing options...
shokinro Posted June 3, 2011 Share Posted June 3, 2011 You must add this line to get the order state first $id_order_state = intval($order->getCurrentState()); then you can use you code in the smarty assign statement. 'order_state' => intval($id_order_state), //add this 'id_order_state' => intval($id_order_state), Link to comment Share on other sites More sharing options...
sampei Posted January 23, 2013 Share Posted January 23, 2013 Hi. I need to obtain this function {if $id_order_state == 2}{else}Error{/if} in my-account.tpl. The example of this thread is for 1.4 ps and if i try to 1.5 does not work. Thanks for help Link to comment Share on other sites More sharing options...
Recommended Posts