_product_attributes
для всех ID.is_variation
.SELECT DISTINCT tr.name
FROM wp_term_relationships ttr
INNER JOIN wp_term_taxonomy AS ttx ON ttx.term_taxonomy_id = ttr.term_taxonomy_id
INNER JOIN wp_terms AS tr ON tr.term_id = ttx.term_id
WHERE ttx.taxonomy IN ('pa_razmer-obuvi-eur') AND ttr.object_id IN (19728)
WP_Query
. У него есть хук posts_clauses_request
в котором можно подправить соответствующую часть запроса.wp_get_object_terms
и выводите ссылкуdo_shortcode
.wpm-config.json
{
"taxonomies": {
"pa_razmeryi-noskov": {},
"pa_razmer-shapok": {}
}
}
if ( 'name_list' == $orderby_value ) {
$args['orderby'] = 'meta_value_num name';
$args['order'] = 'ASC'; // (или 'DESC';)
$args['meta_key'] = '_price';
}
$qorder = wc_create_order();
if ( 0 === $params['type'] ) { /* simple */
$product = wc_get_product( $params['id'] );
$item_id = $qorder->add_product( $product, $params['qty'] );
} elseif ( 1 === $params['type'] ) { /* variable */
$variations_array = array();
$var_product = new WC_Product_Variation( $params['var_id'] );
$variations_array['variation'] = array(
$params['attr_name'] => $params['attr_value'],
);
$item_id = $qorder->add_product( $var_product, $params['qty'], $variations_array );
}
$qorder->set_address( $address, 'billing' );
$qorder->set_address( $address, 'shipping' );
$qorder->calculate_totals();
wc_reduce_stock_levels( $qorder->get_id() );
$qorder->update_status( 'processing' );
echo 'Спасибо за заказ';