Jump to content

Add a row to the cart


roillion

Recommended Posts

Hello everybody !! :)

 

 

I'm French but nobody has an answer to my question so I'm trying here. I hope you will be better :D

 

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 !! ;)

 

post-819631-0-76826000-1406743939_thumb.png

Link to comment
Share on other sites

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

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

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 !! :)

 

post-819631-0-18847300-1406836736_thumb.png

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...