wcfm-santa

Making Christmas merrier with our special gift! Enjoy upto 25% off on all WCFM Addons.

CLAIM OFFER
01Day 01Hr 44Min 27Sec

Need product list for vendors by ID

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM Need product list for vendors by ID

Viewing 0 reply threads
  • Author
    Posts
    • #132194
      Dean
      Participant

      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.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.