  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: shopping_cart.php 810 2006-08-27 01:13:17Z hpdl $ |
| |
| 3 | + | $Id: shopping_cart.php 826 2006-08-29 11:39:48Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
700 | 700 | | function _cleanUp() { |
| |
701 | 701 | | global $osC_Database, $osC_Customer; |
| |
702 | 702 | | |
  |
703 | | - | foreach ($this->_contents as $products_id => $data) { |
| |
| 703 | + | foreach ($this->_contents as $product_id_string => $data) { |
|
704 | 704 | | if ($data['quantity'] < 1) { |
  |
705 | | - | unset($this->_contents[$products_id]); |
| |
| 705 | + | unset($this->_contents[$product_id_string]); |
|
706 | 706 | | |
| |
707 | 707 | | // remove from database |
| |
708 | 708 | | if ($osC_Customer->isLoggedOn()) { |
| |
709 | 709 | | $Qdelete = $osC_Database->query('delete from :table_customers_basket where customers_id = :customers_id and products_id = :products_id'); |
| |
710 | 710 | | $Qdelete->bindTable(':table_customers_basket', TABLE_CUSTOMERS_BASKET); |
| |
711 | 711 | | $Qdelete->bindInt(':customers_id', $osC_Customer->getID()); |
  |
712 | | - | $Qdelete->bindValue(':products_id', $products_id); |
| |
| 712 | + | $Qdelete->bindValue(':products_id', $product_id_string); |
|
713 | 713 | | $Qdelete->execute(); |
| |
714 | 714 | | } |
| |
715 | 715 | | } |
| |
|
|
 |
… |
|
735 | 735 | | $tax_description = $osC_Tax->getTaxRateDescription($data['tax_class_id'], $this->getTaxingAddress('country_id'), $this->getTaxingAddress('zone_id')); |
| |
736 | 736 | | |
| |
737 | 737 | | $shown_price = $osC_Currencies->addTaxRateToPrice($data['final_price'], $tax, $data['quantity']); |
  |
| 738 | + | |
|
738 | 739 | | $this->_sub_total += $shown_price; |
| |
739 | 740 | | $this->_total += $shown_price; |
| |
740 | 741 | | |
| |
741 | 742 | | if (DISPLAY_PRICE_WITH_TAX == '1') { |
| |
742 | 743 | | $tax_amount = $shown_price - ($shown_price / (($tax < 10) ? '1.0' . str_replace('.', '', $tax) : '1.' . str_replace('.', '', $tax))); |
| |
743 | 744 | | } else { |
| |
744 | 745 | | $tax_amount = ($tax / 100) * $shown_price; |
  |
| 746 | + | |
| |
| 747 | + | $this->_total += $tax_amount; |
  |
745 | 748 | | } |
| |
746 | 749 | | |
| |
747 | 750 | | $this->_tax += $tax_amount; |