这是基于wordpress和woocommerce以及处理post和post\元表
我必须得到所有的产品id,它有一个meta\u key=“\u shop”和meta\u value=“yes”
典型情况:
如果元键和元值与父产品匹配,那么它的所有变化也必须包括在内。
如果meta键和meta值没有与父级进行匹配,但其变体有meta键和meta值匹配,则只返回变体。
Product(#18)(simple): _shop = 'yes'
Product(#19)(variable): _shop = 'yes' (Parent is Yes)
Product(#20)(variation): _shop = 'yes'
Product(#21)(variation): _shop = 'no'
Product(#22)(variation): _shop = 'no'
Product(#23)(simple): _shop = 'yes'
Product(#24)(variable): _shop = 'no' (parent is no)
Product(#25)(variation): _shop = 'no'
Product(#26)(variation): _shop = 'yes' (Only this variation)
Product(#20)(variation): _shop = 'no'
我需要的ID:
2条答案
按热度按时间hfyxw5xn1#
dfty9e192#