• Resolved titsmaker

    (@titsmaker)


    Hi, I have rather big catalog where many products are missing description. I don’t have time to write all the descriptions now, so I want to generate Facebook product feed now and write descriptions later. I tried modifying the code you provided on support forum to populate empty description fields with product titles, but to no avail. Here is my code:

    add_filter( 'my_code_fix_missing_description', function( $description, PixelCaffeine\ProductCatalog\FeedMapper $item ) {
    	$post = get_post( $item->get_id() );
    	if ( empty( $post->post_content ) ) {
    		$description = $post->post_title;
    	}
    	return $description;
    }, 10, 2 );

    I will be very grateful if you help me to fix this code. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Populate description with product title’ is closed to new replies.