Home Forums WC Vendors Free Support extract shortcode_atts with multiple meta key and meta value

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7065
    sanjay
    Participant

    How to add multiple meta value and meta key to make custom short code for filtration.here i am creating shortcode to filter vendors by there custom fields . i have 2 custom fields
    1:-pv_merchant__experiance_dropdwon
    2:-pv_merchant_specialization
    so i am looking for something like this if suppose i want create short code like this
    using bellow code:-
    [wc_vendors_location pv_merchant__experiance_dropdwon=”5 year” pv_merchant_specialization=”dietitian”]

    please tell me how to do this.

    extract( shortcode_atts( array(
    'orderby' => 'display_name',
    'order' => 'ASC',
    'per_page' => '12',
    'columns' => '4',
    'show_products' => 'yes',
    'meta_compare' => '=',
    'pv_merchant__experiance_dropdwon' => '',
    'pv_merchant_specialization' => '',
    'org' => '',
    ), $atts ) );
    // Hook into the user query to modify the query to return users that have at least one product
    if ($show_products == 'yes') remove_action( 'pre_user_query', array( $this, 'vendors_with_products') );
    // Get all vendors
    $vendor_total_args = array (
    'role' => 'vendor',
    'meta_key' => 'pv_shop_slug',
    'meta_value' => '',
    'meta_key' => 'pv_merchant__experiance_dropdwon',
    'meta_value' => $_POST[ 'pv_merchant__experiance_dropdwon1' ],
    'meta_key' => 'pv_merchant_specialization',
    'meta_value' => $_POST[ 'pv_merchant__experiance_dropdwon2' ],
    'orderby' => $orderby,
    'order' => $order,
    );

    if ($show_products == 'yes') $vendor_total_args['query_id'] = 'vendors_with_products';
    $vendor_query = New WP_User_Query( $vendor_total_args );

    #7071
    WC Vendors Support
    Participant

    You want me to tell you how to write your own shortcode? 🙂 Yea, that’s all you man. 🙂 We’ll help you get WC Vendors features working, but heavy customization and filtration based on your own sites needs, is alllllllllllll you. 🙂 We don’t have the time for free support on stuff like this. We need to be coding Pro instead.

    #7106
    sanjay
    Participant

    i have done it in own way click here
    Do not post site link publicly

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.