Plugin Author
hxii
(@hxii)
Do you mean regular category pages or ones built with a page-builder?
Can you show me how you implement the shortcode?
I am using Beaver Builder Page Builder to build a template for the archive pages. If I use the shortcode [yotpo_bottomline]
, it does not output anything. But if I use the shortcode (example) [yotpo_bottomline product_id="47"]
, it will output the yotpo bottom line for that particular product id, but of course, I don’t want one product id bottom line to show for all the products on the archive page. I want each individual yotpo bottom line to show for each product. Hopefully that made sense.
Plugin Author
hxii
(@hxii)
Unfortunately, with page builders it’s not possible (AFAIK) to automatically get the product ID (in the context of category/archive) as the shortcode is not within the product loop when you add it, so you will have to add the product_id
property with the proper value.
Gotcha, thanks for the help. Although, I’m seeing a new error now that I’ve never seen before. It is on a single product page, using the [yotpo_bottomline]
shortcode. The error is showing at the top of the content section on products that have 0 reviews. The error does not show up for products that have 1+ reviews:
Warning: array_key_exists() expects parameter 2 to be array, string given in /path/to/root/public_html/mydomain.com/wp-content/plugins/shortcodes-for-yotpo/wc_yotpo_shortcodes.php on line 62
Oh, now I see the noempty
attribute. I added that to the shortcode and that solved the issue.