Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Need product list for vendors by ID
Tagged: Vendor Products
- This topic has 0 replies, 1 voice, and was last updated 4 years, 6 months ago by Dean.
- AuthorPosts
- May 17, 2020 at 5:29 pm #132194DeanParticipant
Hi,
I have created a plugin that creates geographical pages by County using URL Rewriting (for best SEO) and lists the vendors details and links.
I want to get a list of products for each vendor on each page into an array so that I can also create a product gallery on that page.
I can’t seem to find any code that works for this.
Please Help…
This is how far I have got so far…
Art and Craft Shops in (UK County x)I have set the following globals at the top of my plugin, and I am using a bespoke page template:
global $WCFM, $WCFMmp;And current code to get vendors:
$args = array( 'role' => 'wcfm_vendor', 'orderby' => 'last_name', 'order' => 'ASC', 'meta_query' => array( array( 'key' => '_wcfm_state', 'value' => $geo, 'compare' => 'LIKE', ), ), ); // Get Users by Location $users = get_users($args);
foreach ($users as $user) { $store_id = $user->ID; $store_user = wcfmmp_get_store($store_id); // Get Store Info $store_info = $store_user->get_shop_info(); $store = json_encode($store_info); }
And then looping through…
I want to also get the products into an array for each vendor.
- AuthorPosts
- You must be logged in to reply to this topic.