WooCommerce - excelling eCommerce
[resolved] How to change url "add to cart"? (2 posts)

  1. Andrew_shk
    Posted 1 year ago #

    Hello, everyone, please help me. How to change url "add to cart" for simple product? Because it button on page "shop" doesn't work.
    Now url looks like http://mysite.ru/shop/?add-to-cart=286
    I need it change to http://mysite.ru/?p=286


  2. Andrew_shk
    Posted 1 year ago #

    Find the way, in function.php add this code^

    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
    add_action( 'woocommerce_after_shop_loop_item', 'my_woocommerce_template_loop_add_to_cart', 10 );
    function my_woocommerce_template_loop_add_to_cart() {
        echo '<form action="' . get_permalink() . '" method="get">
                <button type="submit" class="single_add_to_cart_button button alt">Купить</button>

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic