roillion Posted July 30, 2014 Share Posted July 30, 2014 Hello everybody !! I'm French but nobody has an answer to my question so I'm trying here. I hope you will be better I want to add a field (a row) to my cart. (Please see my attach file). There is not hook here, so how can I do that ? Is it possible ? Thanks for your answer and your solutions !! Link to comment Share on other sites More sharing options...
Rolige Posted July 30, 2014 Share Posted July 30, 2014 Right, there is not hooks to add a row right there, you need to edit the shopping-cart.tpl file of your theme. 1 Link to comment Share on other sites More sharing options...
roillion Posted July 30, 2014 Author Share Posted July 30, 2014 Thanks for your answer !! I have done what I wanted. I have added a new var : $discount in the tpl file. Were can I update it ?(I want this var to be a record from my customer data). And were can I upload the var $total_price ? I need to find the controler I guess ? Where is it hidding ? Thanks again COTOKO Link to comment Share on other sites More sharing options...
Rolige Posted July 30, 2014 Share Posted July 30, 2014 The controller file to this tpl is: OrderController.php Link to comment Share on other sites More sharing options...
roillion Posted July 31, 2014 Author Share Posted July 31, 2014 Thanks !! However I can't find where update $total_price. I thought it was here this this ligne ( 'total_price' => (float)($orderTotal),) protected function _assignPayment() { global $orderTotal; // Redirect instead of displaying payment modules if any module are grefted on Hook::exec('displayBeforePayment', array('module' => 'order.php?step=3')); /* We may need to display an order summary */ $this->context->smarty->assign($this->context->cart->getSummaryDetails()); $this->context->smarty->assign(array( 'total_price' => (float)($orderTotal), 'taxes_enabled' => (int)(Configuration::get('PS_TAX')) )); $this->context->cart->checkedTOS = '1'; parent::_assignPayment(); }but evenif I do 'total_price' => (float)(10), it's not changing anything. My total price is not moving. Why ? How it is possible ? Thanks again !! Link to comment Share on other sites More sharing options...
Rolige Posted July 31, 2014 Share Posted July 31, 2014 What do you want to add exactly in the extra row?, maybe you don't need edit the core. Link to comment Share on other sites More sharing options...
roillion Posted July 31, 2014 Author Share Posted July 31, 2014 I want that my ustomer can see that how much he will need to paid his cart.He has money on his account and I want that money to be display on the cart (for exemple I put 12.5€ in my attach file. But this is not a variable. I put 12.5 in the source code : {$argentCompte=12.5} {if $argentCompte} <tr style="background-color:#FBFBFB;"> <td colspan="2" class="cart_description"> </td> <td colspan="3" class="text-right" style="color:black"> <span><strong>{displayPrice price=$argentCompte} on your accompte</strong></span> </td> <td colspan="3" class="text-right"> <span>- {displayPrice price=$argentCompte}</span> </td> </tr> </tbody> {/if} I would like that the controller give me the line : {$argentCompte=12.5} AND that it reduce the var $total_price (he won't have to paid this value by cart. He will have to paid $total_price-$argentCompte. Thanks again !! Link to comment Share on other sites More sharing options...
Rolige Posted July 31, 2014 Share Posted July 31, 2014 You need generate the variable inside the funcion "public function initContent()" of the file OrderController.php, then you can take that variable on the shopping-cart.tpl file, and will work. I hope this help you. 1 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