mihdan
5/18/2015 - 6:58 PM

wc-add-to-cart-on-single-product.php

<?php
// We can use ajax from archive page. it's easy - Remove old button which submiting form:
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );

// Add ajax-link from archive page to single product page:
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_loop_add_to_cart', 30 );

// P.S. JS Callback. For example you can show popup with links "Back to shop" and "Cart" or "Checkout"

$('body').on('added_to_cart',function(){
    // Callback -> product added
    //$('.popup').show();
});