Home Forums WoodMart support forum Ajax Products tabs and woocommerce_after_shop_loop_item_title hook

Ajax Products tabs and woocommerce_after_shop_loop_item_title hook

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #189340

    jaak69
    Participant

    Hello,

    I’ve used woocommerce_after_shop_loop_item_title to add additional info after product price on category pages and this works OK. I’ve added information in the following way:

    • With ACF was created select box custom field. Select box option values are HTML Block shortcodes
    • WPML is set to copy it to all languages
    • For all select box values I’ve created corresponding HTML Block to keep things manageable for end users + WPML translations
    • WPML string translation is switching HTML Block shortcode according to languages
    • woocommerce_after_shop_loop_item_title hook function is reading custom field and do_shortcode is rendering it

    The problem with Ajax Products tabs:

    How it is possible to fix this?

    Because this site is production site this custom field HTML is hidden on front page through CSS (<div class=”transport-front”>).

    #189344

    Artem Temos
    Keymaster

    Hello,

    The problem is that WPBakery doesn’t register its shortcodes in AJAX calls. Usually, it can be fixed with the following code

    if( class_exists('WPBMap') )
        WPBMap::addAllMappedShortcodes();

    Call this code just before your custom content. Sorry, but we can’t fix your custom code since it is out of our theme support scope.

    Regards

    #189389

    jaak69
    Participant

    Hello,
    Thanks for the code snippet.

    I put this code snippet into the function woodmart_shortcode_products_tab in the Woodmart theme files after ob_start and WPB shortcodes started to work. Then I’ve overridden this function in childs theme.

    Why this isn’t the default functionality?

    #189409

    Artem Temos
    Keymaster

    Because the problem with the custom code and not in our theme’s core functionality.

Viewing 4 posts - 1 through 4 (of 4 total)