how to show actual price of simple products in configurable product view page select box
Currently it shows
I want the actual price and not the price Difference with + sign
magento-1.9
add a comment |
Currently it shows
I want the actual price and not the price Difference with + sign
magento-1.9
add a comment |
Currently it shows
I want the actual price and not the price Difference with + sign
magento-1.9
Currently it shows
I want the actual price and not the price Difference with + sign
magento-1.9
magento-1.9
asked Nov 10 '16 at 6:21
Asim Munshi
34318
34318
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
- List item
This is performed by javascript. You need to modify the method getOptionLabel in js/varien/configurable.js
find below code in js:
getOptionLabel: function(option, price){
var price = parseFloat(price);
replace with this:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
For remove + and - sign comment below code:
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
add a comment |
Doesn't work for me? Website:https://www.mirror-engraving.com/laser-engraved-mirror-etched-picture
Configurable field is: Size
Please have a look at my code below if I made a mistake here:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
if (this.taxConfig.includeTax) {
var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
var excl = price - tax;
var incl = excl*(1+(this.taxConfig.currentTax/100));
} else {
var tax = price * (this.taxConfig.currentTax / 100);
var excl = price;
var incl = excl + tax;
}
if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
price = incl;
} else {
price = excl;
}
var str = option.label;
if(price){
if (this.taxConfig.showBothPrices) {
str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
add a comment |
You should delete ";" in
var price = absoluteFinalPrice; }
It's not needed there.
add a comment |
The answer above for part 1 needs the last character of } removed to work ie -
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice;
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f145043%2fhow-to-show-actual-price-of-simple-products-in-configurable-product-view-page-se%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
- List item
This is performed by javascript. You need to modify the method getOptionLabel in js/varien/configurable.js
find below code in js:
getOptionLabel: function(option, price){
var price = parseFloat(price);
replace with this:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
For remove + and - sign comment below code:
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
add a comment |
- List item
This is performed by javascript. You need to modify the method getOptionLabel in js/varien/configurable.js
find below code in js:
getOptionLabel: function(option, price){
var price = parseFloat(price);
replace with this:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
For remove + and - sign comment below code:
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
add a comment |
- List item
This is performed by javascript. You need to modify the method getOptionLabel in js/varien/configurable.js
find below code in js:
getOptionLabel: function(option, price){
var price = parseFloat(price);
replace with this:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
For remove + and - sign comment below code:
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
- List item
This is performed by javascript. You need to modify the method getOptionLabel in js/varien/configurable.js
find below code in js:
getOptionLabel: function(option, price){
var price = parseFloat(price);
replace with this:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
For remove + and - sign comment below code:
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
edited Nov 10 '16 at 6:40
answered Nov 10 '16 at 6:29
Rajan Soni
696424
696424
add a comment |
add a comment |
Doesn't work for me? Website:https://www.mirror-engraving.com/laser-engraved-mirror-etched-picture
Configurable field is: Size
Please have a look at my code below if I made a mistake here:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
if (this.taxConfig.includeTax) {
var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
var excl = price - tax;
var incl = excl*(1+(this.taxConfig.currentTax/100));
} else {
var tax = price * (this.taxConfig.currentTax / 100);
var excl = price;
var incl = excl + tax;
}
if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
price = incl;
} else {
price = excl;
}
var str = option.label;
if(price){
if (this.taxConfig.showBothPrices) {
str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
add a comment |
Doesn't work for me? Website:https://www.mirror-engraving.com/laser-engraved-mirror-etched-picture
Configurable field is: Size
Please have a look at my code below if I made a mistake here:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
if (this.taxConfig.includeTax) {
var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
var excl = price - tax;
var incl = excl*(1+(this.taxConfig.currentTax/100));
} else {
var tax = price * (this.taxConfig.currentTax / 100);
var excl = price;
var incl = excl + tax;
}
if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
price = incl;
} else {
price = excl;
}
var str = option.label;
if(price){
if (this.taxConfig.showBothPrices) {
str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
add a comment |
Doesn't work for me? Website:https://www.mirror-engraving.com/laser-engraved-mirror-etched-picture
Configurable field is: Size
Please have a look at my code below if I made a mistake here:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
if (this.taxConfig.includeTax) {
var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
var excl = price - tax;
var incl = excl*(1+(this.taxConfig.currentTax/100));
} else {
var tax = price * (this.taxConfig.currentTax / 100);
var excl = price;
var incl = excl + tax;
}
if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
price = incl;
} else {
price = excl;
}
var str = option.label;
if(price){
if (this.taxConfig.showBothPrices) {
str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
Doesn't work for me? Website:https://www.mirror-engraving.com/laser-engraved-mirror-etched-picture
Configurable field is: Size
Please have a look at my code below if I made a mistake here:
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice; }
if (this.taxConfig.includeTax) {
var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
var excl = price - tax;
var incl = excl*(1+(this.taxConfig.currentTax/100));
} else {
var tax = price * (this.taxConfig.currentTax / 100);
var excl = price;
var incl = excl + tax;
}
if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
price = incl;
} else {
price = excl;
}
var str = option.label;
if(price){
if (this.taxConfig.showBothPrices) {
str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
/*if(showSign){
if(price<0){
str+= '-';
price = -price;
}
else{
str+= '+';
}
}*/
answered Jun 7 '17 at 10:25
williejan
1
1
add a comment |
add a comment |
You should delete ";" in
var price = absoluteFinalPrice; }
It's not needed there.
add a comment |
You should delete ";" in
var price = absoluteFinalPrice; }
It's not needed there.
add a comment |
You should delete ";" in
var price = absoluteFinalPrice; }
It's not needed there.
You should delete ";" in
var price = absoluteFinalPrice; }
It's not needed there.
answered Jun 9 '17 at 8:11
Roman Chupryna
11
11
add a comment |
add a comment |
The answer above for part 1 needs the last character of } removed to work ie -
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice;
New contributor
add a comment |
The answer above for part 1 needs the last character of } removed to work ie -
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice;
New contributor
add a comment |
The answer above for part 1 needs the last character of } removed to work ie -
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice;
New contributor
The answer above for part 1 needs the last character of } removed to work ie -
getOptionLabel: function(option, price){
var basePrice = parseFloat(this.config.basePrice);
var absoluteDifference = parseFloat(option.price);
var absoluteFinalPrice = basePrice + absoluteDifference;
// var price = parseFloat(price);
var price = absoluteFinalPrice;
New contributor
New contributor
answered yesterday
user1823053
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f145043%2fhow-to-show-actual-price-of-simple-products-in-configurable-product-view-page-se%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown