• Bro thanks for your code which direct customer to vendor page when click to add to cart. But problem arise

    when there is a item already in cart.
    click add to cart from single product page shows Item(s) from one store already in your cart. First checkout with those and then purchase from other stores!.
    but when u click add to cart from shop page or product archieve page instead of show that message it redirect to homepage.
    NOTE: i am using one vendor at a time for check out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Can you please share which code previously I provided you?

    Thread Starter shayed

    (@shayed)

    add_filter( ‘woocommerce_add_to_cart_redirect’, function( $url, $product ) {
    if( $product && is_object( $product ) && method_exists( $product, ‘get_id’ ) && function_exists( ‘wcfm_get_vendor_id_by_post’ ) ) {
    $vendor_id = wcfm_get_vendor_id_by_post( $product->get_id() );
    if( $vendor_id && function_exists( ‘wcfmmp_get_store_url’ ) ) {
    $url = wcfmmp_get_store_url( $vendor_id );
    }
    }
    return $url;
    }, 500, 2 );

    Plugin Author WC Lovers

    (@wclovers)

    but when u click add to cart from shop page or product archieve page instead of show that message it redirect to homepage.

    – Does your theme has any special redirect option after add to cart?

    Thread Starter shayed

    (@shayed)

    I am using oceanwp theme. I dont know whether it has or not but from woocommerce i have activated that option.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘REDIRECTION’ is closed to new replies.