Categories
CMS Mastering Development Wordpress

tax_query for same level of a post_type

There is a post type ‘payment_methods’, which has two taxonomies , ‘category’ and ‘restricted-country’ So i want to query for ‘payment_methods’ which has taxonomy ‘category’ = ‘Online_Banking’ and ‘restricted-country’=’USA’ , there is case that ‘restricted-country’ taxonomy is not selected for a payment_method… $name=’Online_Banking’; $country_name = ‘USA’; $args_p = array( ‘posts_per_page’ => $number, ‘post_type’ => ‘payment_methods’, […]

Categories
Mastering Development

Woocommerce search for Product Variation

I need to get the ID of all variations containing attributes within a category. At the moment I have the following. $taxQuery[] = array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘term_id’, ‘terms’ => $id ); $args = array( ‘post_status’ => array(‘private’, ‘publish’), ‘tax_query’ => array([ ‘taxonomy’ => ‘pa_avanti-door-size’, ‘field’ => ‘slug’, ‘terms’ => ($height – 5) […]

Categories
CMS Mastering Development Wordpress

How to remove an item from a custom Walker_Nav_Menu

I have a custom menu on a wordpress + woocommerce site using the Walker_Nav_Menu class. When hiding posts (products) from the site those posts and category are still included in the custom menu. I would like to know how to remove either the specific product posts from this menu, for e.g. post ID = 6927 […]

Categories
CMS Mastering Development Wordpress

Custom post taxonomies as tax_query terms?

I have these two custom post types called “product” and “reference”. On “references” I have attached a custom taxonomy called “product_reference” which I use to specify which products the references are related to. On the “product” custom posts I have attached a custom module called “module-relevant-references” for fetching reference-posts relevant to the product. This might […]

Categories
CMS Mastering Development Wordpress

Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT

I hope someone can shed some light into this problem that i cannot find a solution for! (I have been searching the www for days). WHAT I HAVE DONE: I created a CPT: “service” and a Custom taxonomy: “service_cat”, which contains 4 $terms: corporate events, fundraisers, private events and weddings. I also created two files: […]

Categories
CMS Development Wordpress

Adding arguments to WooCommerce Product Loop using AJAX

I’m trying to make an AJAX product filter for my WooCommerce shop page. Previously, I had created the query myself, and didn’t use the shop page. However, I want to make my code now more WC compatible. At the moment, I can set variables from the query string to filter the WooCommerce Product loop. I […]

Categories
CMS Development Wordpress

how do you pull data from two taxonomies?

I have posts loaded from taxonomy, but I’m trying to get the data of another, that’s also attached to the same post. In the code below, the main focus is getting $location_slug. Knowing how to get that I think I’d know how to get more data out of the second taxonomy. // args for the […]

Categories
CMS Development Wordpress

Woocommerce sales report doe not display all product names and customer notes

I’m trying to work on this woocommerce report that shows only one product name but there is customers order multiple products: Also i want to show customer notes in this report Please help <?php /** * Plugin Name: Custom Order Report * Description: Generates a report on individual WooCommerce products sold during a specified time […]

Categories
CMS Development Wordpress

WooCommerce Product Table – filter query on attributes

I am using the Barn2 Product Table plugin with WooCommerce. I would like to modify the main query so that only products with a certain attribute are displayed (depending on the logged in user) I am using wc_product_table_query_args. To make it display products from a certain category is no problem and the following arguments work: […]

Categories
CMS Development Wordpress

Filter posts by their related field’s custom field

I have two post types named ‘programs’ and ‘universities’, where the programs are connected to their respective universities. I want to filter programs by university’s custom fields such as ranking or location. I can filter and display the programs by their own custom fields using WP_Query. However, I cannot filter them by their related post’s […]