Lorangeo
Forum Replies Created
-
Hi,
Thank you for the answer. I solved my issue editing my theme.
Keep the good work!
Forum: Plugins
In reply to: [Schema & Structured Data for WP & AMP] LearningResource schema Type support?Hi, thank you for the update! I’ve just installed it and it works perfectly!
Would it be possible to add the following property, which is very important?
"educationalAlignment": {
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Mathematics" (<-- just an example)
}It might be interesting to also add the two following properties:
- audience (ex: learners, teachers, school directors…)
- author (very important for user rights) (! not necessarily the same as the post author who is only describing the resource)
Hi, that’s great to hear! I will wait for the update! Thank you very much!
Hi!
Thank you taking the time to answer my question!
Interestingly it works for the filters options (on the side), but not for the active filters (that show on the top).
I edited both the
wcapf_rename_product_types_in_filter_options
andwcapf_rename_product_types_in_active_filters
to add the new names. But it only works for the filter options.However: Don’t you think you should verify and maybe change how your plugin is displaying these “product type” terms? Because (sorry if I’m wrong), it looks like the plugin displays the raw slug version of the product types (“simple”, “external”…) instead of their display name (“Simple, “External”) for this particular filter (product type). Because for the other filters, it shows the correct name (and not the slug).
Please, is there any solution for this? I really need to fix it.
- This reply was modified 5 months, 2 weeks ago by Lorangeo.
Hi!
After some troubleshooting, I decided to adjust the display settings in the Customizer. I set the “Shop page display” and “Category display” to “Show products” only. With these settings and my original code, the categories were no longer appearing either before or inside the shop loop.
But I made these modifications to the code:
add_action( 'woocommerce_before_shop_loop', 'cg_show_product_categories', 10 ); function cg_show_product_categories() { // Check if we're on a category page if ( is_product_category() ) { // Output subcategories for the current category woocommerce_output_product_categories( array( 'parent_id' => get_queried_object_id(), 'before' => '<ul class="products subcategories">', 'after' => '</ul>', ) ); } else { // Output root categories for the shop page woocommerce_output_product_categories( array( 'before' => '<ul class="products subcategories">', 'after' => '</ul>', ) ); } }
It now works as expected. With these changes, the categories (or subcategories) are displayed correctly – before the shop loop only!
I will mark the topic as resolved. Thank you for the help!
Hi!
Thank you so much for taking the time to look at this. I don’t know why, but with my Astra theme the product categories were appearing twice (before and inside the shop loop), despite deactivating all other plugins and custom code snippets.
After some troubleshooting, I decided to adjust the display settings in the Customizer. I set the “Shop page display” to “Show products” only and the “Category display” to “Show products” only. With this approach and my original code, the categories were no longer appearing either before or inside the shop loop.
Next, I made some modifications to the code as follows:
add_action( 'woocommerce_before_shop_loop', 'cg_show_product_categories', 10 ); function cg_show_product_categories() { // Check if we're on a category page if ( is_product_category() ) { // Output subcategories for the current category woocommerce_output_product_categories( array( 'parent_id' => get_queried_object_id(), 'before' => '<ul class="products subcategories">', 'after' => '</ul>', ) ); } else { // Output root categories for the shop page woocommerce_output_product_categories( array( 'before' => '<ul class="products subcategories">', 'after' => '</ul>', ) ); } }
And voilà! It works now as expected. With these changes, the categories (or subcategories) are displayed correctly – before the shop loop only!
I will mark this topic as resolved. Thank you very much for the help!
Hello again!
As suggested by the Astra team, I tried to temporarily test this with the default WooCommerce theme (Front Store), and it does exactly the same! It shows the categories twice! First,?before the shop loop?(just above the ‘Sort Products’ dropdown), and a second time?alongside the products (their original place).
So it’s definitely not an Astra issue.
The code
remove_filter( 'woocommerce_product_loop_start', 'woocommerce_maybe_show_product_subcategories' );
doesn’t seem to work as expected.
As I already said, I think it would be much more logical to show the categories before the shop loop (above the ‘Sort Products’ dropdown), instead of showing them alongside the products. It really makes things much more clear (just try it on your own shop!). So it would be great if someone could help make the above code work as expected. ??
Hi,
Thank you for asking! I tried to activate the Storefront and it does exactly the same. It shows the categories twice! First, before the shop loop (just above the ‘Sort Products’ dropdown), and a second time in their original place alongside the products.
So it’s definitely not an Astra issue. The code
remove_filter( 'woocommerce_product_loop_start', 'woocommerce_maybe_show_product_subcategories' );
doesn’t seem to work as expected.
As I already said, I think it would be much more logical to show the categories before the shop loop (above the ‘Sort Products’ dropdown), instead of showing them alongside the products. It really makes things much more clear (just try it on your own shop!). So it would be great if someone could help make the above code work as expected.
Yes, with the code that I pasted above the categories show twice (with the woocommerce settings set to “show categories and products”), or do not show anymore (with the woocommerce settings set to “Products (only)”).
You can see it here: https://hepicerie.com/_hepwordpress/ressources (development site)
Hi Omar,
Thank you very much for taking the time to answer. I already tried this. But when I select this option (“Show products” (only)), the categories do not show anymore, neither before the shop loop, nor in their original place (inside the shop loop). ??
Forum: Plugins
In reply to: [WooCommerce] Product collection Block: remove h3 heading for product nameWow! I did not test the first option, but the second one did the trick! Thank you very much!
It would be great if the developers could add this as an option to the block.
Forum: Plugins
In reply to: [WooCommerce] Product collection Block: remove h3 heading for product nameIt’s a project in development. I have no URL. But it’s an official WooCommerce block whose name is “Product Collection (beta)”.
https://developer.woocommerce.com/2024/02/22/announcing-the-product-collection-block/
It can be found in the Gutemberg block editor (“Product Collection”).
Forum: Plugins
In reply to: [WooCommerce] Show author name + date of publication on Product pageThanks to both of you for your help! Yes, the code above solved my issue ??
The following did the trick (showing author with link and date):
add_action( 'woocommerce_single_product_summary', 'show_product_author_and_date', 25 ); function show_product_author_and_date() { global $post; $author_id = $post->post_author; $author_name = get_the_author_meta( 'display_name', $author_id ); $author_link = get_author_posts_url( $author_id ); $publication_date = get_post_time( 'F j, Y', false, $post, true ); echo '<p class="product-author">Author: <a href="' . esc_url( $author_link ) . '">' . esc_html( $author_name ) . '</a></p>'; echo '<p class="product-date">Publication Date: ' . esc_html( $publication_date ) . '</p>'; }