Jump to content

Remove "from" in product price with multiple variants

Go to solution Solved by SourceProjects,

Recommended Posts

Does anyone know if it is possible to remove "From" in product prices when you have a few variants with higher prices? I would only like the lowest price to display without "from" and am struggling to find a solution.

Any help would be much appreciated!Thanks

Edited by 11squared
Initial Revision
Link to comment

Sure!

Here is a link to one.

Basically the only reason variants were added was for customers to add personalisation to products and pay the price accordingly (£7 per initial for products below £200) so the price may go up slightly if they choose to do this but the product price itself is always the same so it gives the wrong impression to say "from"...

Would be so grateful if you could shed any light. Thought this would be a simple fix! : )

Link to comment

@11squared With that site url. You can add to Home > Design > Custom CSS


/* Hide from & Price */
.product-price {
   visibility: hidden;
}
/* Unhide price */
span.sqs-money-native {
   visibility: visible;
   display: block;
}


Edited by tuanphan
Initial Revision

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

@tuanphan Thank you! : ) I have removed that css now.

I did originally try this code in the header:


<script>
   $(document).ready(function() {
   var text = $('.ProductItem-details .product-price').text();
   text = text.remove ('from');
   $('.ProductItem-details .product-price').text(text);
 });
 </script>

which was posted by @Patcross10 on a related issue (https://answers.squarespace.com/questions/122346/how-do-i-change-product-price-displayed-that-has-m.html) but it didn't work unfortunately...

Link to comment

@11squared Use this code


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
    $(document).ready(function() {
    var text = $('.ProductItem-details .product-price').text();
    text = text.remove ('from');
    $('.ProductItem-details .product-price').text(text);
  });
  </script>


Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
  • Solution

Hi, I found a solution for this, just wanted to share!

In CSS, add:


.summary-price {
    visibility: hidden;
}
/* Unhide price */
span.sqs-money-native {
    visibility: visible;
    display: block;
}

Then in Advanced >> Code Injection add this to the Footer:


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
     $(document).ready(function() {
     var text = $('.ProductItem-details .product-price').text();
     text = text.replace ('from', '');
     $('.ProductItem-details .product-price').text(text);
   });
   </script>

Thank you @Tuanphan for all your help! : ) I would not have found these solutions otherwise.

Link to comment
  • 5 months later...

I have tried to implement the selected solution (Aug 5) at the top of the thread. I am using a premium e-commerce account with the template Sonora. 

My site is in Italian language so the product price doesn't say "from" but it says "da".  I modified this detail in the code, however, it didn't work for me. Nothing changed except a return was inserted after the "da" pushing the price to a new line.

My real issue is that on the page in the preview summary of the product, I would like to force it to display the price of only one particular variant - a variant that is not the lowest in price, but that is usually the best seller.  Does anyone have a workaround for this?

Thanks in advance 😉

Link to comment
  • 3 weeks later...
  • 2 weeks later...
On 2/9/2020 at 3:34 AM, jcsteigs said:

@sportsam05 Did you figure this out? I'm trying to solve the same problem (display the price of a specific variant which is not the lowest in price). For now have just removed the price display altogether, and added the price in each variant's name so that it displays in the drop-down list... 

No, I haven't figured it out. Your workaround sounds good, but it won't work for my client.  I was thinking of putting in a question directly to tuanphan but in the end it stopped being a priority. However, it's good to note that multiple people are looking for this functionality.

Link to comment
  • 4 months later...
  • 10 months later...
  • 8 months later...
  • 1 year later...
On 8/5/2019 at 3:58 PM, SourceProjects said:

Hi, I found a solution for this, just wanted to share!

In CSS, add:

 
.summary-price {
    visibility: hidden;
}
/* Unhide price */
span.sqs-money-native {
    visibility: visible;
    display: block;
}

 

 

Then in Advanced >> Code Injection add this to the Footer:

 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
     $(document).ready(function() {
     var text = $('.ProductItem-details .product-price').text();
     text = text.replace ('from', '');
     $('.ProductItem-details .product-price').text(text);
   });
   </script>

 

 

Thank you @Tuanphan for all your help! : ) I would not have found these solutions otherwise.

Hello, i tried using the above after reading this page. I'm trying to hide the "From £X" from all products but show the final price when variants are selected. Any help would be much appreciated.  

Link to comment
3 hours ago, anastasiosmoiras said:

i tried using the above after reading this page.

The technique above does not work because SS made changes since then.

Please see the following.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.