Skip Navigation

[Resolved] I need to format WooCommerce Archives when applying shortcodes

This support ticket is created 5 years, 10 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1192334

Tell us what you are trying to do? I am using the following [products paginate="true" use-sorting="false" limit=12 filter-id="3667" category="sweaters"] and I am trying to format the products rendered. I basically want to add a few custom fields under the images that I created using custom types. When I turn on WooComm add-on, I can reform the shop page, but it doesn't have any effect on the shortcode pages.

Is there any documentation that you are following? What's online

Is there a similar example that we can see? Not really. Just imagine, I want to create and archive where I have two custom text fields below each product when using the shortcode (not shop page).

What is the link to your site? hidden link

#1192351

Hello,

I assume we are talking about the Woocommerce built-in shortcode [products], you are going to display some custom field values in the items of shortcode [products].

There isn't such a built-in feature within Toolset plugins, I suggest you try to setup some custom PHP codes with Woocommerce built-in action hook "woocommerce_after_shop_loop_item", for example:

add_action('woocommerce_after_shop_loop_item', function(){
	if(is_page(2106)){
		echo get_post_meta(get_the_ID(), 'wpcf-my-field-1', true);
		echo '<br />';
		echo get_post_meta(get_the_ID(), 'wpcf-my-field-2', true);
	}
}, 10, 2);

Please replace 2106 with the page ID of URL:
hidden link

replace "my-field-1" and "my-field-2" with your custom field slugs

More help:
hidden link