Skip Navigation

[Resolved] Woocommerce View Single Product Template needs to include other plugin fields

This support ticket is created 7 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by jonS-2 7 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#404304
Woocommerce Views Template.jpg
woocommerce default.jpg

I am trying to create a custom woocommerce single product template.
I already have a plugin running (auction plugin) that hooks into this default template.
Is there a simple way to include the existing hooks into the new woocommerce custom template?

#404449

WooCommerce Views Content Templates work with ShortCodes.

If your third party Plugin provides ShortCodes to display content, you can use them.
Eventually, you want to register them first, in case you want to use them in Conditionals as well.
https://toolset.com/documentation/user-guides/shortcodes-within-shortcodes/

If your Plugin does not Provide any ShortCodes, it might not work with Content Templates.
Content Templates do replace the the_content() function of WordPress.

In case you can not display content with ShortCodes, you can not display those on Content Templates.

You might though create some Custom ShortCodes that render the 3rd party plugin's contents or contact its author and ask to provide some support for ShortCodes.

Can you let me know how you plan to display this 3rd parties contents?
Does the Plugin provide ShortCodes?

#404455

The plugin has shortcodes, but none that seem to be in relation to this block. It has hooks though. It there a way to display a view via add_action?

eg.

<?php add_action( 'woocommerce_simple_auctions_before_place_bid, '****display view****' ); ?>

#404464

The Views API allows you render a Content Template programmatically:
https://toolset.com/documentation/user-guides/views-api/

But this is not what you want.
You want to render a Specific Content of your 3rd Party Plugin inside a Content Template.
This is done by ShortCodes, HTML and CSS.

If the Plugin does not provide ways to display this specific Content via ShortCodes, then you can not display it in the Content Template.

What you can try is to display your Content in the Post Body by Custom Code and then, in the Content Template, call the Post Body by the View's ShortCode [wpv-post-body]
https://toolset.com/documentation/views-shortcodes/#wpv-post-body

#404550

Thanks mate.
I ended up going the other way.
Instead of creating a new woocommerce view, i just insterted the view to the existing single product template.
Thanks for your help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.