Add Product Price in WooCommerce as a Shortcode
Looking to insert a WooCommerce product price into a layout, well you can add the WooCommerce Product Price as a shortcode using the product ID as an attribute for the correct product. The code below goes into your functions.php file, the add the shortcode where you need to display the price. add_shortcode( ‘cl_product_price’, ‘cl_woo_product_price_shortcode’ );…
Read MoreSet a Minimum Subscription Period in WooCommerce Subscriptions
WooCommerce Subscriptions currently doesn’t allow a minimum subscription time period when setting up a subscription, nut you can manipulate the WooCommerce Subscription Sign-up fee and free trial fields to allow you to do so. Let’s say you want a minimum 3 month sign up period which then defaults to monthly after the 3 months is…
Read MoreAdd Extra Tabs on WooCommerce Products
WooCommerce allows you to add extra tabs on a product page alongside description, reviews and additional information with the filter, woocommerce_product_tabs. Let’s say you wanted 2 extra tabs – ‘Ingredients’ and ‘How To Use’ as the heading, you can use the filter woocommerce_product_tabs like so… add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ ); /** * Add 2 custom product…
Read MoreAdd Navigation Arrows in WooCommerce Product Gallery Slider
You can add Navigation Arrows in WooCommerce Product Gallery by adding a filter and then some CSS. WooCommerce uses a slider called Flexslider and it has a few more configurable options. In functions.php add add_filter( ‘woocommerce_single_product_carousel_options’, ‘sf_update_woo_flexslider_options’ ); /** * Filer WooCommerce Flexslider options – Add Navigation Arrows */ function sf_update_woo_flexslider_options( $options ) { $options[‘directionNav’]…
Read MoreWooCommerce, Add Short or Long Description to Products on Shop Page
You can add a WooCommerce products’ long or short description to the actual product on the main shop page in WooCommerce via the woocommerce_after_shop_loop_item_title action hook, this hook places content immediately after the product title. Adding the Long Description to the Product Loop on the Shop page add_action( ‘woocommerce_after_shop_loop_item_title’, ‘wc_add_long_description’ ); /** * WooCommerce, Add…
Read MoreChange Amount of WooCommerce Products Displayed on Shop Page
WooCommerce displays by default 4 columns and 10 products per page in the shop or archive page – the products per page is based off the amount of post set to display in the WP Admin Dashboard > Reading – Blog pages show at most setting. Here is how you can change the amount of products…
Read MoreRemove the Additional Information and Order Notes fields in WooCommerce
You can remove the Additional Information and Order Notes fields in WooCommerce checkout page with 2 filters that you add to your themes functions.php file The first filter woocommerce_enable_order_notes_field is returning false and will not display the ‘Additional Information’ heading and also the order notes field, I have found it needs to be run with a high…
Read MoreRemove Address Fields in WooCommerce Billing and Shipping in Form Checkout
WooCommerce has the ability to remove the address fields in the checkout form of the billing and shipping forms, this is great if you do not require the address fields as you may have a virtual/download only products that don’t require shipping, less fields to fill out = happy customers. You can remove address field…
Read MoreWooCommerce Accordion Style Expand/Collapse Product Category Menu
Here is a jQuery solution for a WooCommerce accordion style menu for the product category menu that can be assigned with a WooCommerce widget, the menu works best when all product categories are assigned to a parent category. The Accordion menu will then expand and collapse on click with the first parent category appearing expanded,…
Read MoreLimit the Words in WooCommerce Product Short Description
WooCommerce has a filter that can limit the words in a product short description field called ‘woocommerce_short_description‘ – coupled with an existing WordPress function ‘wp_trim_words‘ we can make the description any length to suit teasers, sliders etc and leave other areas where we want the full short description. View the code on Gist. In the…
Read More