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

    The shortcode [wdm_my_subscription] below loads the users WooCommerce Membership subscriptions to the frontend, if the user has any, otherwise the code produces a message that the user does not have any subscriptions. The shortcode produce the result on the page, but ignores the Avia Modules and thus loads the content above them, rendering the page erroneously (See screenshot) .

    This site uses other shortcodes, mainly from Gravity Forms, Gravity View, Avia page builder of cource plus one or two other minor functions. All of these work as expected. I have tried several other shortcodes that load data from WooCommerce “My account” page, and found that all of them produce the same error. I suppose it’s not a long shot to guess that the plausible reason is that the Avia Builder is not singing in perfect harmony with WooCommerce.

    Would be happy for a lead or a hint on where a fix for this can be found.

    Script for placement in functions.php:

    function wmd_my_custom_function(){
    add_filter('widget_text', 'do_shortcode');
        WC_Subscriptions::get_my_subscriptions_template();
    }
    add_shortcode('wdm_my_subscription', 'wmd_my_custom_function');
    #735859

    Hey Björn,

    Thank you for using Enfold.

    Are you using the advance layout builder? Please provide the url to the page so that we can inspect the markup. Or replace the snippet with the following.

    function wmd_my_custom_function(){
    	add_filter('widget_text', 'do_shortcode');
    	ob_start();
    	WC_Subscriptions::get_my_subscriptions_template();
    	$output = ob_get_clean();
    	return $output;
    }
    add_shortcode('wdm_my_subscription', 'wmd_my_custom_function');

    Best regards,
    Ismael

    #737255

    Yes I am using the advanced layout builder. The code you provided does the trick.
    Thanks!

    #737523

    Hi,

    Great, glad we could help :-)

    Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

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