How to set a minimum purchase price on Spotlight theme?

How to set a minimum purchase price on Spotlight theme?

supernovastore
Visitor
2 0 1

I'm looking to edit the liquid code for my theme "Spotlight" so a customer needs to spend a minimum of $10 before they can checkout. I've seen a few tutorials for how to do this through setting your shipping rates at a minimum amount, but that's not what I'm looking to do.

 

I want the customer to go to their cart and if they have less than $10 in there, a little text blurb that says "Uh oh! You must meet a $10 order minimum for checkout." or something like that. I know this can be done as I've seen a couple tutorials on youtube for it, but they were for different themes. I need instructions for how to do this with "Spotlight" theme.

 

If anyone is willing to help me for free I would really appreciate it. My budget doesn't allow for me to pay a freelancer to set it up for me. My budget is $0. From what I can tell it's relatively quick and easy. Would be very grateful for some help. Thank you. ~Lauren

Replies 10 (10)

gr_trading
Shopify Partner
1886 145 198

Hi @supernovastore 

 

Please use the below code to implement the same.

 

{% assign _pVal = cart.total_price | divided_by : 100 %}
   {% if _pVal > 10 %}
// Put all your checkout code here
   {% else %}
      <div style="border:solid 2px red;">Order must be greater than 100 </div>
   {% endif %}

 

Refer to the attached screenshot for reference you can change the value {% if _pVal > 10 %} according to your requirement.

 

gr_trading_0-1696779678407.png

 

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
Beekeeper
Excursionist
16 0 3

Hello, 

I need help with this as well for Debut theme. Where do I add that code? Is it Cart-template-liquid? And where abouts. Can you please help.

gr_trading
Shopify Partner
1886 145 198

Sorry dear since we don't have debut theme will not able to help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
HCWCSH
Visitor
1 0 0

Amazing.  Is there a way to set minimums based on other custom criteria?  I'm thinking of customers that

  • are local delivery vs 3PL or
  • they are on a certain type of pre-existing agreement that requires a larger or smaller minimum
gr_trading
Shopify Partner
1886 145 198

Yes code can be customised based of some logic or user level.

 

we can discuss this over the WhatsApp or private msg details are in post footer.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
My_Bistro
Visitor
1 0 0

Could you walk me through how I could use this code to apply a maximum value to my cart?

gr_trading
Shopify Partner
1886 145 198

Hi @My_Bistro ,

 

Please refer to the below video for walk through.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
AmyChikate
Visitor
2 0 0

 i want to set for Rupees 229 in india 

ArslanAlvi
Shopify Partner
2 0 0

Please can you provide code for ella theme

 

gr_trading
Shopify Partner
1886 145 198

Code is subject to hire request you to reach us using email or whatsapp details are in post footer.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee