Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudanti.
Follow Me
Use WooCommerce shortcodes to Displaying Products across Shops – WooCommerce MultiSite Global Cart
documentation-template-default,single,single-documentation,postid-15895,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,cookies-not-set,wpb-js-composer js-comp-ver-6.3.0,vc_responsive

Use WooCommerce shortcodes to Displaying Products across Shops

WooCommerce MultiSite Global Cart / Use WooCommerce shortcodes to Displaying Products across Shops
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

Use WooCommerce shortcodes to Displaying Products across Shops

This newly implemented functionality helps with displaying WooCommerce Products across shops, in the network, under your WordPress MultiSite environment. Promote specific products, types of merchandise, category of goods, so boosting overall network sales. The new function is available as a Woocommerce Product Shortcode and is easy to implement. Any section of a site can include the shortcode to output the required products. The woocommerce shortcode is usable within the default WordPress editor ( classic ) or any advanced layout composer like Elementor, Divi, Visual Builder etc.


Which are the woocommerce shortcodes to use?

Using the default WordPress block editor, chose the Shortcode widget:

Displaying WooCommerce Products across Shops
In the widget insert the woogc_products which is the new woocommerce product shortcode that provides the functionality:

This takes multiple arguments, for the outputted woocommerce products, to match the exact requirements:

  • sites_id – The network sites IDs intended for use in the shortcode filtering criteria when outputting the products.
  • categories – The used category name.
  • search – A keyword search used for filtering the products title, content, excerpt etc.
  • min_price – A minimum price for the products.
  • max_price – A maximum price for the products.
  • orderby – The order of returned products.
  • status – The Status of returned items, as default being Publish.
  • posts_per_page – The number of items returned for current page.
  • page – The number of page, is using above argument limitation.

All of above shortcode arguments are optional.

Example of woocommerce shortcode usage.

To outputs products on current shop, from network sites ID 3 and 4, using the word book, invoke the following woocommerce shortcode:

[woogc_products sites_id=3,4 search=book]

A sample output of the shortcode appears like this:


How does the displayed shared woocommerce products layout look like?

For better integration with the current layout, the outputted data uses the local site theme appearance and styles. Further customization is possible, if necessary. Therefore through the template file that holds the processor unit, similar to WooCommerce templates.

When displaying the WooCommerce Products across shops, the plugin core uses the template located at /wp-content/plugins/woo-global-cart/templates/shortcodes/woogc-products.php. This file is based on the WooCommerce default loop template. So the result is a basic layout, always using the theme appearance and style.
If need customization, the above file need copied over to theme/child-theme, within /woocommerce/shortcodes/. After that, the required adjustments can apply to the new file.