content is printed 3 times
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 mcdeth on March 28, 2024, 09:44Hi, by executing this function:
add_filter('woof_seo_do_index', function($do_index,$url,$request){
if ($do_index) {
add_action( 'woocommerce_before_main_content', function() {
$top_content='test';
echo $top_content;
} );
}
return $do_index;},10,3);
it prints always 3 times, for example: "testtesttest", how can I make it echo just as in the variable "test"?
Hi, by executing this function:
add_filter('woof_seo_do_index', function($do_index,$url,$request){
if ($do_index) {
add_action( 'woocommerce_before_main_content', function() {
$top_content='test';
echo $top_content;
} );
}
return $do_index;
},10,3);
it prints always 3 times, for example:"testtesttest", how can I make it echo just as in the variable"test"?
Quote from Pablo Borysenco on March 28, 2024, 12:00Hello
Yes, because you register this filter several times
You can try the trick for one execution. ( This is just an example without a test )
add_filter('woof_seo_do_index', function($do_index,$url,$request){
if ($do_index && !isset($_POST['i_did_it'])) {
add_action( 'woocommerce_before_main_content', function() {
$top_content='test';$_POST['i_did_it'] = true;
echo $top_content;
} );
}
return $do_index;},10,3);
Hello
Yes, because you register this filter several times
You can try the trick for one execution. ( This is just an example without a test )
add_filter('woof_seo_do_index', function($do_index,$url,$request){
if ($do_index && !isset($_POST['i_did_it'])) {
add_action( 'woocommerce_before_main_content', function() {
$top_content='test';
$_POST['i_did_it'] = true;
echo $top_content;
} );
}
return $do_index;
},10,3);
Quote from mcdeth on March 28, 2024, 15:48Hi, thanks. Unfortunately same result. Are there any other hooks?
Hi, thanks. Unfortunately same result. Are there any other hooks?
Quote from Pablo Borysenco on March 29, 2024, 12:06Hello
Please try this code:
add_filter('woof_seo_do_index', function($do_index,$url,$request){
if ($do_index ) {
add_action( 'woocommerce_before_main_content', function() {
$top_content='test';if (isset($_POST['i_did_it'])){
return false;
}
$_POST['i_did_it'] = true;
echo $top_content;
} );
}
return $do_index;},10,3);
Hello
Please try this code:
add_filter('woof_seo_do_index', function($do_index,$url,$request){
if ($do_index ) {
add_action( 'woocommerce_before_main_content', function() {
$top_content='test';
if (isset($_POST['i_did_it'])){
return false;
}
$_POST['i_did_it'] = true;
echo $top_content;
} );
}
return $do_index;
},10,3);
Quote from mcdeth on March 29, 2024, 12:28It works. Awesome, thanks a lot! I'll leave a 5* review for plugin. By the way, is is possible to change name of attribute term OR do custom sorting?
For age filter, I use currently:
1 year+
2 year+
etc.
If I name terms "One year", "Two years", "Five years" etc, it'll be random sorting, doesn't make much sense. However current numeral setup looks bad
It works. Awesome, thanks a lot! I'll leave a 5* review for plugin. By the way, is is possible to change name of attribute term OR do custom sorting?
For age filter, I use currently:
1 year+
2 year+
etc.
If I name terms"One year","Two years","Five years" etc, it'll be random sorting, doesn't make much sense. However current numeral setup looks bad
Quote from Pablo Borysenco on March 29, 2024, 13:57This can be corrected on the attribute editing page (attribute name)
order - https://share.pluginus.net/image/i20240329135641.png or or drag and drop on the attribute editing page
This can be corrected on the attribute editing page (attribute name)
order - https://share.pluginus.net/image/i20240329135641.png or or drag and drop on the attribute editing page
Quote from mcdeth on March 29, 2024, 20:32No, that's not the solution. I'll explain again.
I have currently age filter as follows:
0 year
1 year
2 year
It's sorted by age (number sorting works fine here). I use it, because if I changed it to letters, then sorting would be a mess:
Four year (<4 year old showing as first)
Newborn
One year
Three year
Two year
etc. Mine question was if there's a custom sorting filter/hook. to make it as:
One year old
Two
Three
Four
etc. Additional question is if I could alter these values (display other than term name)
No, that's not the solution. I'll explain again.
I have currently age filter as follows:
0 year
1 year
2 year
It's sorted by age (number sorting works fine here). I use it, because if I changed it to letters, then sorting would be a mess:
Four year (<4 year old showing as first)
Newborn
One year
Three year
Two year
etc. Mine question was if there's a custom sorting filter/hook. to make it as:
One year old
Two
Three
Four
etc. Additional question is if I could alter these values (display other than term name)
Quote from Pablo Borysenco on April 1, 2024, 12:08Hello
This plugin takes data from woocommerce.
To change the taxonomy name - change it on the taxonomy editing page
To change the sorting of terms, change this on the taxonomy editing page - https://share.pluginus.net/video/v20240401130839.mp4
Hello
This plugin takes data from woocommerce.
To change the taxonomy name - change it on the taxonomy editing page
To change the sorting of terms, change this on the taxonomy editing page - https://share.pluginus.net/video/v20240401130839.mp4
Quote from mcdeth on April 1, 2024, 13:36Oh, thanks a lot! I have one more last question.
If you set url depth to 2 in seo url and you're on filter page, you can use hook woof_seo_do_index. but what if you use 3 filters, is there any hook I can use? For example, I make my own rules for robots and it works for:
/filter/color-black/
/filter/color-black/gender-male
but I need some hook when it's:
/filter/color-black/gender-male/?nocache
/filter/color-black/gender-male/size-large
Oh, thanks a lot! I have one more last question.
If you set url depth to 2 in seo url and you're on filter page, you can use hook woof_seo_do_index. but what if you use 3 filters, is there any hook I can use? For example, I make my own rules for robots and it works for:
/filter/color-black/
/filter/color-black/gender-male
but I need some hook when it's:
/filter/color-black/gender-male/?nocache
/filter/color-black/gender-male/size-large
Quote from Pablo Borysenco on April 2, 2024, 11:00Hello
To do this, the hook passes 3 parameters
$do_index,$url,$request
in this case it will be useful to you $url and $request
for example check size-large
if (isset($request['pa_size']) && 'large' == $request['pa_size']) {
// do something
}
Hello
To do this, the hook passes 3 parameters
$do_index,$url,$request
in this case it will be useful to you $url and $request
for example check size-large
if (isset($request['pa_size']) && 'large' == $request['pa_size']) {
// do something
}