Changing the Woocommerce breadcrumb menu [closed]

A cleaner way to display a delimiter would be a CSS-border (like Aibrean suggested). But you can set up the filter to fit your needs: add_filter( ‘woocommerce_breadcrumb_defaults’, ‘custom_woocommerce_breadcrumbs’ ); function custom_woocommerce_breadcrumbs() { return array( ‘delimiter’ => ‘<li class=”separator”> | </li>’, ‘wrap_before’ => ‘<div><ul class=”crumbs”>’, ‘wrap_after’ => ‘</ul></div>’, ‘before’ => ‘<li>’, ‘after’ => ‘</li>’, ‘home’ => … Read more

Modify SKU for display on product page

Try using the core WooCommerce filter woocommerce_get_sku: function wpse_188691_woocommerce_get_sku( $sku, $product ) { if ( ! is_admin() ) { $parts = explode( ‘.’, $sku ); // Only first two parts $parts = array_slice( $parts, 0, 2 ); // OR all parts except last (remove above) // array_pop( $parts ); $sku = implode( ‘.’, $parts ); … Read more

Arranging Product Details on Shop Page

So… I was working on another section of the site and was browsing the Foundation Docs. I saw the ability to push/pull columns and decided to give it a try. It worked. Here’s the code I used: <li <?php post_class( $classes ); ?>> <?php do_action( ‘woocommerce_before_shop_loop_item’ ); ?> <div class=”row”> <a href=”https://wordpress.stackexchange.com/questions/190647/<?php the_permalink(); ?>”> <div … Read more

WooCommerce – Multiple meta query not working

meta_query format and orderby format should be as follows: $args = array( ‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘posts_per_page’=> 10, ‘orderby’ => ‘total_sales’, ‘order’ => ‘DESC’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_featured’, ‘value’ => ‘yes’, ‘compare’ => ‘=’ ), array( ‘key’ => ‘total_sales’, ‘value’ => ’10’, ‘compare’ => ‘>=’ ) ) … Read more

Delete All Product Images in phpmyadmin

You can loop through all the woo-commerce products and delete them along with their attachment(images).. $args = array( ‘post_type’ => ‘product’, … ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php wp_delete_post( $loop->post->ID ); wp_delete_attachment( $loop->post->attachment_id ); ?> <?php endwhile; ?>

WooCommerce – Display nested list of all subcategories on archive-product.php

I solved this by modifying the function linked to in the question to make it recursive. The comments explain my changes: function woocommerce_subcats_from_parentcat_by_ID( $parent_cat_ID ) { $args = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $parent_cat_ID, ‘taxonomy’ => ‘product_cat’ ); $subcats = get_categories($args); if ( $subcats ) { // added … Read more

Woocommerce – Show random product thumbnail from specific product category

Add a tax_query to your $args… $args = array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, //possible values are term_id, name, slug or term_taxonomy_id ‘terms’ => ‘tshirt’ //can be single string or array of slugs, names, term_ids or taxonomy_ids ) ) ); $results = get_posts( $args ); Recommended reading: https://codex.wordpress.org/Template_Tags/get_posts#Taxonomy_Parameters http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters