Phenix
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Allow all attributes and their terms to always displayHello, thanks for the help.
In summary, I am using the Classic Filter by Product Attribute widget on the front-end of my staging site.
You can access this filter via the woocommerce sidebar when searching for products. Please note, the widget i’m referring to is named “Brand – Classic Widget”, the others are simply widgets I’m testing separately.
You can see this widget here https://snipboard.io/tuUc0e.jpg
Currently you can see it only shows the term ‘Nike’. I don’t want this to be the case.
I want it to always show the widget, and always show all the terms underneath the widget, even if products in the searched/filtered results do not include the widget/attribute and its terms.
Staging site link: https://staging-1011-proshop269264111.wpcomstaging.com/?s=&post_type=product&title=1&excerpt=0&content=0&categories=1&attributes=1&tags=1&sku=0&orderby=date-DESC&ixwps=1
Forum: Plugins
In reply to: [WooCommerce] Filter by Attribute – Query ChangeHello – thanks again for getting back to me.
Understand, thanks. I can get the tax_query to behave like I need to its just the
SELECT product_or_parent_id
part which I can’t.Do you have any ideas of how I can track this down? I’ve been trying lots of different ways but nothing seems to work.
One thing I did consider is using str replace to find the term_id in (1225) and replace it with term_id in (1225,413) but I guess this is quite dangerous?
Forum: Plugins
In reply to: [WooCommerce] Filter by Attribute – Query ChangeHello – thanks for getting back to me.
I have been able to correctly adjust the “wp_term_relationships.term_taxonomy_id IN” part of the query. It is the term_id part below which only appears to pick up one value (1225 in my example).
I need ‘WHERE term_id in (1225)’ to become ‘WHERE term_id in (1225,413)’ or ‘WHERE (term_id in (1225) or term_id in (413)).
Any change I make to the tax_query only seems to amend the “wp_term_relationships.term_taxonomy_id IN” part of the query…
It’s how the term_id is being set which I need to figure out/override
Forum: Plugins
In reply to: [WooCommerce] Filter by Attribute – Query ChangeAs an example, using Query Monitor the tax_query generated is;
Array ( [relation] => OR [0] => Array ( [taxonomy] => pa_dexterity [field] => slug [terms] => right-handed ) [1] => Array ( [taxonomy] => pa_hand [field] => slug [terms] => right-handed )
However i’m still not getting the correct products in my product results
Forum: Plugins
In reply to: [WooCommerce] Filter by Attribute – Query ChangeHello, thanks for the response. I’m essentially picking up the filter which is being selected on the front-end, then in an array I’ve mapped some terms to the one which is being selected. In the example I used above, 1225 is the parent term and 413 is mapped to 1225 in an array which I’m picking up.
For some reason, however I try to amend the query, it only ever amends the wp_term_relationships.term_taxonomy_id part and not the ‘WHERE term_id in (1225)’ bit.
The query is set up to be an OR. It first picks up the query for the parent term and then it does a foreach across each child term mapped to the parent term and picks up the relevant term and taxonomy to look in for that term. All of this appears to be working fine. It’s just the term_id part I can’t figure out. Everything I look at suggests what I’m doing is correct, and other approaches i’ve tried lead me to the same result.
This is my code:
// Create a tax query to search in the selected attribute and its child attributes $tax_query = array( 'relation' => 'OR', ); // Add the selected parent attribute $tax_query[] = array( 'taxonomy' => $filter_parameters[$selected_filter], 'field' => 'slug', 'terms' => $selected_term, ); // Check if the selected attribute has child mappings if (isset($child_mappings[$selected_filter])) { foreach ($child_mappings[$selected_filter] as $sub_child_taxonomy) { foreach ($child_term_mappings[$selected_filter][$selected_term] as $child_term) { // Add the sub-child attributes to the tax query $tax_query[] = array( 'taxonomy' => 'pa_' . $sub_child_taxonomy, 'field' => 'slug', 'terms' => $child_term, ); } } } $query->set('tax_query', $tax_query);
Thanks
Forum: Fixing WordPress
In reply to: Default cursor on page openalso, I’ve changed the id to match this search box but it doesn’t appear to work. From my limited knowledge I’d assume this is because its added to the header.php file and this popup is not part of the header?
Forum: Fixing WordPress
In reply to: Default cursor on page openAh thank you yes we were looking at different search boxes. For the desktop site it works now however the search box I was hoping to get this to work for is on the mobile site.
There’s a search icon in the header on the mobile site, selecting this opens a popup where the search bar is, it’s this search bar I was hoping to default the cursor to if possible
Really appreciate the help!
Forum: Fixing WordPress
In reply to: Default cursor on page openThanks for responding, however it doesn’t appear to work
I also tried using the id product-search-field-2 as this is what it appears to show as when I inspect on my browser but still no luck…
Any additional help would be much appreciated!!
Forum: Reviews
In reply to: [User Menus - Nav Menu Visibility] Fantastic pluginKeep up the great work
- This reply was modified 3 years, 8 months ago by Phenix.
Hello
Is there a way to do this via a shortcode?
Thanks
Forum: Plugins
In reply to: [WooCommerce] Search product filter doesn’t work with othersThanks! I bought the woocommerce search and it fixed it and works much better