This is a running list of snippets and plugins that I’ve found useful while developing in WooCommerce.
If you are using the WC Brands extension, you will quicly realize that it’s meant to output the brand image using their default shortcodes. But what if you just wanted to take control of brand link to add it dynamically for your products? Here is how you can get it. I have it outputting beneath the product title in this example but you can use any WooCommerce hook to control where it’s output.
<?php | |
add_action('woocommerce_single_product_summary', 'hjs_add_brand_by_link', 5); | |
function hjs_add_brand_by_link() { | |
global $post; | |
$post_id = $post->ID; | |
$terms = get_the_terms($post_id, 'product_brand' ); | |
foreach ($terms as $term) { ?> | |
<span class="brand-by-link">by <a href="<?php echo get_term_link( $term, 'product_brand' ); ?>"><?php echo $term->name; ?></a></span> | |
<?php } | |
} | |
?> |
Looking for a way to take over, customize and display the WooCommerce Categories in your sidebar?
Want to change the number of related products at the bottom of your single product page?
Want to add a custom sidebar shopping cart? This one will display different content depending on whether the cart is empty or full.
How to add a woocommerce cart with price and item count to a WordPress menu
Looking for a better way to display featured products in your sidebar?
Some plugins I have found useful:
Woocommerce Customizer
WooCommerce Custom Product Tabs Lite