[-] FO: Fix display specific prices for combinations in product page #PSCFV-7807
This commit is contained in:
1 parent
3b4978af36
commit
379381a5aa
1 file changed
+7
-19
@@ -303,10 +303,8 @@ function updateDisplay()
|
|||||||
|
|
||||||
var tax = (taxRate / 100) + 1;
|
var tax = (taxRate / 100) + 1;
|
||||||
|
|
||||||
var display_specific_price;
|
|
||||||
if (selectedCombination.specific_price)
|
if (selectedCombination.specific_price)
|
||||||
{
|
{
|
||||||
display_specific_price = selectedCombination.specific_price['price'];
|
|
||||||
if (selectedCombination['specific_price'].reduction_type == 'percentage')
|
if (selectedCombination['specific_price'].reduction_type == 'percentage')
|
||||||
{
|
{
|
||||||
$('#reduction_amount').hide();
|
$('#reduction_amount').hide();
|
||||||
@@ -322,11 +320,8 @@ function updateDisplay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
display_specific_price = product_specific_price['price'];
|
|
||||||
if (product_specific_price['reduction_type'] == 'percentage')
|
if (product_specific_price['reduction_type'] == 'percentage')
|
||||||
$('#reduction_percent_display').html(product_specific_price['specific_price'].reduction_percent);
|
$('#reduction_percent_display').html(product_specific_price['specific_price'].reduction_percent);
|
||||||
}
|
|
||||||
|
|
||||||
if (product_specific_price['reduction_type'] != '' || selectedCombination['specific_price'].reduction_type != '')
|
if (product_specific_price['reduction_type'] != '' || selectedCombination['specific_price'].reduction_type != '')
|
||||||
$('#discount_reduced_price,#old_price').show();
|
$('#discount_reduced_price,#old_price').show();
|
||||||
@@ -337,28 +332,21 @@ function updateDisplay()
|
|||||||
$('#reduction_percent').show();
|
$('#reduction_percent').show();
|
||||||
else
|
else
|
||||||
$('#reduction_percent').hide();
|
$('#reduction_percent').hide();
|
||||||
if (display_specific_price)
|
if (product_specific_price['price'] || selectedCombination.specific_price['price'])
|
||||||
$('#not_impacted_by_discount').show();
|
$('#not_impacted_by_discount').show();
|
||||||
else
|
else
|
||||||
$('#not_impacted_by_discount').hide();
|
$('#not_impacted_by_discount').hide();
|
||||||
|
|
||||||
var taxExclPrice = (display_specific_price && display_specific_price >= 0 ? (specific_currency ? display_specific_price : display_specific_price * currencyRate) : priceTaxExclWithoutGroupReduction) + selectedCombination['price'] * currencyRate;
|
if (selectedCombination.specific_price['price'] && selectedCombination.specific_price['price'] >=0)
|
||||||
|
var taxExclPrice = (specific_currency ? selectedCombination.specific_price['price'] : selectedCombination.specific_price['price'] * currencyRate);
|
||||||
if (display_specific_price)
|
else
|
||||||
productPriceWithoutReduction = priceTaxExclWithoutGroupReduction + selectedCombination['price'] * currencyRate; // Need to be global => no var
|
var taxExclPrice = priceTaxExclWithoutGroupReduction + (selectedCombination['price'] * currencyRate);
|
||||||
|
|
||||||
if (!displayPrice && !noTaxForThisProduct)
|
if (!displayPrice && !noTaxForThisProduct)
|
||||||
{
|
|
||||||
productPrice = taxExclPrice * tax; // Need to be global => no var
|
productPrice = taxExclPrice * tax; // Need to be global => no var
|
||||||
if (display_specific_price)
|
|
||||||
productPriceWithoutReduction = ps_round(productPriceWithoutReduction * tax, 2);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
productPrice = ps_round(taxExclPrice, 2); // Need to be global => no var
|
productPrice = ps_round(taxExclPrice, 2); // Need to be global => no var
|
||||||
if (display_specific_price)
|
|
||||||
productPriceWithoutReduction = ps_round(productPriceWithoutReduction, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
var reduction = 0;
|
var reduction = 0;
|
||||||
if (selectedCombination['specific_price'].reduction_price || selectedCombination['specific_price'].reduction_percent)
|
if (selectedCombination['specific_price'].reduction_price || selectedCombination['specific_price'].reduction_percent)
|
||||||
@@ -375,6 +363,7 @@ function updateDisplay()
|
|||||||
if (product_specific_price.reduction_price && (displayPrice || noTaxForThisProduct))
|
if (product_specific_price.reduction_price && (displayPrice || noTaxForThisProduct))
|
||||||
reduction = ps_round(reduction / tax, 6);
|
reduction = ps_round(reduction / tax, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
productPriceWithoutReduction = productPrice * group_reduction;
|
productPriceWithoutReduction = productPrice * group_reduction;
|
||||||
|
|
||||||
productPrice -= reduction;
|
productPrice -= reduction;
|
||||||
@@ -385,7 +374,6 @@ function updateDisplay()
|
|||||||
productPrice += ecotaxAmount;
|
productPrice += ecotaxAmount;
|
||||||
productPriceWithoutReduction += ecotaxAmount;
|
productPriceWithoutReduction += ecotaxAmount;
|
||||||
|
|
||||||
//productPrice = ps_round(productPrice * currencyRate, 2);
|
|
||||||
var our_price = '';
|
var our_price = '';
|
||||||
if (productPrice > 0) {
|
if (productPrice > 0) {
|
||||||
our_price = formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank);
|
our_price = formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank);
|
||||||
|
|||||||
Reference in new issue
Block a user