• gildner

    (@gildner)


    Hi,

    it seems, that the plugin is not working in WooCommerce. I’m using the plugin in the shop page and as soon as I open the page, the toggle block isn’t rendered correctly. The text is shown, but there is no functionality.

    While looking this up, I found that the styles and script file aren’t loaded and even after loading them with enqueue_block_assets / wp_enqueue_scripts the most I can get is a styled toggle block standard block with no customization.

    I used those lines of code:

    add_action('enqueue_block_assets', function () {
    	wp_register_style('woo-ultimate-blocks-css', plugin_dir_url('') . 'ultimate-blocks/dist/blocks.style.build.css');
    	wp_enqueue_style('woo-ultimate-blocks-css');
    });
    
    add_action('enqueue_block_assets', function () {
    	wp_register_script('woo-ultimate-blocks-js', plugin_dir_url('') . 'ultimate-blocks/dist/font.build.js');
    	wp_enqueue_script('woo-ultimate-blocks-js');
    });

    Do you have any tipps/tricks I can use to get the block rendered correctly?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Imtiaz Rayhan

    (@imtiazrayhan)

    Hi,

    Thanks for reporting the issue.

    We will look into it and get back to you as soon as we have something.

    Kind regards.

    Thread Starter gildner

    (@gildner)

    I did some experiments meanwhile.

    The problem has something todo with how the blocks are rendered. Even when using the_content() (e. g. when creating a archive.php), then the blocks won’t render as they would do normally.

    Here the code I used.

    <?php get_header();
    
    global $post;
    
    $page_id = get_queried_object_id();
    
    $post = get_post($page_id, OBJECT);
    setup_postdata($post);
    
    the_content();
    
    wp_reset_postdata();
    
    
    get_footer();

    Any idea on how to resolve this? Is there a possibilty to re-trigger the creation of inline-styles and scripts when using this?

    I keep trying to find a solution for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blocks not rendering in WooCommerce’ is closed to new replies.