• Resolved dzseti

    (@dzseti)


    I get a php error after a new vendor registers when accessing the store’s info for store_slug

    wcfmmp_get_store(get_userdata($ID))->get_shop_info()['store_slug']

    throws:

    Undefined index: store_slug

    If I then change and save the store slug in the vendor’s settings, then there is no longer an error and the info is available

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

    (@wclovers)

    wcfmmp_get_store(get_userdata($ID))->get_shop_info()[‘store_slug’]

    – Sorry, I don’t understand this code.

    Store slug is user’s nicename.

    Thread Starter dzseti

    (@dzseti)

    All I’m trying to do is to access the user’s nicename after registration

    Thread Starter dzseti

    (@dzseti)

    For some reason neither:

    wcfmmp_get_store(get_userdata($ID))->get_shop_info()

    nor

    wcfmmp_get_store_info(get_userdata($ID))

    return the nicename between a vendor registering and editing the vendor’s slug. However:

    wcfmmp_get_store_url(get_userdata($ID))

    does show the nicename in the url for the store. So now sorted

    Plugin Author WC Lovers

    (@wclovers)

    Use this snippet –

    $the_user = get_user_by( 'id', $user_id );
    $store_slug     = $the_user->user_nicename;
    Thread Starter dzseti

    (@dzseti)

    Thanks 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘After vendor registration store_slug is not set’ is closed to new replies.