WooCommerce: Finding the products in database

前端 未结 4 1034
小蘑菇
小蘑菇 2020-12-04 10:41

I\'m creating a website using WooCommerce and I want to restrict the available products to users depending on the postcode that they enter in the search form on my home page

4条回答
  •  感情败类
    2020-12-04 11:09

    I would recommend using WordPress custom fields to store eligible postcodes for each product. add_post_meta() and update_post_meta are what you're looking for. It's not recommended to alter the default WordPress table structure. All postmetas are inserted in wp_postmeta table. You can find the corresponding products within wp_posts table.

提交回复
热议问题