nakuable
Forum Replies Created
-
Dear Dima,
My issue is that when you put any filter, in first “ul.products” you can lsee the 3 parents categories (Equipos móviles industriales, Informática industrial and IoT M2M & telecomunicaciones) It’s not correct work because before woocomerce update, in this “ul.products” the parents category not show (for example in this url: https://anatronic.com/categoria-producto/informatica-industrial/?filters=pantalla%5B432%5D )
I could see this issue in another plugin (Woocommerce ShortCodes Products By Categories), this issue is that the plugin use woocommerce_product_loop_start and woocommerce_product_loop_end to show the products, and with the new functions can’t work ok.
Please See the changes:
=== NEW ===
function woocommerce_product_loop_start( $echo = true ) {
ob_start();
wc_set_loop_prop( ‘loop’, 0 );
wc_get_template( ‘loop/loop-start.php’ );
$loop_start = apply_filters( ‘woocommerce_product_loop_start’, ob_get_clean() );
if ( $echo ) {
echo $loop_start; // WPCS: XSS ok.
} else {
return $loop_start;
}
}function woocommerce_product_loop_end( $echo = true ) {
ob_start();
wc_get_template( ‘loop/loop-end.php’ );
$loop_end = apply_filters( ‘woocommerce_product_loop_end’, ob_get_clean() );
if ( $echo ) {
echo $loop_end; // WPCS: XSS ok.
} else {
return $loop_end;
}
}=== OLD ===
function woocommerce_product_loop_start( $echo = true ) {
ob_start();
$GLOBALS[‘woocommerce_loop’][‘loop’] = 0;
wc_get_template( ‘loop/loop-start.php’ );
if ( $echo ) {
echo ob_get_clean(); // WPCS: XSS ok.
} else {
return ob_get_clean();
}
}function woocommerce_product_loop_end( $echo = true ) {
ob_start();
wc_get_template( ‘loop/loop-end.php’ );
if ( $echo ) {
echo ob_get_clean(); // WPCS: XSS ok.
} else {
return ob_get_clean();
}
}===
If you use woocommerce_product_loop_start and woocommerce_product_loop_end, please add a option to use the oldest function and then your plugin work OK to me and the rest of people with same error.
Thank you very much.
Dear Dima,
Please, can you help us with it?
Thank you very much for your support.
Best regards.
Dear Dima, I reply you in bold below:
Your theme is using ul.products 2 times. It is not common and updating is first one only.
Yes, I know it. It’s because we need show the most recent productsFilters are added to the first query only where your categories are shown and not to the second one. So when you apply the filters second box(with products) are not changing in any way.
Filters are added to the first box => It’s OK for me. The second box allways show the recent products.Check this out – https://anatronic.com/categoria-producto/equipos-moviles-industriales/?filters=pantalla-tactil%5B442%5D|usb[361]|rj-45[290]|cpu[358]
No categories at the top. They are filtered out while products are not touched.No categories at the top => I can see it when I apply the 3 filter.
Output the top part(with categories) in a common way, without using woocommerce and everything will be working ok.
It isn’t possible because We need use Woocommerce.
Thank you very much.
Best regard
Hello Dima,
Now I use a child theme of Firmness. But I don’t know how do fix the issues.
In other topic, I see that now in parent category, the filters don’t show products, but before yes. It’s the correct work?
For your reference, you can enter in the url below:
https://anatronic.com/categoria-producto/equipos-moviles-industriales/Thank you very much for your support.
Hello Dima,
I tried using jQuery and the result is KO.
But, when I use PHP the result is OK.
Thank you very much for your support.
Best regards,
NakuableYeah, I can see it on my corporative site, with this plugin and another. And the issue is in woocommerce_product_loop_start and woocommerce_product_loop_end.
My solution in the another plugin is easy, I change these new functions for the oldest functions.
And the “new functions” in my plugin (the plugin is updated and don’t have support.) are:
function woocommerce_product_loop_start_v2( $echo = true ) {
ob_start();
$GLOBALS[‘woocommerce_loop’][‘loop’] = 0;
wc_get_template( ‘loop/loop-start.php’ );
if ( $echo ) {
echo ob_get_clean(); // WPCS: XSS ok.
} else {
return ob_get_clean();
}
}function woocommerce_product_loop_end_v2( $echo = true ) {
ob_start();
wc_get_template( ‘loop/loop-end.php’ );
if ( $echo ) {
echo ob_get_clean(); // WPCS: XSS ok.
} else {
return ob_get_clean();
}
}But for this case is better wait for update.
Thank you very much,