Support » Plugin: WooCommerce Blocks » Woocommerce customize template file not override

  • Resolved Tetsuya Imamura

    (@s56bouya)


    Hi.

    I displayed products in the “Products by Category” block, but I can’t overwrite
    customized woocommerce template “archive-product.php”.

    In previous versions, templates were loaded without any settings. (I forgot the previous version)

    The “Products by Category” block was taken as an example, but the same thing happens in other blocks. Also the “On Sale Products” block.

    WooCommerce 3.7.0
    WooCommerce Blocks 2.4.1

    Kind regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Albert Juhé Lluveras

    (@aljullu)

    Hi @s56bouya, thanks for your report! In 2.2, we changed the templates used by WooCommerce Blocks from the legacy ones to a custom block markup. You can read an explanation here:

    https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/891

    You can style WooCommerce Blocks with CSS, but if you need more advanced styling, your best option would be to use shortcodes for now.

    Hi.
    Thank you for your reply.

    I read the issue but it has not been resolved.

    I’m writing my own style with the WooCommerce stylesheet disabled.

    add_filter (‘woocommerce_enqueue_styles’, ‘__return_false’);

    I got a suggestion for custom markup, but I don’t need the font family style.

    .wc-block-grid__product-rating .star-rating {
    font-family: star;
    }

    So, the template is overwritten and the corresponding part is deleted. I would like to change the output html , instead of using custom markup.

    Another problem is short code. I don’t use shortcode. Because you can’t change parameters dynamically like WooCommerce Blocks. And it is not easy for the user to enter a short code in the editor, so I don’t want to use it.

    My request is simple. I just want to output the same html as “archive-product.php”.

    Do you have any other good ideas?

    Plugin Author Albert Juhé Lluveras

    (@aljullu)

    Hi @s56bouya, I understand your point but that’s not currently possible. We are still considering and investigating what would be the best way to add extensibility to WooCommerce Blocks. We don’t want to add some extensibility options and then have to deprecate them because they had some design flaws, that’s why the project is still under a consideration phase as described in https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/891.

    If you need to customize the block markup (for example, to have the same layout as archive-product.php), we recommend using shortcodes. We understand they are less user-friendly than blocks, and that’s why WooCommerce Blocks exists, to make users’ lives easier! But currently shortcodes are the best option if you need to display a different markup than the one provided by blocks.

    Thank you for your reply.
    And sorry for my late reply.

    I understand.

    WooCommerce Blocks is a very intuitive and future-proofing plugin.

    I look forward to future updates.

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