Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #4040443
Is it possible to show of the variable products their alternate title?
Open

Comments

  •  1
    Sander Spaas started the conversation
    In WPC Variation Swatches it is possible to include a Custom name that then shows up when selecting the product. 
    3399017472.png
    Is it possible to make this title show up in the WPC Composite Products list as well? 3134133914.pngRight now we are just getting the title from the main variable product and not the subtitles themselves.
  •  1,478
    Dustin replied

    Hi Sander,

    In some cases, WooCommerce doesn’t show the attributes in the product name:

    9272219757.png

    To fix it, please add the custom code below. (How to add custom code? ↗):

    add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_true', 99 );

    If you want to use the custom name from WPC Variation Swatches if it was set, please add the custom code below. (How to add custom code? ↗):

    add_filter( 'wooco_product_name', function ( $name, $product ) {
    	if ( is_a( $product, 'WC_Product_Variation' ) && ( $custom_name = get_post_meta( $product->get_id(), 'wpcvs_name', true ) ) ) {
    		return $custom_name;
    	}
    
    	return $name;
    }, 99, 2 );

    Best regards,
    Dustin

  •  1
    Sander Spaas replied

    Hey Dustin,
    Thank you so much for your reply.
    Your solution works perfectly!

    Have a great week,

    Sander


    2950720471.png