jQuery(function($) {
    $(document).ready(() => {
        console.log("hello, world")
        let checkoutBtns = $('.wc-proceed-to-checkout');
        checkoutBtns.append(`<a href="http://ec2-18-118-106-146.us-east-2.compute.amazonaws.com/checkout/" 
                            class="checkout-button button alt wc-forward">Proceed to Gratify Pay
                            </a>`)

       
        const pathname = window.location.pathname.replaceAll("/", '');

        if(pathname === "checkout"){
            console.log($("#place_order").val() )
            
         $("#order_review").append(`<a href="http://ec2-18-118-106-146.us-east-2.compute.amazonaws.com/checkout/" 
         class="checkout-button button alt wc-forward">Proceed to Gratify Pay
         </a>`)
         $("#place_order").remove()
        }
                
    })

    // const modifyPlaceOrderButton = (callback) => {
    //     if(!= "Pay")
    // }
    const waitForEl = (selector, callback) => {
        if($(selector).length){
            callback()
        }else{
            setTimeout(() => {
                waitForEl(selector, callback)
            }, 100)
        }
    };
})
