Troubleshooting //
Showcasing WooCommerce Up-sells

Showcasing WooCommerce Up-sells

Question

Is it possible with Query Builder to make a query to show Slider with WooCommerce Up-sell Products on the Single Product page?

Tutorial requirements:

  • JetEngine and JetWooBuilder plugin installed and activated;
  • WooCommerce products added to the WordPress website;
  • Elementor editor free version or Gutenberg Editor.

Answer

Up-sells is a Woocommerce default field. You can check it in the _postmeta table. The field key is ‘_upsell_ids’

upsell ids database

Please follow the instructions below:

Create a Query with Query Builder

Go to WordPress Dashboard > JetEngine > Query Builder and create a new Query.

Please note that you can build Posts Query and WC Query; it works either way.

Give your new query a Name and choose the Query Type – “Posts Query”. All the settings will depend on the Query Type you have chosen. Let’s take a closer look at the setup.
Select the Post Type — “Products”:

post type query builder

In the Post In field, you should select the “Current meta value as a string” macro. With this macro, you can get comma-separated values from fields that contain arrays. You can use it with multiple select options.

Additionally, press the “Advanced settings” button to set the context.

upsell ids query builder

Here, we define the Context if needed and complete the Fallback field with the title we want to show whenever there are no products found.

Then, press the “Back” button to return to the general settings menu and save the changes by hitting the “Apply” button.

post in field dynamic tag advanced tag

Place the Product grid widget to the Single Product template and use this custom query

products grid query

Then you can enable the Carousel and play with the settings:

carousel products grid settings

Note, you can use any widget where you can enable Custom Query: Listing Grid or Products Grid.

Result:

carousel upsells

There you go; now you can showcase WooCommerce Up-sells products on your WordPress website by using the JetEngine plugin.

Was this article helpful?
YesNo
Still need help?
Submit a request