Month: December 2016

Get Woocommerce Current Product Category In Single Product Page

Get Woocommerce Current Product Category In Single Product Page

First of all, Woocommerce products are stored on WordPress as custom post type (CPT) named 'product'. The product categories are custom taxonomy named 'product_cat'. Let's say you want to show a simple line of text that tells your visitors the shipping flat rate of a product, and you have different rates for different product categories. For an example, you have two different product categories in your shop, which you named them as tshirts and hoodies. Tshirts have shipping flat rate of $10.00 while hoodies have flat rate of $15.00. This is how you check for current product category (either tshirts or hoodies) on a single product page. This is used inside the loop. That's it!...
Read More