I’m trying to add the “TI WooCommerce Wishlist” plugin to my woocommerce website. Since Bricks has no support for this plugin I had to add their shortcode to the Products.php file located at
bricks\includes\woocommerce\elements\products.php
The shortcode worked as I wanted, But now I want to make the changes inside a child theme so that the changes don’t get removed on the next update.
I tried to add the products.php file to the child theme with the same folder names but it’s not working.
How can I overwrite the Products.php file inside the parent theme from my child theme?
When using a custom template that makes use of the products element, you can try to add another field to the element with your shortcode inside of it. This way around, you don’t have to edit the code directly.
I tried that but the shortcode is rendered as text on the frontend. The shortcode I used is [ti_wishlists_addtowishlist loop=yes]
I also tried do_shortcode("[ti_wishlists_addtowishlist loop=yes]") both didn’t work.
You are right. The shortcode is not rendered but only displayed as text.
I have just added the issue to our bug tracker and expect it to be fixed shortly. Until then, unfortunately, you’ll have to do without the Wishlist feature in your product overview or continue adding the shortcode directly into the template (which, as you correctly pointed out, is not such a good idea).
I just wanted to let you know that this bug is fixed in Bricks 1.3.7.
It is also possible to do something like this: [bartag foo="{post_title}"] aka Shortcode + Dynamic Data Tag