• Resolved garyroberts

    (@garyroberts)


    On this page: https://quadlayers.com/documentation/perfect-woocommerce-brands/shortcodes/

    On the Display brands of a specific product shortcode [pwb-brand], we tried using it on Elementor’s loop grid widget but the brand is not showing. The brand image is not showing for the products inside the loop so we checked how the plugin is displaying the product.

    Apparently, the shortcode only works on single pages and the only way for this to work is to override the plugin’s template here: plugins/perfect-woocommerce-brands/lib/shortcodes/class-brand.php. Then modify line 22 from this

    if ( ! $atts[‘product_id’] && is_singular( ‘product’ ) ) {

    to this

    if ( ! $atts[‘product_id’] ) {

    removing the condition is_singular(‘product’) to make it work on loop grid widget of elementor.

    We would like to suggest that you update this so that the shortcode would also work on custom shortcode loops.

    For now, our work-around is to update this php file every update of the plugin and this is very hard for me and my client.

    Your response for this will be much appreciated. Thank you very much.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support jmatiasmastro

    (@jmatiasmastro)

    @garyroberts

    Hello mate,

    To help us better understand the issue, could you please send us a screencast showing the behavior of the shortcode with Elementor and an explanation of the issue you’re experiencing?

    You can use the tool https://www.loom.com to copy/paste screencast here easily.

    Best regards, QuadLayers Support Team.

    Thread Starter garyroberts

    (@garyroberts)

    Hi,

    Here is a video https://www.loom.com/share/72c8db9629f34d58aad9f5fe48ba298c?sid=61cf0415-8bb5-4908-851e-f781f12a5f2f

    Apologies, this is my first time using loom.

    As you can see, at first we have already overridden the line

    if ( ! $atts[‘product_id’] && is_singular( ‘product’ ) ) {

    with

    if ( ! $atts[‘product_id’] ) {

    And when we return the original code, the shortcode disappears.

    We will do this every update of the plugin if it is not yet addressed.

    Your was the plugin recommended by WBW Product Filter PRO here: https://woobewoo.com/documentation/filter-by-brands/
    We tried the Official WooCommerce Extension but it turns out, your plugin is the one working and is the one that’s showing images on the frontend. We need to show the images on the filter and inside the loop as requested by the client.

    • This reply was modified 1 month, 2 weeks ago by garyroberts.
    Thread Starter garyroberts

    (@garyroberts)

    Hi,

    Any updates on this?

    Thanks

    Plugin Support jmatiasmastro

    (@jmatiasmastro)

    @garyroberts

    Hi mate,

    We’ve noticed that in both shortcodes you’re using, you haven’t defined a “product_id.” Keep in mind that the brand taxonomy is linked to a specific product. Therefore, if your shortcode doesn’t include a defined product_id, the brand image won’t be displayed. The correct format should be: [pwb-brand product_id="X"], along with any additional parameters you’d like to include.

    Best regards, Quadlayers Support Team.

    Thread Starter garyroberts

    (@garyroberts)

    I forgot to tell you that we are trying to use this shortcode in a loop to display the image and title of the brand dynamically. We can’t dynamically get the ID of the product from the Loop Item Widget into a shortcode.

    Your shortcode cannot get the product ID dynamically from the Loop Item Widget. In your documentation, it says that If “product_id” is empty the shortcode will try to get this value by itself” and that was what we banked on. We thought if that’s the case this could be used on a loop grid.

    At the start, we tried but the image just won’t display.. only the text on some occassion (Not sure why this happens). When we dug through the template files and modified this line:

    if ( ! $atts[‘product_id’] && is_singular( ‘product’ ) ) {

    with

    if ( ! $atts[‘product_id’] ) {

    the image is now visible inside the loop.

    Looks like you intend to only use this shortcode on single pages with the is_singular( ‘product’ ) argument. In our case we want to use it on our CPT’s to display the images on the archive page loops.

    I think there’s no harm in this and we still believe this should be updated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.