how to show actual price of simple products in configurable product view page select box












2














Currently it shows



enter image description here



I want the actual price and not the price Difference with + sign










share|improve this question



























    2














    Currently it shows



    enter image description here



    I want the actual price and not the price Difference with + sign










    share|improve this question

























      2












      2








      2


      1





      Currently it shows



      enter image description here



      I want the actual price and not the price Difference with + sign










      share|improve this question













      Currently it shows



      enter image description here



      I want the actual price and not the price Difference with + sign







      magento-1.9






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 '16 at 6:21









      Asim Munshi

      34318




      34318






















          4 Answers
          4






          active

          oldest

          votes


















          4















          1. 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+= '+';
          }
          }*/





          share|improve this answer































            0














            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+= '+';
            }
            }*/





            share|improve this answer





























              0














              You should delete ";" in



              var price = absoluteFinalPrice; }


              It's not needed there.






              share|improve this answer





























                0














                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;





                share|improve this answer








                New contributor




                user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.


















                  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
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  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









                  4















                  1. 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+= '+';
                  }
                  }*/





                  share|improve this answer




























                    4















                    1. 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+= '+';
                    }
                    }*/





                    share|improve this answer


























                      4












                      4








                      4







                      1. 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+= '+';
                      }
                      }*/





                      share|improve this answer















                      1. 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+= '+';
                      }
                      }*/






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 10 '16 at 6:40

























                      answered Nov 10 '16 at 6:29









                      Rajan Soni

                      696424




                      696424

























                          0














                          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+= '+';
                          }
                          }*/





                          share|improve this answer


























                            0














                            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+= '+';
                            }
                            }*/





                            share|improve this answer
























                              0












                              0








                              0






                              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+= '+';
                              }
                              }*/





                              share|improve this answer












                              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+= '+';
                              }
                              }*/






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jun 7 '17 at 10:25









                              williejan

                              1




                              1























                                  0














                                  You should delete ";" in



                                  var price = absoluteFinalPrice; }


                                  It's not needed there.






                                  share|improve this answer


























                                    0














                                    You should delete ";" in



                                    var price = absoluteFinalPrice; }


                                    It's not needed there.






                                    share|improve this answer
























                                      0












                                      0








                                      0






                                      You should delete ";" in



                                      var price = absoluteFinalPrice; }


                                      It's not needed there.






                                      share|improve this answer












                                      You should delete ";" in



                                      var price = absoluteFinalPrice; }


                                      It's not needed there.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jun 9 '17 at 8:11









                                      Roman Chupryna

                                      11




                                      11























                                          0














                                          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;





                                          share|improve this answer








                                          New contributor




                                          user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                          Check out our Code of Conduct.























                                            0














                                            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;





                                            share|improve this answer








                                            New contributor




                                            user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                            Check out our Code of Conduct.





















                                              0












                                              0








                                              0






                                              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;





                                              share|improve this answer








                                              New contributor




                                              user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              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;






                                              share|improve this answer








                                              New contributor




                                              user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              share|improve this answer



                                              share|improve this answer






                                              New contributor




                                              user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              answered yesterday









                                              user1823053

                                              1




                                              1




                                              New contributor




                                              user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.





                                              New contributor





                                              user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






                                              user1823053 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






























                                                  draft saved

                                                  draft discarded




















































                                                  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.




                                                  draft saved


                                                  draft discarded














                                                  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





















































                                                  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







                                                  Popular posts from this blog

                                                  An IMO inspired problem

                                                  Management

                                                  Investment