Top

Remove Additional Checkout Buttons from the Cart for Recurring Orders

1. In the cart.liquid theme file, locate where the Paypal button is located. Sometimes the code in the cart template will appear as something like {{ content_for_additional_checkout_buttons }}. We want to add "and show_paypal" to the IF statment surrounding the Paypal button as shown in the following:

Find the following chunk of code: 

{% if additional_checkout_buttons %}

    <div class="additional-checkout-buttons">
        {{ content_for_additional_checkout_buttons }}
    </div>
{% endif %}

 

And change it to this: 

{% if additional_checkout_buttons and show_paypal %}
    <div class="additional-checkout-buttons">
        {{ content_for_additional_checkout_buttons }}
    </div>
{% endif %}

 

2. Find the following line:  

<script>mixed_cart = false;</script>

Then paste the following on a brand new line beneath:

{% assign show_paypal = true %} 

 

3. Find the following line: 

{% if p.first == "group_id" %} or {% if item.properties.group_id %}

Then paste the following on a brand new line beneath:

{% assign show_paypal = false %}

 

4. Add the script below to the very bottom of the cart.liquid file. 

<script>
$(document).on("click",".recurring_div, .one_time_div", function() {

    if($('.recurring_div').hasClass('bold_active')){
        $('.additional-checkout-buttons').hide();
    }else{
        $('.additional-checkout-buttons').show();
    }
});

</script>

********** Please Note**********

In the script above, on the lines which say '.additional-checkout-buttons', this needs to match the wording from the  <div class="additional-checkout-buttons"> line in step one. So for example if in step one your code says : 

<div class="paypal-checkout-buttons">

The script below would have to be adjusted as follows to match: 

</script>

if($('.recurring_div').hasClass('bold_active')){
        $('.paypal-checkout-buttons').hide();
    }else{
        $('.paypal-checkout-buttons.).show();
    }

});

</script>

********** Please Note**********

 

 

 

 

Have more questions? Submit a request