Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Little patch for Global Fixing display variants price with tax

Signed-off-by: Gergely <t-gely@freemail.hu>
  • Loading branch information...
commit cb55bd9cf8476a30c77886da030c020f1067cf0e 1 parent 4da9db1
@tgely authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 osCommerce/OM/Core/Site/Shop/Product.php
View
14 osCommerce/OM/Core/Site/Shop/Product.php
@@ -270,9 +270,11 @@ public function getVariantMaxPrice() {
public function getVariantMaxPriceTaxClassId() {
$taxclassid = 0;
-
+ $price = 0;
+
foreach ( $this->_data['variants'] as $variant ) {
if ( $variant['data']['price'] > $price ) {
+ $price = $variant['data']['price'];
$taxclassid = $variant['data']['tax_class_id'];
}
}
@@ -281,15 +283,17 @@ public function getVariantMaxPriceTaxClassId() {
}
public function getVariantMinPriceTaxClassId() {
- $taxclassid = null;
-
+ $taxclassid = 0;
+ $price = null;
+
foreach ( $this->_data['variants'] as $variant ) {
if ( ($price === null) || ($variant['data']['price'] < $price) ) {
- $price = $variant['data']['tax_class_id'];
+ $price = $variant['data']['price'];
+ $taxclassid = $variant['data']['tax_class_id'];
}
}
- return ( $taxclassid !== null ) ? $taxclassid : 0;
+ return $taxclassid;
}
public function getVariantExactPrice($variants_id) {
Please sign in to comment.
Something went wrong with that request. Please try again.