Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi Ashworth Creative, I know this is not where I should post this but your topic was closed on the subject. I want to know if you can help me with this code you created. I would like to use this snippet of code so my product variations show up on the products page. However, when I use it and add a product to the cart I don’t want it to redirect to the cart I want it to stay on the products page and allow the user to add more products until they are ready to checkout. When I do this and add a product to the cart it refreshes the product page with the added product but all of my products now have add to cart buttons based on the product that I just added to the cart. I don’t want it to do that. Here is the code but I want to know if you have a solution for this that would work some way when I add a product to cart it will just reset the page?

    if ( ! function_exists( ‘woocommerce_template_loop_add_to_cart’ ) ) {

    function woocommerce_template_loop_add_to_cart() {
    global $product;

    if ($product->product_type == “variable”) {
    woocommerce_variable_add_to_cart();
    }
    else {
    woocommerce_get_template( ‘loop/add-to-cart.php’ );
    }

    }

    }

    Thank you.

Viewing 1 replies (of 1 total)