Home › Forums › Basel support forum › Show product variation in product meta (for variable product) in CATALOG MODE
Show product variation in product meta (for variable product) in CATALOG MODE
- This topic has 3 replies, 2 voices, and was last updated 6 years, 7 months ago by Artem Temos.
-
AuthorPosts
-
April 26, 2018 at 8:14 am #54735
vinirossiParticipantHello 🙂
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.April 26, 2018 at 9:15 am #54746
Artem TemosKeymasterHello,
Sorry, but this task requires additional code customization of the WooCommerce plugin. Such kind of requests are out of our theme support scope.
Variations are not displayed when you enable a catalog mode. You can disable this option and hide add to cart button with CSS to display variations only.
Regards
April 26, 2018 at 9:35 am #54752
vinirossiParticipantIt was worth a try.
But honestly: that catalog mode is useless if it does not show product variations. Have you ever seen a catalog without product variations? This is definitely a feature request. Especially for small/middle size web shops it is a long run to open a full shop in respect to all legal conditions. That is why a useful catalog mode is necessary!!!!Will do it with CSS now. Thanks for your reply though.
April 26, 2018 at 11:12 am #54767
Artem TemosKeymasterThe problem is that variations form and add to cart button are part of the same hook in WooCommerce. It is not possible to disable the add to cart button only.
-
AuthorPosts
Tagged: catalog mode, product variants
- You must be logged in to create new topics. Login / Register