Skip to content

Instantly share code, notes, and snippets.

@aatronco
Last active April 10, 2020 21:43
Show Gist options
  • Save aatronco/cdf357f57431ac92c8f5c64fb7872786 to your computer and use it in GitHub Desktop.
Save aatronco/cdf357f57431ac92c8f5c64fb7872786 to your computer and use it in GitHub Desktop.
{% if order.subtotal < 100 %}
<script>
// Add this to your checkout block. Change the minimum from 100 to your desired number. Use a large number to block all purchase, change to 0 to block none
// Design your message
var message = '<i class="fa fa-info-circle fa-fw"></i>There is a minimum order required of <strong>100 USD</strong>'
var alert_m = '<div align="middle" id="alert-minimum" class="text-center alert alert-warning m-0">' + message + '<br><a onclick="history.go(-1); return false;" href="#" class="btn btn-sm btn-secondary mt-2" title="&larr; {% t 'Go back & Keep Shopping' %}">&larr; {% t "Go back & Keep Shopping" %}</a></div>'
$(document).ready(function(){
$("#checkout").before(alert_m)
$('input').attr('disabled','disabled');
$('#checkout').attr('style',"background: #e6e6e6;").hide();
})
</script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment