/*
Theme Name: TownPress Child
Theme URI: http://preview.lsvr.sk/townpress
Template: townpress
Author: LSVRthemes
Author URI: http://themeforest.net/user/LSVRthemes/portfolio
Description: Municipality WordPress Theme
Tags: theme-options,threaded-comments,translation-ready,featured-images,custom-logo,custom-menu,one-column,two-columns,three-columns,four-columns,left-sidebar,right-sidebar,footer-widgets,full-width-template,rtl-language-support
Version: 3.6.5.1611234987
Updated: 2021-01-21 13:16:27

*/

// Add checkboxes to WooCommerce checkout
add_action('woocommerce_review_order_before_submit', 'custom_checkout_checkboxes', 10);
function custom_checkout_checkboxes() {
    woocommerce_form_field('custom_checkbox_1', array(
        'type'    => 'checkbox',
        'class'   => array('form-row-wide'),
        'label'   => 'GDPR - I am happy to receive updates about the Rainhill Beer Festival, The Rotary Club of Rainhill and its activities. Including information on Good Causes the events support. You can unsubscribe at any time. We thank you for your support to Good Causes in Rainhill.',
        'required' => true,
    ), WC()->checkout->get_value('custom_checkbox_1'));

    woocommerce_form_field('custom_checkbox_2', array(
        'type'    => 'checkbox',
        'class'   => array('form-row-wide'),
        'label'   => 'I want to GIFT AID my donation/sponsorship. I confirm that I am a UK Income or Capital Gains Taxpayer. I have read this statement and want the Rainhill Beer Festival to reclaim tax on the donation/sponsorship. I understand if i pay less Income Tax/or Capital Gains tax in the current tax year then than the amount of Gift Aid claimed on all of my donations it is my responsibility to pay any difference. I understand the charity will reclaim 25p of tax on every £1 that I have given.',
        'required' => false,
    ), WC()->checkout->get_value('custom_checkbox_2'));
}

// Add View Cart button to single product page
add_action('woocommerce_single_product_summary', 'add_view_cart_button_to_product_page', 35);

function add_view_cart_button_to_product_page() {
    echo '<a class="button view-cart-button" href="' . wc_get_cart_url() . '">View Cart</a>';
}