{"id":125340,"date":"2017-09-12T17:06:19","date_gmt":"2017-09-12T16:06:19","guid":{"rendered":"https:\/\/d689c4c32f5390333.temporary.link\/?p=824"},"modified":"2024-02-07T16:26:00","modified_gmt":"2024-02-07T15:26:00","slug":"woocommerce-variable-product-variations","status":"publish","type":"post","link":"https:\/\/www.orionorigin.com\/woocommerce-variable-product-variations\/","title":{"rendered":"How to setup a woocommerce variable pricing on product variations?"},"content":{"rendered":"<p>Variable products<span style=\"font-weight: 400\"> are a product type in WooCommerce that lets you offer product variations, with control over prices, stock, image and more for each variation. For various reasons, you may need to dynamically apply a WooCommerce variable pricing on specific variations depending on their attributes.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In today\u2019s article, you will learn how to create a variable pricing on all product variations based on their attributes in few clicks using Conditional Discounts for WooCommerce.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">How to create a WooCommerce variable pricing on a product variation with a specific attribute value?<\/span><\/h2>\n<p><span style=\"font-weight: 400\">In order to create a dynamic WooCommerce variable pricing on product variations, we need to <\/span><a href=\"https:\/\/www.orionorigin.com\/blog\/create-products-list-woocommerce-discounts\/\"><span style=\"font-weight: 400\">create a product list<\/span><\/a><span style=\"font-weight: 400\">. A product list is a subset of your shop\u2019s products that you can use in discounts rules or as target when creating a discount. This WooCommerce bulk discount demo will show you how to go about it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In order to create our list: <\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click on <\/span><strong>Discounts<\/strong><span style=\"font-weight: 400\"> &gt; <\/span><strong>Products Lists<\/strong><span style=\"font-weight: 400\"> to access the lists management page.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Next click on <\/span><strong>New List<\/strong><span style=\"font-weight: 400\"> to access the list creation page<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Then select <\/span><strong>Dynamic Request<\/strong><span style=\"font-weight: 400\"> as<strong> Extraction type<\/strong><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Scroll down to the metas section and let\u2019s create a dynamic request based on the variation attributes that will allow us to get the variations we need. <\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">There are two ways to create variation attributes, you can store each way differently on WooCommerce: <\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>a)\u00a0<\/strong>From the menu <\/span><b>Products &gt; Attributes<\/b><\/p>\n<p><span style=\"font-weight: 400\">WooCommerce store these as terms. Furthermore assuming our variable name is \u201cRing Style\u201d and that their values are \u201cGold Rose\u201d, \u201cSilver\u201d and \u201cGold\u201d, WooCommerce will store them in the database as metas: <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><b>Ring Style<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>attribute_pa_ring-style<\/b><span style=\"font-weight: 400\"> which is a combination of attribute_pa and the attribute name\u2019s slug ( in lowercase, the spaces replaced by \u201c-\u201d and the special characters removed).<\/span><\/li>\n<li style=\"font-weight: 400\">and<b> Gold Rose<\/b><span style=\"font-weight: 400\"> will be store as <\/span><b>gold-rose<\/b><span style=\"font-weight: 400\"> which is the slug of the term.<\/span><\/li>\n<li style=\"font-weight: 400\">likewise<b> Silver<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>silver<\/b><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Gold<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>gold <\/b>too<span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">In this case the metas will be appear as below: <\/span><\/p>\n<p><a href=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1908 aligncenter\" src=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1.png\" alt=\"woocommerce discount product variation attribute\" width=\"1848\" height=\"298\" title=\"\" srcset=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1.png 1848w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1-300x48.png 300w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1-600x97.png 600w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1-1024x165.png 1024w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1-150x24.png 150w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1-768x124.png 768w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-1-1536x248.png 1536w\" sizes=\"auto, (max-width: 1848px) 100vw, 1848px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\"><strong>b) <\/strong>Also\u00a0from the product creation page<\/span><\/p>\n<p><span style=\"font-weight: 400\">WooCommerce stores them directly as meta but slightly differently: <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><b>Ring Style<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>attribute_ring-style<\/b><span style=\"font-weight: 400\"> which is a combination of attribute_pa and the attribute name\u2019s slug ( in lowercase, the spaces replaced by \u201c-\u201d and the special characters removed).<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Gold Rose<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>gold-rose<\/b><span style=\"font-weight: 400\"> which is the slug of the term.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Silver<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>silver<\/b><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Gold<\/b><span style=\"font-weight: 400\"> will be stored as <\/span><b>gold<\/b><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">In this case the metas will be appear as below: <\/span><\/p>\n<p><span style=\"font-weight: 400\"><a href=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1909 aligncenter\" src=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2.png\" alt=\"woocommerce discount product variation attribute\" width=\"1846\" height=\"286\" title=\"\" srcset=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2.png 1846w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2-300x46.png 300w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2-600x93.png 600w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2-1024x159.png 1024w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2-150x23.png 150w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2-768x119.png 768w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-2-1536x238.png 1536w\" sizes=\"auto, (max-width: 1846px) 100vw, 1846px\" \/><\/a><\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click on the <\/span><b>Evaluate<\/b><span style=\"font-weight: 400\"> button to confirm that the plugin is able to fetch the variations properly.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Then click on the <\/span><b>Publish<\/b><span style=\"font-weight: 400\"> button to save your list.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Now that you\u2019ve created your list, you can use it in the discounts. Next, click on <\/span><b>Discounts &gt; New discount<\/b><span style=\"font-weight: 400\"> to create your discount and use the list we just created. <\/span><\/li>\n<\/ol>\n<h2><span style=\"font-weight: 400\">How to create a WooCommerce variable pricing on product variations with a specific attribute.<\/span><\/h2>\n<p><span style=\"font-weight: 400\">For instance you need to create a WooCommerce variable pricing on all variable products with a specific attribute no matter the value,\u00a0 you can follow the same steps in the demo above but set up the metas a bit differently as below:<\/span><\/p>\n<p><a href=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1910 size-full\" src=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3.png\" alt=\"woocommerce variable pricing\" width=\"1846\" height=\"294\" title=\"\" srcset=\"https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3.png 1846w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3-300x48.png 300w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3-600x96.png 600w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3-1024x163.png 1024w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3-150x24.png 150w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3-768x122.png 768w, https:\/\/www.orionorigin.com\/wp-content\/uploads\/2017\/06\/discount-product-variation-3-1536x245.png 1536w\" sizes=\"auto, (max-width: 1846px) 100vw, 1846px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">Therefore you\u2019ll need to make sure the key matches the format and it will depend on how you created the variation attributes based on the previous explanations.<\/span><\/p>\n<p><span style=\"font-weight: 400\">This finally completes our tutorial on the creation of WooCommerce variable pricing on product variations based on their attributes using <\/span><a href=\"https:\/\/www.orionorigin.com\/product\/conditional-discounts-for-woocommerce\/\"><b>Conditional Discounts for WooCommerce<\/b><\/a><span style=\"font-weight: 400\">. We hope the WooCommerce bulk discount demo helped you. If you have any questions, use the comments section to ask.<\/span><\/p>\n<div id=\"jp-relatedposts\" class=\"jp-relatedposts\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Variable products are a product type in WooCommerce that lets you offer product variations, with control over prices, stock, image and more for each variation. For various reasons, you may need to dynamically apply a WooCommerce variable pricing on specific variations depending on their attributes. In today\u2019s article, you will learn how to create a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":149657,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[416],"tags":[183,184,75,185,17],"class_list":["post-125340","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-discount","tag-conditional-discounts-for-woocommerce","tag-quantity-discounts","tag-woocommerce-all-discounts","tag-woocommerce-bulk-discounts-variations","tag-wordpress"],"acf":[],"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/posts\/125340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/comments?post=125340"}],"version-history":[{"count":2,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/posts\/125340\/revisions"}],"predecessor-version":[{"id":162842,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/posts\/125340\/revisions\/162842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/media\/149657"}],"wp:attachment":[{"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/media?parent=125340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/categories?post=125340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orionorigin.com\/service\/wp\/v2\/tags?post=125340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}