Skip Navigation

[Résolu] Need to get upsell pro

This support ticket is created Il y a 4 années et 10 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Marqué : 

This topic contains 1 réponse, has 2 voix.

Last updated by Minesh Il y a 4 années et 10 mois.

Assigned support staff: Minesh.


Tell us what you are trying to do?

Just need to add a view to my single product template page that lists upsell products- how do I filter for that? Cheers.



Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - to get upsell product IDs you need to use custom shortcode that returns all the upsell product IDs.

For example:

function func_get_product_upsell_ids() {
global $post;

$product = new WC_Product($post->ID);
$upsells = $product->get_upsell_ids();

return join(",",$upsells);

add_shortcode( 'get_upsell_ids', 'func_get_product_upsell_ids' );

And create a view, add Query filter and filter it by Post Id and select filter by shortcode attribute:

[wpv-view name="view-name" ids="[get_upsell_ids]"]

- ids is a view's shortcode attribute that contains the value returns by shortcode [get_upsell_ids].
- Please DO NOT FORGET to register the shortcode name get_upsell_ids at:
=> Toolset => Settings => Front-end Content => Third-party shortcode arguments

More info: