Answer the question
In order to leave comments, you need to log in
How to access attributes as meta fields?
In Woocommerce, product attributes are taxonomies and. But in the meta fields, they are serialized in the _product_attributes field.
As an example:
[_product_attributes] => Array
(
[0] => a:10:{s:18:"pa_gabarity-v-sh-g";a:6:{s:4:"name";s:18:"pa_gabarity-v-sh-g";s:5:"value";s:0:"";s:8:"position";i:1;s:10:"is_visible";i:1;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:1;}s:10:"pa_ottenok";a:6:{s:4:"name";s:10:"pa_ottenok";s:5:"value";s:0:"";s:8:"position";i:2;s:10:"is_visible";i:1;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:1;}}}
)
$args['meta_query'][] = array(
'relation' => 'AND',
array(
'key' => '_product_attributes',
'value' => как то их тут ищем,
'type' => 'numeric',
'compare' => 'BETWEEN'
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question