• Resolved plenet10

    (@plenet10)


    Hello,

    I used the following code to enable the Gutenberg

    // enable gutenberg for woocommerce
    function activate_gutenberg_product( $can_edit, $post_type ) {
    	if ( $post_type == 'product' ) {
    		   $can_edit = true;
    	   }
    	   return $can_edit;
       }
       add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 );
       
       // enable taxonomy fields for woocommerce with gutenberg on
       function enable_taxonomy_rest( $args ) {
    	   $args['show_in_rest'] = true;
    	   return $args;
       }
       add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
       add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );

    Is it possible to add WooCommerce Blocks to the products, I tried it on a test website where it did not work, it could be a problem with the code above or with WooCommerce Blocks. (I would like to get the list of all products working)

    Thanks in advance,

    Auke Hendriks

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter plenet10

    (@plenet10)

    Well this complicates the matter, I can get another error on one live server, and it works on the other, same hosting company, same plugins and theme…

    Is there a way I can assist in debugging this issue further?

    The First live server gets me a “the JSON reaction is invalid” error.
    The second one works fine!

    So on one hand i learned that there is a bug in Bitnami’s implementation or my one. And these issues are quite hard to figure out.

    Thread Starter plenet10

    (@plenet10)

    These are the errors im getting even on a normal page:

    Failed to load resource: the server responded with a status of 503 ()
    /wp-json/wp/v2/templates?_locale=user:1          Failed to load resource: the server responded with a status of 503 ()
    /wp-json/wp/v2/themes?context=edit&status=active&_locale=user:1          Failed to load resource: the server responded with a status of 500 ()
    core-data.min.js?ver=b4684a7c90f2d858ab7fa74414ad5a54:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading '0')
        at core-data.min.js:2:38738
        at async Q (data.min.js:2:16617)
        at async data.min.js:2:15497
    (anonymous) @ core-data.min.js?ver=b4684a7c90f2d858ab7fa74414ad5a54:2
    /wp-json/?_locale=user:1          Failed to load resource: the server responded with a status of 503 ()
    /wp-json/wp/v2/users/me?_locale=user:1          Failed to load resource: the server responded with a status of 503 ()
    data.min.js?ver=c5f9378263e5eea9d870764c8fc1dd1b:2 Uncaught (in promise) Objectcode: "invalid_json"message: "De reactie is geen geldige JSON-reactie."Prototype: Object
    (anonymous) @ data.min.js?ver=c5f9378263e5eea9d870764c8fc1dd1b:2
    Plugin Support 3 Sons Development – a11n

    (@3sonsdevelopment)

    I don’t often see 503 errors. Those are typically for temporary errors with the server.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503

    You could try enabling wp_debug and see if the debug.log file is created. It may hold some helpful error messages about the server-side of this problem.

    https://codex.wordpress.org/WP_DEBUG

    If that doesn’t show anything helpful, then I think Bitnami would be the best people to help you find out what’s wrong.

    Thread Starter plenet10

    (@plenet10)

    So the 503 errors come from a live server, I shall enable the debugging flag in WordPress and search the logs for information. I will put my findings in another comment.

    Thread Starter plenet10

    (@plenet10)

    I found the issue It had something to do with the price tag not being set correctly, I reinstalled, WooCommerce and WooCommerce blocks and the problem went away. What I find baffling is the fact that on my local test server it doesn’t work.

    Many thanks with your wonderful help, now I need to figure out the problem with the price tag, but as far as I know it doesn’t have to do with WooCommerce Block!

    Plugin Support 3 Sons Development – a11n

    (@3sonsdevelopment)

    Nice detective work! We’re always happy to help out. If you do need anything just let us know 🙂

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Using Blocks inside Product Pages’ is closed to new replies.