Merge pull request #6683 from akathuria289/6377_issue
Fixed issue #6377
This commit is contained in:
commit
482f2ed971
|
|
@ -643,7 +643,7 @@ class Configurable extends AbstractType
|
|||
} else {
|
||||
return '<span class="price-label">' . trans('shop::app.products.price-label') . '</span>'
|
||||
. ' '
|
||||
. '<span class="final-price">' . core()->currency($this->evaluatePrice($this->getMinimalPrice())) . '</span>';
|
||||
. '<span class="special-price">' . core()->currency($this->evaluatePrice($this->getMinimalPrice())) . '</span> <span class="regular-price"></span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@
|
|||
});
|
||||
|
||||
let priceLabelElement = document.querySelector('.price-label');
|
||||
let priceElement = document.querySelector('.final-price');
|
||||
let priceElement = document.querySelector('.special-price');
|
||||
let regularPriceElement = document.querySelector('.regular-price');
|
||||
|
||||
if (this.childAttributes.length == selectedOptionCount) {
|
||||
|
|
@ -326,7 +326,18 @@
|
|||
|
||||
priceElement.innerHTML = this.config.variant_prices[this.simpleProduct].final_price.formated_price;
|
||||
|
||||
if (regularPriceElement && this.config.variant_prices[this.simpleProduct].final_price.price < this.config.variant_prices[this.simpleProduct].regular_price.price) {
|
||||
if (
|
||||
this.config.variant_prices[this.simpleProduct].regular_price.formated_price == "$0.00"
|
||||
|| this.config.variant_prices[this.simpleProduct].regular_price.formated_price == this.config.variant_prices[this.simpleProduct].final_price.formated_price
|
||||
) {
|
||||
regularPriceElement.innerHTML = "";
|
||||
}
|
||||
|
||||
if (
|
||||
regularPriceElement
|
||||
&& this.config.variant_prices[this.simpleProduct].regular_price.formated_price != "$0.00"
|
||||
&& this.config.variant_prices[this.simpleProduct].regular_price.formated_price != this.config.variant_prices[this.simpleProduct].final_price.formated_price
|
||||
) {
|
||||
regularPriceElement.innerHTML = this.config.variant_prices[this.simpleProduct].regular_price.formated_price;
|
||||
regularPriceElement.style.display = 'inline-block';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue