Customizing WooCommerce

What you are looking is variable product. You can create variation “Color” & “Fragrance”. in variable products When you are creating a product in backend you can select a product type as variable and add variations. You can see an example below

Append woocommerce category to product title globally? [closed]

WooCommerce uses a single hook to display many things and just changing the hook priorities change the order of elements. Just change the hook and their order to achieve your goal. add_action( ‘woocommerce_single_product_summary’, ‘my_add_product_cat’, 6); add_action( ‘woocommerce_shop_loop_item_title’, ‘my_add_product_cat’, 11); I have given woocommerce_single_product_summary priority to 6 because single product title displayed at same hook with … Read more

WooCommerce Cart Items

You’re passing two parameters to _n function, the first one is the pattern for one item, and the second for 2 or more. Just change the pattern. Show only numbers: <?php echo sprintf (_n( ‘%d’, ‘%d’,count( WC()->cart->get_cart())),count( WC()->cart->get_cart())); ?> Show item for two or more: <?php echo sprintf (_n( ‘%d’, ‘%d items’,count( WC()->cart->get_cart())),count( WC()->cart->get_cart())); ?> … Read more

Hide Add to Cart button on woocommerce Product description page of a particular product

You are applying your hook to early. WordPress is perfectly fine with removing that action, however it doesn’t know what product/post ID is yet. You can rewrite the last line of your code like that: add_action(‘wp’,’remove_product_description_add_cart_button’); WordPress actions chronologically – https://codex.wordpress.org/Plugin_API/Action_Reference

How To Customize The Product Page Template for a WooCommerce Custom Product Type Plugin [closed]

The cruxof my issues were a mis-matching class name/product type. I was calling the class WC_Product_Family but using a product type of “wcfp_family_product”. I refactored the code, adding in the hook for the add_to_cart and was able to get a crude working example: <?php /* https://wisdmlabs.com/blog/create-product-type-custom-settings-woocommerce/ Adding a custom WooCommerce product type // Example showing … Read more