In your technical docs, you show examples of how to access vendor data on page templates. I am focusing on the product page templates currently. For example...
The example above breaks the page (causes php error) on its own. There is no value for $vendor_id without some sort of context defined. Can you give a full example of how to initialize the data so we can access the marketking() object? Also, how would I get $vendor_id? Another important field to retrieve are the vendor's terms and conditions.
This will give you the store name of the vendor with the user ID of 15.
(2) Let me give you another example. You mentioned you are working on the product page template. On the single product page frontend, you may use the following:
global $post;
$product_id = $post->ID; // this gives us the product ID of the current product
$vendor_id = marketking()->get_product_vendor($product_id); // this gives us the vendor id of the current product
$store_name = marketking()->get_store_name_display($vendor_id)
(this is an example of how you can get the current store name on the single product page)
(3) To get the terms and conditions of a vendor, you can use this code:
Is there a master list of all the vendor data variables? It would be nice to not have to put in a support ticket for every single step of the development process. Right now I need:
Vendor logo, profile image, vendor description, city, state, country, store notice.
All of the info is stored as user meta data, so if there's anything you can't find, the quickest way may be to check the wp_usermeta table for the specific vendor,
Hi,
In your technical docs, you show examples of how to access vendor data on page templates. I am focusing on the product page templates currently. For example...
echo marketking()->get_store_name_display($vendor_id);
The example above breaks the page (causes php error) on its own. There is no value for $vendor_id without some sort of context defined. Can you give a full example of how to initialize the data so we can access the marketking() object? Also, how would I get $vendor_id? Another important field to retrieve are the vendor's terms and conditions.
Thanks!
Hi John,
Thank you for purchasing our plugin,
(1) The $vendor_id variable should be defined previously in your code. So for example:
This will give you the store name of the vendor with the user ID of 15.
(2) Let me give you another example. You mentioned you are working on the product page template. On the single product page frontend, you may use the following:
(this is an example of how you can get the current store name on the single product page)
(3) To get the terms and conditions of a vendor, you can use this code:
(again, the vendor id needs to be defined previously).
I hope that helps but let me know if you have any questions,.
Kind regards,
Stefan
Helpful Thanks.
Is there a master list of all the vendor data variables? It would be nice to not have to put in a support ticket for every single step of the development process. Right now I need:
Vendor logo, profile image, vendor description, city, state, country, store notice.
Thanks
Hi there,
For the vendor logo, profile image, vendor description, you can use:
To get the store notice message:
For the city / state / country:
You can find information here as well https://woocommerce-multivendor.com/docs/developer-documentation-functions-hooks-custom-code-plugin-integrations/
All of the info is stored as user meta data, so if there's anything you can't find, the quickest way may be to check the wp_usermeta table for the specific vendor,
Kind regards,
Stefan