Prestige Theme - checkbox when cart set to "drawer"?

Solved
Highlighted
Tourist
7 1 0

Hello!

 

Webstore - https://jeanpaulfung.myshopify.com/collections/services/products/production

 

I have installed a T&C's checkbox according to - https://help.shopify.com/en/themes/customization/cart/add-terms-and-conditions-checkbox

 

It previously worked 100% on the Debut theme, but now that I have changed to the Prestige theme I have 2 problems:

 

1. Checkbox only appears when Cart is set to 'Page'. Is it possible to have it show up when Cart is set to 'Drawer' also?

 

2. When Cart set to 'Page', customers are still able to proceed to Checkout without ticking the checkbox.

 

Please help!! Thank you 🙏🙏🙏

 

0 Likes
Highlighted
Tourist
7 1 0

1. Checkbox only appears when Cart is set to 'Page'. Is it possible to have it show up when Cart is set to 'Drawer' also?


OK so I solved my first problem by pasting the suggested code into the 'cart-drawer.liquid' file!

 

Problem #2 still remains however.... PLS HELP 😫

0 Likes
Highlighted
Shopify Expert
3913 559 940

Follow this:

1. Go to Online Store->Theme->Edit code
2. Asset->theme.js->paste bellow code in bottom of file

$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
      if ($('#agree').is(':checked')) {
        $(this).submit();
      }
      else {
        alert("You must agree with the terms and conditions of sales to check out.");
        return false;
      }
    });

Let me know if you need help.

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
7 1 0

Hi @Jasoliya!

 

Thanks so much for your help. Unfortunately this did not change anything.. Customer is still able to go from Cart to Checkout without checking the Terms and Conditions box... I tried both in Page and Drawer mode :(

0 Likes
Highlighted
Shopify Expert
3913 559 940

Can you console.log in call, so we can confirm that this JS calling or not. Add console.log('calling'); in js inside this function.

$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {

Or add me as staff i will do, text me o n mail or skype. 

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
7 1 0

@Jasoliya 

 

Is this what you're saying?

 

$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function(console.log('calling');) {

 

Thanks

0 Likes
Highlighted
Shopify Expert
3913 559 940

Replace with this:

$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
console.log('calling');
      if ($('#agree').is(':checked')) {
        $(this).submit();
      }
      else {
        alert("You must agree with the terms and conditions of sales to check out.");
        return false;
      }
    });

Note: check this in console by click F12.

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
7 1 0

this what you mean? @Jasoliya 

 

console.png

0 Likes
Highlighted
Shopify Expert
3913 559 940

Yes, but check after click on checkout button, so it track your click even and if Js work you can see  "Calling" in console other wise our Js not working. 

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
7 1 0

This is an accepted solution.

HI EVERYONE 

 

Thanks for all your help so far. Greatly appreciated 🙏

 

I've been speaking with Michaël Gallego, Lead support, theme developer @maestrooo.com and he figured out the problem + solution!

 

2 things need to happen in order to make the checkbox work for Prestige:

 

1. This code needs to be pasted at the bottom of the 'theme.min.js' file, NOT the 'theme.js' or 'theme.js.liquid' as suggested in the article I referenced above.

 

$(document).ready(function() {
    $('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
      if ($('#agree').is(':checked')) {
        $(this).submit();
      }
      else {
        alert("You must agree with the terms and conditions of sales to check out.");
        return false;
      }
    });
  });

 

 

2. This query needs to be pasted within the head tag, before the 'theme.min.js' in your "theme.liquid" file (as this code relies on jQuery).

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

 

Good luck all 🙏

 

 

0 Likes