Okay
  Public Ticket #3426686
get_vendor_id_by_url always returns zero
Closed

Comments

  •  2
    Marceline started the conversation

    hello good people of the MarketKing Land!

    i have a question about the get_vendor_id_by_url function.

    global $wp;
    $current_url = home_url( add_query_arg( array(), $wp->request ) );
    echo marketking()->get_vendor_id_by_url($current_url);

    say i have 3 vendor store, 

    1. http://toystore.com/shop/one
    2. http://toystore.com/shop/two
    3. http://toystore.com/shop/three

    when i browse all three store, the get_vendor_id_by_url always returns 0. i wonder what went wrong :

    Love, Marcie.

  •  2,281
    WebWizards replied

    Hi Marceline,

    Similar to the ticket here https://webwizards.ticksy.com/ticket/3426666/ , these functions do not use the complete URL, they only use the unique URL ending of each vendor.


    So please call it like this:

    marketking()->get_vendor_id_by_url('one'); // correct

    rather than:

    marketking()->get_vendor_id_by_url('http://toystore.com/shop/one'); // incorrect


    Kind regards,

    Stefan

  •  2
    Marceline replied

    thankyou sir. very helpful

    marcie.