Marc
Forum Replies Created
-
Forum: Plugins
In reply to: [Index WP MySQL For Speed] Almost everything gives 404 errorSolved, it was the .htaccess file, that although with the permalinks save is updated, in this case, it brought configuration from the other server that was still the same and that is not compatible in the new one.
So the solution was to delete that file, and then regenerate it completely with the permalinks save.
Thanks @hungphamForum: Plugins
In reply to: [Index WP MySQL For Speed] Almost everything gives 404 error@hungpham sure, I did that and also disabled the cache.
Excellent, it is now working well, congratulations!
Very good, thanks for letting me know, I will stay tuned for the solution.
Great, that parameter achieves the result I was looking for.
Thank you very much!
Yes, that solution could be acceptable for a small amount of entries, but if there are hundreds of entries as in my case, creating a page manually for each one, doesn’t seem to be a good thing.
Anyway, I’ve managed to solve it for now by making a very small modification in the Plugin code.
In the file “connections/includes/Shortcode/Entry_Directory.php”, where it says:
if ( $isSingle ) { array_push( $class, 'cn-template-is-single' ); }I have changed it to:
if ( $isSingle ) { array_push( $class, 'cn-template-is-single' ); } else { return ''; }This way the directory page is as if it is disabled as it doesn’t show anything, and all the entries show everything fine.
I think the Plugin should add an option to apply this setting or at least some parameter in the shortcode [connections] or a filter.
Hi Steven,
yes, you have understood everything I need.
And I’ve already removed the directory page from the site’s nav, but anyone can see the url and easily figure out what the directory page is.
Just removing the last part starting with “/name/…”.Examples:
1) https://site1.com/small-business-advisor-network/name/bruce-h/
Directory page https://site1.com/small-business-advisor-network
2) https://site2.org/scientific-advisory-council/name/shreya-b/
Directory page https://site2.org/scientific-advisory-councilYes, that works!
I just clarify that your line applies the actions according to the state of the checkbox (true/false), so it is necesary to make the change in the checkbox first, e.g.
$(‘input[id=”1categoryset_24″]’).prop(‘checked’, true);Thanks a lot @wpdreams !
Hi @mrclayton
All orders are regular, and I only use this plugin to provide the Klarna payment method, although all orders that have failed so far have been using another payment method provided by another plugin.
But when I deactivate this one from you, all orders are processed fine again.
The only weird thing I noticed several months ago at checkout in Chrome’s inspector console, is that I get the warning message: “It looks like Stripe.js was loaded more than one time. Please only load it once per page.”
But this never affected anything and the order payments were processed smoothly until some weeks ago when Radar was enabled.After further investigation, I noticed that the problem is caused by the plugin “Payment Plugins for Stripe WooCommerce“, because if I deactivate it, everything works fine again.
Although I clarify that that plugin is not to manage the payment with cards but because it allows to add a local gateway that I need, and both plugins worked fine for almost 1 year, and the problem started when from the Stripe account the Radar service was activated.
So I will go to that forum to see if they know what might be causing the conflict.
Thanks for trying to help me!
Hi @roxannestoltz,
yes, all orders are changing to a “Failed” status.
I am now sharing the System Status Report and the Payment Methods.
Researching, I saw that the website owner enabled Radar protection from his Stripe account, that was about a couple of weeks ago, coincidentally when the orders started to fail.
Is this plugin compatible with Radar?
If so, how can I check what is happening?Never mind, I found that in the Posts or Portfolio widgets, there is a field called “Query ID” where to put that custom ID to identify it later in the Hook.
Anyway I needed to modify the WooCommerce widget via Hook or something similar, and this widget doesn’t have “Query ID”, but it can be modified using the filter “woocommerce_shortcode_products_query”, ex:
add_filter( 'woocommerce_shortcode_products_query', function( $query_args, $attributes, $type) { // modify the query args. return $query_args; }, 10, 3);Good point @yinxingmaiming, and do you know where I can get that ID?
@mediawebster
Thank you very much for your replyThat filter was the missing complementary solution
Although with a couple of typos :), the following is the working code:
add_filter( 'woof_dynamic_count_attr', 'custom_pre_get_posts_query__count' ); function custom_pre_get_posts_query__count( $args, $type ) { $cat_exclude[] = 15; $args['tax_query'][] = array( 'taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $cat_exclude, 'operator' => 'NOT IN' ); return $args; }@realmag777
You should include the shared filter “woof_dynamic_count_attr” in the documentation, it is very useful.I tried using the examples I got from the links you provided but it didn’t work.
I tried this code:
add_filter( 'posts_where', function ( $where, $q ) { global $wpdb; $where .= " AND $wpdb->posts.ID NOT IN(52,80,97)"; // This works ok excluding specific posts /*I have tried several ways to exclude a category and they didn't work, maybe there is some syntax error, here are some examples:*/ //$where .= " AND $wpdb->term_taxonomy.taxonomy in ('product_cat') AND $wpdb->term_taxonomy.term_id NOT IN (15)"; //$where .= " AND $wpdb->term_taxonomy.term_id <> 15 AND $wpdb->term_taxonomy.taxonomy = 'product_cat'"; //$where .= " AND t.taxonomy = 'product_cat' AND tr.term_id NOT IN ('15')"; return $where; }, 1000, 2 );Anyway I achieved the most important thing which is to exclude the category from the results with this code:
add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' ); function custom_pre_get_posts_query( $q ) { $cat_exclude[] = 15; $tax_query[] = array( 'taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $cat_exclude, 'operator' => 'NOT IN' ); $q->set( 'tax_query', $tax_query ); }The problem that remains is that in the filters (checkboxes in my case) still appear categories of products that were excluded.
I think the correct solution would be that the plugin takes into account the action “woocommerce_product_query” to show only categories according to the modified result.