Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
703 views
in Technique[技术] by (71.8m points)

wordpress - Database changes for products in woocommerce 3

Woocommerce v2.6 stores the following meta_key values in the wp_postmeta table:

_sku

_price

_regular_price

_sale_price

_manage_stock

_stock_status

_featured

Does Woocommerce v3.x, still store are all of the above in an identical manner as v2.6 or have any of the above been relocated to another table and/or modified in any way?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In WooCommerce 3+ everything listed is the same, except for _featured that doesn't work any more.


The "feature" product functionality in WooCommerce 3+:

Since version 3, WooCommerce generates a featured term (name and slug) located in wp_terms table, which custom taxonomy is product_visibility in wp_term_taxonomy table.

The wp_term_relationships table make the link between:

  • the "featured" products IDs through the object_id key
  • the ID for product_visibility taxonomy through term_taxonomy_id key

The wp_term_taxonomy table make the link with the term featured through its term_id key.

It works jut like a post term.


Update: regarding other changes not listed in your question.

The product_visibility taxonomy also handle those terms (functionalities):

  • exclude-from-search (product visibility option)
  • exclude-from-catalog (product visibility option)
  • outofstock (stock status)
  • rated-1 to rated-5 (product rating)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...