Advertisement
rijarob

Cart Validation Script

May 23rd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <script type="text/javascript">
  2. var alertMessage = "You need to order at least $150 in order to checkout";
  3.  
  4. function priceCheck() {
  5. if (fc_json.total_price >= 150) {
  6. FC.checkout.config.isValid = true;
  7. } else {
  8. FC.checkout.config.isValid = false;
  9. alert(alertMessage);
  10. }
  11. }
  12.  
  13. // Run our custom validation before the checkout validates
  14. FC.checkout.overload("validateAndSubmit", "priceCheck", null);
  15.  
  16. jQuery(document).ready(function() {
  17. if (fc_json.total_price < 150) {
  18. alert(alertMessage);
  19. }
  20. });
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement