garetsd
Forum Replies Created
-
Ah super !
Juste deselectionner les produits avant de générer l’étiquette fonctionnera donc bien, ca fera l’affaire pour le moment,
Merci mille fois pour votre aide !
- This reply was modified 2 years ago by garetsd.
Bonjour,
Merci pour votre réponse, donc si j’installe par exemple le plugin de WooCommerce Advanced Shipping Packages pour séparer les colis, cela ne marcherais pas ?
Et dans le cas où je génère l’étiquette depuis l’administration comme le cas rare que vous mentionnez en deselectionnant les produits non envoyés via Colissimo, mon client ne sera facturé que sur les produits envoyés via l’étiquette ?
C’est que je ne veux pas que mon client (le gestionnaire de la boutique) paye des frais de port de Colissimo pour des produits envoyés d’une autre façon, vous voyez !
Merci pour votre aide
If anyone encounters the same issue you just have to add the following code to your functions.php file.
Keep in mind it will only work with the main WP_Query and if you’re using the shortcode option.add_filter('woocommerce_shortcode_products_query', 'filter_the_query_for_tax', 10, 1); function filter_the_query_for_tax($query_args) { //Check first if it's a taxonomy archive page. We also check if it's not a product category for WooCommerce. if(is_tax() && !is_product_category()){ //Now let's fetch the taxonomy name and as well as the taxonomy term $term = get_queried_object(); //Now let's add it to the query thanks to the woocommerce_shortcode_products_query. Just fill in the $query_args['tax_query']. $query_args['tax_query'] = array(array( 'taxonomy' => $term->taxonomy, 'field' => 'slug', 'terms' => $term->slug )); } return $query_args; }Alright, I found the solution.
I’ve been using the Divi shop module, which, strangely, uses the main Query.
However, it does not support the taxonomies in this module. Guess I’ll do it myself then.
If anyone encounters the same problem, you’ll have to edit the shop.php module of Divi. Of course, it’s always better to clone it so you don’t erase it in the next update.
Big thanks to the Filter Everything plugin, it is really is a powerful plugin. I’ll make sure to include it in my next customer’s project.So, I tried with the OG woocommerce template and it works. Which explains that !
But I’m still stratching my head as why is it working with categories one… Is it on purpose ?
Thanks mate !Hey Victor,
I appreciate the answer, however, the template page for the Brand taxonomy is the exact same than the Categories one, which is working.
Strangely enough, the filter in the sidebar displays the number of items right. It even greys out the current Brand I’m one, it just doesn’t filter out anything !
Do you know else can it be ? I can provide more details if needed !
ThanksSelf-reply:
I kinda solved it. It was related to the URL prefix for the brand apparently, I replaced it with “sortbrand” in it works as intented…almost.
It still doesn’t work for the “Brand” archives pages (custom taxonomy). It just display all products despite the correct brand checked and greyed out in the filter menu.