• Resolved Cristina Mantione

    (@paroleinlinea)


    When I click edit to modify a product, the warning appears.
    The content of your article does not match the template assigned to your post type.
    Keep it as it is
    Reset template

    If I keep it, it does not let me add new blocks.
    If I reset it, it deletes my content.

    I have checked the various plugins by uninstalling them and the problem doesn’t change. What has happened?

    Thank you,
    Cristina

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have the same issue when trying to edit existing products. When trying to add new products, while the Gutenberg editor is activated for products, I have similar issues, as posted in this thread.

    Best regards
    Julian

    Thread Starter Cristina Mantione

    (@paroleinlinea)

    Hi Julian,
    I’m sorry that you also have the same problem, but did WooCommerce support reply to you?
    I hope they’ll fix the problem soon…

    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there @paroleinlinea

    Thanks for reaching out!

    I understand you get an error message when using Block editor on existing products.

    The content of your post doesn’t match the template assigned to your post type.

    It appears that a workaround snippet is available for this issue as mentioned in this thread.

    Could you try that out?

    Thread Starter Cristina Mantione

    (@paroleinlinea)

    Hi @kaushiksomaiya

    Thank you for the link.
    As advised in it, I added this code to the function.php file:

    function reset_product_template( $post_type_args ) {
    	if ( array_key_exists( 'template', $post_type_args ) ) {
    		unset( $post_type_args['template'] );
    	}
    
    	return $post_type_args;
    }
    add_filter( 'woocommerce_register_post_type_product', 'reset_product_template' );

    At the moment it seems it fixed the problem!
    Thank you!
    I’ll test the single products for a couple of days to check if everything works.
    Best,
    Cristina ??

    Hi @paroleinlinea

    You are most welcome and we’re glad that worked! ??

    I will be marking this thread as resolved. Should you have further inquiries, kindly create a new topic here.

    Meanwhile, if you have a moment to spare, we would love it if you could share your thoughts with us by leaving a review or feedback. Your experience and feedback are important to help us improve and ensure we’re always providing the best possible support.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Product editing problems with template’ is closed to new replies.