Ajaxify my theme
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from artware on November 13, 2023, 11:24Hello, I created my own wordpress theme and the Ajaxify is not working (the selected filters do, but the products are not being updated).
Is there something I should add (like class names, actions, etc.) to my theme in order to make it Husky-ready?
Hello, I created my own wordpress theme and the Ajaxify is not working (the selected filters do, but the products are not being updated).
Is there something I should add (like class names, actions, etc.) to my theme in order to make it Husky-ready?
Quote from Pablo Borysenco on November 13, 2023, 12:05Hello
Please add hooks - woocommerce_before_shop_loop and woocommerce_after_shop_loop
Hello
Please add hooks - woocommerce_before_shop_loop and woocommerce_after_shop_loop
Quote from artware on November 13, 2023, 12:46<?php if ( woocommerce_product_loop() ) { ?> <div id="main-content"> <?php do_action( 'woocommerce_before_shop_loop' ); woocommerce_product_loop_start(); if ( wc_get_loop_prop( 'total' ) ) { while ( have_posts() ) { the_post(); do_action( 'woocommerce_shop_loop' ); ?> <div class="wc-product x-3 m-4 s-6 z-12" itemscope itemtype="http://schema.org/Product"> <?php wc_get_template_part( 'content', 'product' ); ?> </div> <?php } } woocommerce_product_loop_end(); do_action( 'woocommerce_after_shop_loop' ); ?> </div> <?php } else { do_action( 'woocommerce_no_products_found' ); } ?> The above is inside the archive-product.php As you can see the hooks you mentioned already exist. The file archive-product.php is inside my theme/woocommerce folder to override the original one. But even if I remove this file and use the original WooCommerce, the Ajax still doesn't work. Is there something else that Husky needs to work with Ajax?
<?php if ( woocommerce_product_loop() ) { ?>
<div id="main-content">
<?php
do_action( 'woocommerce_before_shop_loop' );
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
do_action( 'woocommerce_shop_loop' ); ?>
<div class="wc-product x-3 m-4 s-6 z-12" itemscope itemtype="http://schema.org/Product">
<?php wc_get_template_part( 'content', 'product' ); ?>
</div>
<?php }
}
woocommerce_product_loop_end();
do_action( 'woocommerce_after_shop_loop' ); ?>
</div>
<?php
} else {
do_action( 'woocommerce_no_products_found' );
} ?>
The above is inside the archive-product.php
As you can see the hooks you mentioned already exist.
The file archive-product.php is inside my theme/woocommerce folder to override the original one. But even if I remove this file and use the original WooCommerce, the Ajax still doesn't work.
Is there something else that Husky needs to work with Ajax?Quote from Pablo Borysenco on November 13, 2023, 13:36Please drop me exact link to the issue
Please drop me exact link to the issue
Quote from artware on November 13, 2023, 13:39I already did in the private section. You cannot see it?
If you visit the link you will see that if you click an option, the products are not being updated via Ajax.
I already did in the private section. You cannot see it?
If you visit the link you will see that if you click an option, the products are not being updated via Ajax.
Quote from Pablo Borysenco on November 14, 2023, 12:36Hello
I checked everything is working correctly.
Perhaps you made a mistake with this setting - https://share.pluginus.net/image/i20231114123618.png - Please disable it
Hello
I checked everything is working correctly.
Perhaps you made a mistake with this setting - https://share.pluginus.net/image/i20231114123618.png - Please disable it
Quote from artware on November 14, 2023, 12:48OK that worked! Is there a way for me to add some html? This is what I mean: This is the original code of woocommerce (archive-product.php) if ( wc_get_loop_prop( 'total' ) ) { while ( have_posts() ) { the_post(); do_action( 'woocommerce_shop_loop' ); wc_get_template_part( 'content', 'product' ); } } I added one div element to wrap each product: if ( wc_get_loop_prop( 'total' ) ) { while ( have_posts() ) { the_post(); do_action( 'woocommerce_shop_loop' ); ?> <div class="wc-product x-3 m-4 s-6 z-12" itemscope itemtype="http://schema.org/Product"> <?php wc_get_template_part( 'content', 'product' ); ?> </div> <?php } } When the category page loads originally, this div element exists. But when I click on a filter this div element is being removed. For example I use this code to change the columns from 4 to 3: if (defined('WOOF_PATH')){ add_filter('loop_shop_columns',function(){ return 3; }); } Is there a similar hook I can use in order to add this HTML div while keeping the AJAX functionality of the filtering?
OK that worked!
Is there a way for me to add some html? This is what I mean:
This is the original code of woocommerce (archive-product.php)
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
}
}
I added one div element to wrap each product:
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
do_action( 'woocommerce_shop_loop' ); ?>
<div class="wc-product x-3 m-4 s-6 z-12" itemscope itemtype="http://schema.org/Product">
<?php wc_get_template_part( 'content', 'product' ); ?>
</div>
<?php }
}
When the category page loads originally, this div element exists. But when I click on a filter this div element is being removed.
For example I use this code to change the columns from 4 to 3:
if (defined('WOOF_PATH')){
add_filter('loop_shop_columns',function(){ return 3; });
}
Is there a similar hook I can use in order to add this HTML div while keeping the AJAX functionality of the filtering?Quote from artware on November 14, 2023, 13:06Nevermind, I found it.
I simply added the div element inside content-product.php instead of archive-product.php because of this: `wc_get_template_part( 'content', 'product' );`
Thanks for your help!
Nevermind, I found it.
I simply added the div element inside content-product.php instead of archive-product.php because of this: `wc_get_template_part( 'content', 'product' );`
Thanks for your help!
Quote from Pablo Borysenco on November 15, 2023, 13:06Hello
great! Welcome;)
Hello
great! Welcome;)