0
votes

I have a WooCommerce store with Elementor.

I'm using an Elementor category product page template to generate the product page for each set of products.

I want to use this plug-in to create a table instead of a product grid: https://barn2.co.uk/wordpress-plugins/woocommerce-product-table/

To display the table, the creator of the plug-in provides the following shortcode: [Product Table]. I know you can modify the table to display a specific sub-category, but is it possible to automatically pull the subcategory for each page from a single shortcode? If not, I would need to create a new template for each shortcode...

For example: If I fill in the product id of e.g. category 2 in the shortcode, the Elementor product page template will display the table for this category on every page.

Question

Can I make the subcategory aspect of a shortcode dynamic? Preferably, the X is set automatically to the product's category of which page is being visited.

There is a question very similar to this, but I am a beginner and the .php code they provided was a little hard to understand...

Here's a link to the original question: Insert WooCommerce product id dynamically in shortcode

Any help would be greatly appreciated! Thanks guys.

1

1 Answers

0
votes

It looks like this page in the plugin documentation answers your question.