圖片[1]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C

昨天上傳新產品到 WooCommerce 網站的時候,發現添加產品描述的部分出現了一堆預設好的數據。其中的英文內容是:”Basic details – This info will be displayed on the product page, category pages, social media, and search results.“

圖片[2]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C

保存草稿之後刷新頁面會提示”The content of your post doesn’t match the template assigned to your post type.“ 選擇 Keep it as is, 則產品描述文本框徹底消失。選擇 Reset the template, 則回到了上圖所示頁面。

圖片[3]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C

谷歌了一下,在 WordPress 官方論壇找到一篇帖子,和我遇到的問題類似 – https://wordpress.org/support/topic/site-doesnt-include-support-for-the-woocommerce-product-tab-block/

問題產品的原因可能是 WooCommerce 系統版本最近升級,在產品描述文本框中添加了一些產品模塊”Product block“的功能,這一個新功能和通過修改代碼或者安裝插件使產品描述編輯器支持古騰堡編輯器 Gutenberg 的功能產品衝突,導致這個問題發生。

我禁用掉產品頁面古騰堡編輯器 Gutenberg 功能之後,產品描述編輯框可以正常使用了。不過,和古騰堡編輯器比起來,傳統編輯器在可視化操作,頁面排版佈局方面侷限性太大了。

我嘗試使用上面鏈接中 Cameron 提供的代碼解決問題,但是沒有成功。

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'' );
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'' );
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'' );

隨後聯繫了我在使用的 Shoptimizer 的主題作者 Simon,來回 5 封郵件,就解決了。

Simon 說會在接下來的主題更新中修復掉這個Bug。如果你也在使用 Shoptimizer 這個主題,可以直接聯繫 Simon 讓他幫你修改主題代碼;或者等他們的主題更新的發佈。



Hi Conway​,
I’ve spent some more time looking into this.
WooCommerce released an update earlier today – 7.7.0:
https://github.com/woocommerce/woocommerce/blob/trunk/changelog.txt
​Which seems to have added those new elements to the block editor on a product page.
​When reverting to the previous version of WooCommerce (7.6.1) – those new elements are gone – but that warning message you mentioned previously does appear.

​I’ve updated your site with a beta of the next theme release, which has hopefully solved all of these goings on.

​I’ve re-enabled the block editor on product pages and everything seems ok now.
​Would you mind taking a look yourself and let me know if this is resolved now.
Kind regards,
Simon

最後安利一波 Shoptimizer 這個 WooCommerce 主題。不僅僅主題功能強大,網站速度,轉化率等等各個方面的優化也做的非常到位;主題有特別詳細的設置教程,也有非常棒的客服支持。價格也可以接受,目前在促銷,原價99美金,現在半價 49美金。

圖片[4]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C
圖片[5]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C
圖片[6]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C
圖片[7]-WooCommerce 產品頁面無法添加產品描述的解決辦法 | 歪貓跨境 | WaimaoB2C-歪貓跨境 | WaimaoB2C