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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #54735

    vinirossi
    Participant

    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.
    #54746

    Artem Temos
    Keymaster

    Hello,

    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

    #54752

    vinirossi
    Participant

    It 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.

    #54767

    Artem Temos
    Keymaster

    The 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.

Viewing 4 posts - 1 through 4 (of 4 total)