Development

Changeset 7810

You must first sign up to be able to contribute.

Changeset 7810

Show
Ignore:
Timestamp:
03/11/08 22:34:44 (2 years ago)
Author:
Jonathan.Wage
Message:

Fixed to getTotal when calculating discounts.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfShoppingCartPlugin/lib/sfShoppingCart.class.php

    r1707 r7810  
    214214    foreach ($this->getItems() as $item) 
    215215    { 
     216      $discount = $item->getDiscount() * -1; 
    216217      if ($this->is_unit_price_ttc) 
    217218      { 
    218         $total_ht += $item->getQuantity() * $item->getPrice() * (1 - $item->getDiscount() / 100) / (1 + $this->tax / 100); 
     219        $total_ht += $item->getQuantity() * $item->getPrice() + $discount / (1 + $this->tax / 100); 
    219220      } 
    220221      else 
    221222      { 
    222         $total_ht += $item->getQuantity() * $item->getPrice() * (1 - $item->getDiscount() / 100)
     223        $total_ht += $item->getQuantity() * $item->getPrice() + $discount
    223224      } 
    224225    } 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.