• Resolved dariotoby

    (@dariotoby)


    I congratulate the excellent plug in, I wanted to ask if there was the possibility of being able to show both the product categories and custom fields in the details panel

Viewing 1 replies (of 1 total)
  • Plugin Author Damian Góra

    (@damian-gora)

    Hi,
    Thank you!

    There is the possibility to show extra things in the details panel. Unfortunately, it still requires some programming skills. I’ll try to explain how to do it. The snippet below isn’t copy/pase solution. It’s only an open proposition how you can do it yourself.

    
    add_filter( 'dgwt/wcas/suggestion_details/product/html', function ( $html, $product_id ) {
    
    	/* 
    	
    	Step 1 - Get your product categories (base on $product_id)
    	
    	Step 2 - Get values of the custom field you want to display (base on $product_id)
    	
    	Step 3 - Add new data wherever you want in a details panel. Remember we have raw HTML, so you have to use e.g. preg_replace() to inject your HTML inside.
    	$html = preg_replace('your-hook-in-html', 'your-hook-in-html' . 'your-new-data', $html);
    	
       */
    
    	return $html;
    }, 10, 2 );
    

    To apply your custom code you can open the functions.php in your Child Theme and add the code at the end or install the Code Snippets plugin and apply this code as a snippet.

Viewing 1 replies (of 1 total)
  • The topic ‘show in details panel this fields?’ is closed to new replies.