Post by pedma » Tue Jun 15, 2010 10:31 pm

Hi,

I'm using discount coupon. I want that as a customer checkout, I must get the total price. If it's between $25 - $100, he will get $3 discount. If it's between $101 - $500, he will get $10 discount. I want to put some thing like: "You will get coupon discount of $3. Please contact us". This information will be shown on the confirm page, and also will be sent included the order to his email , and to the owner's email.

At file .../catalog/view/theme/default/template/checkout/confirm.tpl , I got this:

Code: Select all

          <?php foreach ($totals as $total) { ?>
          <tr>
            <td align="right"><?php echo $total['title']; ?></td>
            <td align="right"><?php echo $total['text']; ?></td>
          </tr>
          <?php } ?>

If I'm not wrong, I need the $total['text'] . But it is something like $ 25,40
I just want the last total 25.40 . How to get this ?

Thanks in advance.
- pedma -

User avatar
New member

Posts

Joined
Tue Apr 27, 2010 3:06 pm

Post by pink.bird » Sun May 08, 2011 9:12 pm

i want resolve to this problem too

please help me

Newbie

Posts

Joined
Sun May 08, 2011 9:02 pm

Post by dsinglay » Thu Sep 01, 2016 5:59 pm

you need to write code in controller cart.php

$this->load->model('localisation/currency');
$currency=$this->model_localisation_currency->getCurrencyByCode($this->config->get('config_currency'));
$new_total='';
foreach ($this->cart->getProducts() as $product) {
$product_total =($product['price']*$currency['value'])*$product['quantity']; //
$new_total+=$product_total;
}
echo $new_total;
or
// for displaying the variable in cart.tpl add this line also in controller
$data['new_total']= $new_total;

// now open cart.tpl and call by this variable
echo $new_total;

// or you may use $total['text'] with preg_match condition without any controller code ////
/* ************ for mini cart repeat this process in controller > module>cart.php and view> module >cart.tpl***************/
thanks

Newbie

Posts

Joined
Thu Sep 01, 2016 5:50 pm
Who is online

Users browsing this forum: No registered users and 2 guests