Shortcodes

Vendors list

Add the shortcode “[yith_wcmv_list]” to the editor of your page to show the complete list of your vendors in the pages of your site.
Shortcode attributes:

  • “per_page”: it lets you activate the paging by selecting how many vendors you want to display. (es. per_page=2) (Default: -1).
  • ”hide_no_products_vendor”: hide the vendors without products (Default: false).
  • ”show_description”: add the vendor description for each vendor (Default: false).
  • ‘description_lenght”: number of characters for description (if enabled) (Default: 40).
  • “vendor_image”: [store/gravatar] allows selecting the image type to combine to vendor’s profile, choosing from the default one of the plugin (store) or the gravatar connected to vendor’s email address (gravatar). (Default: store).
  • “order_by”: [name/slug/description] defines the parameter for vendors organization within the list. Note: for this arg, the allowed values are ‘name’, ‘slug’, ‘term_group’, ‘term_id’, ‘id’, ‘description’. (Default: name).
  • “order”: [asc/desc] ascending or descending order. Allowed value: ASC or DSC (Default: ASC).
  • “include”: it allows adding the ID of the vendor(s) you want to show (separated by comma).

01_001

Become a vendor

The shortcode [yith_wcmv_become_a_vendor] allows adding the registration form to become a vendor.

Shortcode

To allow your users to become vendors, make sure to select the page where you inserted the shortcode in “Become a vendor” field from the plugin settings dashboard in the “Frontpage” section.

Products by vendor ID

The shortcode [yith_wcmv_vendor_products vendor_id=XX] allows showing products by vendor ID.

Please note – it works only with WooCommerce 3.2.X or higher.

The shortcode arguments are the following:

Available Product Attributes

The following attributes are available to be used in combination with the [yith_wcmv_vendor_products] shortcode. They are split into sections for a primary function to make the navigation easy. Here are some examples:
Display Product Attributes
  • limit -> The number of products to show. Defaults: -1. With the value -1, it shows all products.
  • columns –> The number of columns to show. Defaults: 4.
  • paginate –> Toggles pagination on. To be used in combination with limit. Defaults: false. Set to true to paginate.
  • orderby –> Sorts the products shown by the selected option. One or more options can be entered by adding both slugs with a space between them. Available option: date (the date when the product was published).
  • id –> The post ID of the product.
  • menu_order –> The Menu Order, if set (lower numbers show first).
  • popularity –> The number of purchases.
  • rand –> Randomly order the products on page load (may not work with sites that use caching, as it could save a specific order).
  • rating –> The average product rating.
  • title –> The product title. This is the default orderby mode.
  • skus –> Comma-separated list of product SKUs.
  • category – >Comma-separated list of category slugs.
  • tag –> Comma-separated list of tag slugs.
  • order –> States whether the product order is ascending (ASC) or descending (DESC), using the method set in orderby. Default: ASC.
  • class –> Adds an HTML wrapper class so you can modify the specific output with custom CSS.
  • on_sale –> Retrieves on sale products. Not to be used in conjunction with best_selling or top_rated.
  • best_selling –> Retrieves the best selling products. Not to be used in conjunction with on_sale or top_rated.
  • top_rated –> Retrieves top-rated products. Not to be used in conjunction with on_sale or best_selling.
Content Product Attributes
  • attribute –> Retrieves products using the specified attribute slug.
  • terms –> Comma-separated list of attribute terms to be used with attribute.
  • terms_operator –> Operator to compare attribute terms. Available option: AND (it will show products from all of the chosen attributes); IN (it will show products with the chosen attribute. Default: terms_operator value; NOT IN (it will show products that are not in the chosen attributes).
  • tag_operator –> Operator to compare tags. Available options are: AND (it will show products from all of the chosen tags); IN (it will show products with the chosen tags. Default: tag_operator value); NOT IN (it will show products that are not in the chosen tags).
  • visibility –> It shows products based on the selected visibility. Available options are: visible (products visible on shop and search results. Default: visibility option; catalog (products visible on the shop only, but not search results); search (products visible in search results only, but not on the shop); hidden (products that are hidden from both shop and search, accessible only by direct URL); featured (products that are marked as Featured Products).
  • category –> Retrieves products using the specified category slug.
  • tag –> Retrieves products using the specified tag slug.
  • cat_operator –> Operator to compare category terms. Available options: AND (it will show products that belong to all of the chosen categories); IN (it will show products within the chosen category. Default: cat_operator value); NOT IN (it will show products that are not in the chosen category).
  • ids – > It will show products based on a comma-separated list of Post IDs.
  • skus – > It will show products based on a comma-separated list of SKUs.
Please note – If the product is not showing, make sure it is not set to Hidden in the Catalog Visibility.
Special Product Attributes
These attributes cannot be used with the “Content Attributes” listed above, as they will likely cause conflict and not display. You should only use one of the following special attributes.
  • best_selling –> It will show your best selling products. Set to: true.
  • on_sale –> It will show your on-sale products. Set to: true.

Product Category shortcodes

These two shortcodes will display your product categories on any page.
  • [product_category] –> It will show products in a specific product category.
  • [product_categories] –> It will show all your product categories.
Product Category attributes
  • ids –> Specify specific category IDs to be listed.
  • limit –> The number of categories to show.
  • columns –> The number of columns to show. Default: 4
  • hide_empty –> Default: 1 (this will hide empty categories). Set to “0” to show empty categories.
  • parent –> Set to a specific category ID if you want to show all the child categories.
  • orderby –>Default: order by “name”, can be set to “id”, “slug”, or “menu_order”. If you want to order by the IDs you specified then you can use orderby=”include”.
  • order –> Defines whether the category ordering is ascending (ASC) or descending (DESC), using the method set in orderby. Defaults: ASC.