Hello 🙂
For our wine page I must use the catalog mode. Unfortunately, product variations are getting disabled/hidden when Catalog mode is on (see other topic ). The problem is: Our Wine has to be shown with its year, which is a product variation. I really need the help of one of your woocommerce experts for doing the following:
For the usage of catalog mode – I want to show the label/slug of the product variation(s) within the product_meta blog (where product number and product category are allready shown). Please see screenshots.
For this I want to use the following code which I found on a blog post:
$args = array(
'post_type' => 'product_variation',
'post_status' => array( 'private', 'publish' ),
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'asc',
'post_parent' => get_the_ID() // get parent post-ID
);
$variations = get_posts( $args );
foreach ( $variations as $variation ) {
// get variation ID
$variation_ID = $variation->ID;
// get variations meta
$product_variation = new WC_Product_Variation( $variation_ID );
// Where to add the $product_variation in product page ????
}
I would be very very happy if you could provide a filter/hook action for my child-theme…
Thanks
Attachments:
You must be
logged in to view attached files.