- This topic has 4 replies, 2 voices, and was last updated 4 years, 8 months ago by David.
-
AuthorPosts
-
August 24, 2019 at 3:25 am #992114Michael
I have just purchased the GP Premium and have an issue with category views of products.
The Category view is stripping formatting (<p></p> & <br>) from Woocommerce “Short Product Descriptions”. The formatting shows correctly on the individual product page (pics below).
I am using TinyMCE and have selected the ” Keep paragraph tags in the Classic block and the Classic Editor” option.
When trouble shooting I deactivated all plugins expect Woocommerce and got the same results.
Category view:
Product view:
The site I am working on is a staging site so I am unable to send a direct link.
here is the code:
<p>Ludger EB10 cartidges have been designed for purification of glycans from proteins, salts, and detergents.</p><p>Applications include cleanup of glycans following hydrazinolysis, endoglycosidase digests (including PNGase F digests), enzyme treatment, and before and after fluorescent labeling.</p>
<p>View product documentation as PDF<br>
View Certificate of Analysis as PDF</p>
<p>contains 6 cartridges</p>
<p>Part Number: LC-EB10-A6</p>thank you in advance for any assistance you can offer.
August 24, 2019 at 5:21 am #992186DavidStaffCustomer SupportHi there,
The default Woo template doesn’t display HTML in the archive summary. You can try this PHP snippet to hook in an excerpt that should display the HTML:
add_action( 'woocommerce_after_shop_loop_item_title', 'db_shop_html_summary', 20); function db_shop_html_summary() { global $post; $desc = '<div class="category-desc">' .apply_filters( 'woocommerce_short_description', $post->post_excerpt ). '</div>'; echo $desc; global $product; echo $product->list_attributes(); }
August 24, 2019 at 6:41 am #992229MichaelI added the recommended code to my child theme’s functions.php but still have same results.
This should go in my child themes functions.php with no modifications, correct?
I have taken the site live…here is an example:
https://www.qa-bio.com/product-category/endoglycosidases/August 24, 2019 at 8:11 am #992373MichaelI was able to fix it with the following added to child theme functions.php:
//allows html in short product descriptions to show on category page
function dhvc_woo_excerpt_custom($output,$post){
return do_shortcode($post->post_excerpt);
}
add_filter(‘dhvc-woo-excerpt’, ‘dhvc_woo_excerpt_custom’,10,2);August 24, 2019 at 3:12 pm #992557DavidStaffCustomer SupportGlad you found a solution
-
AuthorPosts
- You must be logged in to reply to this topic.