There is no term like _cost
in woocommerce.
There are 3 terms that WooCommerce use to store data in database:
1) _regular_price
: As the name suggests, It is for the regular price of the product.
2) _sale_price
: As the name suggests, It is for the sale price if the product is on sale and if product is not on sale then it will use _regular_price
.
3) _price
: Product is going to be sell based on _price
. So suppose you have on product which is having _regular_price
22 $ and _sale_price
18 $ then product is going to sell at 18 $. So basically you can say _price
is decide by the regular_price
and _sale_price
both.
So there is not _cost
term as per my knowledge and experience.
Yes you can target particular category but you need to dig in to database.
First step : Go to your database and find wp_terms
table(wp
is prefix and it might be different in your case).
Step 2 : Find term_id
of your category.
All the category assigned to the product in wp_term_relationships
.
So you can write your query and put condition like id(wp_post table) = object_id(wp_term_relationships table)
.
NOTE: Object ID and Post ID both are same in your database.