• Resolved anoetic

    (@anoetic)


    We installed woocommerce-product-stock-alert plugin and added the shortcode as per your documentation into our Divi Builder theme for all product pages, however the form is not showing up on the product page when the product is out of stock. It should display underneath where it says the product is out of stock.

    We have ticked the enable options in the plugin settings, and we have the option in woocommerce to display out of stock items. Your documentation says that the plugin works with all themes. We don’t have any caching on the site, and have checked in multiple browsers in incognito etc with flushed browser cache.

    Please assist in the resolution of this.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author MultiVendorX

    (@wcmp)

    Hi @anoetic, our team is looking into this, kindly provide them sometimes.

    Plugin Author MultiVendorX

    (@wcmp)

    Hi @anoetic, we have checked this on our end, as you can see this working fine: https://www.loom.com/share/665ec3f0dfdb46bcaa7a8f195f183864

    As you are facing the issue, can you share a video on how you are adding the shortcode?

    Thread Starter anoetic

    (@anoetic)

    Hi there,

    Video as requested

    Plugin Author MultiVendorX

    (@wcmp)

    Hi @anoetic, unable to recreate this on our end.

    Can you please get in touch with us via our forum (https://wc-marketplace.com/support-forum) so our team can help you out further.

    Thread Starter anoetic

    (@anoetic)

    Hi,
    Posted support ticket on your forum. Please advise urgently, as client is pushing to rather go for alternative plugin if this is not resolved in the next few days.

    Plugin Author MultiVendorX

    (@wcmp)

    @anoetic, we didn’t find your forum thread. Can you please share the link with us here.
    You can get the link from this page -: https://wc-marketplace.com/my-account/topics/

    Thread Starter anoetic

    (@anoetic)

    Hola, tengo el mismo problema. Escribo [display_stock_alert_form] en el módulo código de divi en el Theme Builder y no aparece después…

    ?Podéis ayudarme? Muchas gracias.

    Hi, I have the same problem. I write [display_stock_alert_form] in the divi code module in the Theme Builder and it doesn’t appear afterwards …

    Can you help me? Thanks a lot.

    Plugin Author MultiVendorX

    (@wcmp)

    Hhi @victorguindo @anoetic , we checked our shortcode in the normal woocommerce section, didn’t face any issue.

    It seems like related to Divi theme, can you please contact them regarding this. Please do tell them that this shortcode works fine if we use it in any other place. But when adding this vi Divi builder, it doesn’t work.

    Their input will help us understand this further.

    The problem here is this code in frontend.js that tells the form to display or not.

    if($('#product-'+pro_id).is('.outofstock') || $('#product-'+pro_id).is('.onbackorder')){
      $('.alert_container').css('display', 'block');
    }else{
      $('.alert_container').css('display', 'none');
    }

    The div doesn’t exist on a custom generated product page in Divi.

    So I created the following function to recreate that code.

    /**
     * Make product div
     *
     * Create a product div for WooCommerce Product Stock Alert
     * js functions to hook into.
     *
     * @return string
     */
    function my_product_div() {
    	global $product;
    
    	return '<div id="product-' . get_the_ID() . '" class="' . esc_attr( implode( ' ', wc_get_product_class( '', $product ) ) ) . '" style="display:none"></div>';
    }
    
    add_shortcode( 'my_wc_product_div', 'my_product_div' );

    Add that to your child functions.php and in Divi add a code module containing:

    [my_wc_product_div]
    [display_stock_alert_form]
    • This reply was modified 3 years, 5 months ago by louisatwork.
    • This reply was modified 3 years, 5 months ago by louisatwork.

    Hi @louisatwork ,
    Thanks for the help.
    This will help other users.

    Regards,

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Plugin shortcode (in Divi theme) not showing form’ is closed to new replies.