Answers for "add to cart page refresh sumit woocommerce"

0

add to cart page refresh sumit woocommerce

add_action( 'woocommerce_add_to_cart_redirect', 'prevent_duplicate_products_redirect' );
function prevent_duplicate_products_redirect( $url = false ) {
  // if another plugin gets here first, let it keep the URL
  if( !empty( $url ) ) {
    return $url;
  }
  // redirect back to the original page, without the 'add-to-cart' parameter.
  // we add the 'get_bloginfo' part so it saves a redirect on https:// sites.
  return get_bloginfo( 'wpurl' ).add_query_arg( array(), remove_query_arg( 'add-to-cart' ) );
} // end function
Posted by: Guest on June-18-2020

Code answers related to "add to cart page refresh sumit woocommerce"

Browse Popular Code Answers by Language