Home › Forums › WoodMart support forum › Extra description is not showing in category
Extra description is not showing in category
- This topic has 10 replies, 2 voices, and was last updated 1 year, 7 months ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
June 16, 2023 at 1:09 pm #475415
mephistosibiuParticipantSo i have a problem with the extra description. It doesnt show any information in the category page.
Attachments:
You must be logged in to view attached files.June 17, 2023 at 10:22 am #475571
mephistosibiuParticipantI activated this snippet to show an extra description :
/**
* @snippet Add new textarea to Product Category Pages – WooCommerce
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 5
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/// —————
// 1. Display field on “Add new product category” admin pageadd_action( ‘product_cat_add_form_fields’, ‘bbloomer_wp_editor_add’, 10, 2 );
function bbloomer_wp_editor_add() {
?>
<div class=”form-field”>
<label for=”seconddesc”><?php echo __( ‘Second Description’, ‘woocommerce’ ); ?></label><?php
$settings = array(
‘textarea_name’ => ‘seconddesc’,
‘quicktags’ => array( ‘buttons’ => ’em,strong,link’ ),
‘tinymce’ => array(
‘theme_advanced_buttons1’ => ‘bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator’,
‘theme_advanced_buttons2’ => ”,
),
‘editor_css’ => ‘<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>’,
);wp_editor( ”, ‘seconddesc’, $settings );
?><p class=”description”><?php echo __( ‘This is the description that goes BELOW products on the category page’, ‘woocommerce’ ); ?></p>
</div>
<?php
}// —————
// 2. Display field on “Edit product category” admin pageadd_action( ‘product_cat_edit_form_fields’, ‘bbloomer_wp_editor_edit’, 10, 2 );
function bbloomer_wp_editor_edit( $term ) {
$second_desc = htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) );
?>
<tr class=”form-field”>
<th scope=”row” valign=”top”><label for=”second-desc”><?php echo __( ‘Second Description’, ‘woocommerce’ ); ?></label></th>
<td>
<?php$settings = array(
‘textarea_name’ => ‘seconddesc’,
‘quicktags’ => array( ‘buttons’ => ’em,strong,link’ ),
‘tinymce’ => array(
‘theme_advanced_buttons1’ => ‘bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator’,
‘theme_advanced_buttons2’ => ”,
),
‘editor_css’ => ‘<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>’,
);wp_editor( $second_desc, ‘seconddesc’, $settings );
?><p class=”description”><?php echo __( ‘This is the description that goes BELOW products on the category page’, ‘woocommerce’ ); ?></p>
</td>
</tr>
<?php
}// —————
// 3. Save field @ admin pageadd_action( ‘edit_term’, ‘bbloomer_save_wp_editor’, 10, 3 );
add_action( ‘created_term’, ‘bbloomer_save_wp_editor’, 10, 3 );function bbloomer_save_wp_editor( $term_id, $tt_id = ”, $taxonomy = ” ) {
if ( isset( $_POST[‘seconddesc’] ) && ‘product_cat’ === $taxonomy ) {
update_woocommerce_term_meta( $term_id, ‘seconddesc’, esc_attr( $_POST[‘seconddesc’] ) );
}
}// —————
// 4. Display field under products @ Product Category pagesadd_action( ‘woocommerce_after_shop_loop’, ‘bbloomer_display_wp_editor_content’, 15 );
function bbloomer_display_wp_editor_content() {
if ( is_product_taxonomy() ) {
$term = get_queried_object();
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$page = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1;
//echo $paged . $page;
if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) && ($paged < 2) ) {
echo ‘<p class=”term-description”>’ . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) . ‘</p>’;
}
}
}June 17, 2023 at 12:07 pm #475579
Aizaz Imtiaz AwanKeymasterHello,
I have visited your site the category description is showing fine:
Screenshot for clarification:
https://ibb.co/ZxY0gs0Check back your site after completely clearing the browser cache.
Best Regards.
June 17, 2023 at 12:09 pm #475586
mephistosibiuParticipantThe description is showing fine because i added the above snippet!
I will deactivate it so you can see that your extra description is not working!June 17, 2023 at 12:12 pm #475587
mephistosibiuParticipantThis is how it looks now without snippet !
Attachments:
You must be logged in to view attached files.June 17, 2023 at 4:45 pm #475631
Aizaz Imtiaz AwanKeymasterHello,
Please share the wp logins details of your site i will check and give you a possible solution.
Best Regards.
June 17, 2023 at 5:17 pm #475651
mephistosibiuParticipantyou can check now
June 19, 2023 at 10:42 am #475800
Aizaz Imtiaz AwanKeymasterHello,
There is an issue with the 3rd party plugins. Please deactivate all the 3rd party plugins and activate only theme-required plugins on the site and then check the issue. I am sure your issue will be solved. Then Activate the 3rd party plugins one by one and check which plugin is creating the issue for you.
Otherwise, if the issue still exists then keep the 3rd party plugins deactivated and let me know so I will check and give you a possible solution.
Best Regards.
June 19, 2023 at 11:08 am #475812
mephistosibiuParticipantI tried and it didnt work. I will give you access to the staging with 3rd party plugin deactivated
June 19, 2023 at 11:24 am #475818
mephistosibiuParticipantIf i deactivate this layout: product archive layout Shop, as in the attachment, the description is showing as it has to be
Attachments:
You must be logged in to view attached files.June 19, 2023 at 3:26 pm #475890
Aizaz Imtiaz AwanKeymasterHello,
Ok, then you have to use the Category Extra Description widget in the layout which you have created and used for the product archive pages, then it will show the Category Extra Description under the category pages: https://ibb.co/MVJzw0C
I have set it on your staging site. Link in the private content.
Best Regards.
Best Regards.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register