{"id":40,"date":"2013-06-07T11:00:28","date_gmt":"2013-06-07T11:00:28","guid":{"rendered":"http:\/\/demo.woothemes.com\/woocommerce\/?post_type=product&#038;p=40"},"modified":"2017-06-28T12:37:21","modified_gmt":"2017-06-28T12:37:21","slug":"product-with-uploads-per-variation","status":"publish","type":"product","link":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/product\/product-with-uploads-per-variation\/","title":{"rendered":"Product with uploads per variation"},"content":{"rendered":"<h3>Set upload rules to product variations<\/h3>\n<p>What if you have a variable product and you want to set different upload rules for every variation?<br \/>\nThis is easily doable by activating only a subset of the upload rules for every variation, in this way your customers will be asked to upload a number of files that depends by the variation chosen.<\/p>\n<p>First of all, let&#8217;s create all the upload rules that are needed by the single product variation, for example for a &#8216;notebook&#8217; product we add three upload rules, a &#8216;Full page&#8217; picture a &#8216;Centered&#8217; picture and a &#8216;watermark&#8217; picture:<\/p>\n<figure id=\"attachment_143\" aria-describedby=\"caption-attachment-143\" style=\"width: 682px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-143 size-full\" src=\"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-content\/uploads\/sites\/652\/2016\/09\/Selection_017.png\" alt=\"selection_017\" width=\"682\" height=\"622\" srcset=\"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-content\/uploads\/sites\/652\/2016\/09\/Selection_017.png 682w, https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-content\/uploads\/sites\/652\/2016\/09\/Selection_017-300x274.png 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><figcaption id=\"caption-attachment-143\" class=\"wp-caption-text\">These upload rules are the full set of rules that could be associated to a specific variation<\/figcaption><\/figure>\n<p>For every variation we can choose which upload rules could be used, for example we have a variation for the &#8216;notebook&#8217; product that let the customer to customize the product with a watermark printing and a centered logo, the we will choose a subset of rules to be used, in our example :<\/p>\n<figure id=\"attachment_144\" aria-describedby=\"caption-attachment-144\" style=\"width: 649px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-144\" src=\"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-content\/uploads\/sites\/652\/2016\/09\/Selection_018.png\" alt=\"For this specific variation we let the customer to upload to images, one as the 'notebook' watermak and one for the company logo\" width=\"649\" height=\"303\" srcset=\"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-content\/uploads\/sites\/652\/2016\/09\/Selection_018.png 649w, https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-content\/uploads\/sites\/652\/2016\/09\/Selection_018-300x140.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><figcaption id=\"caption-attachment-144\" class=\"wp-caption-text\">For this specific variation we let the customer to upload to images, one as the &#8216;notebook&#8217; watermak and one for the company logo<\/figcaption><\/figure>\n<p>Try adding this product with &#8216;Centered picture&#8217; and &#8216;Watermark&#8217;\u00a0to the cart in order to see that these specific file will be asked for this product.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Once the product is added to the cart<\/strong>, this product will let your customer upload a number of files different based on the selected variation.<\/p>\n","protected":false},"featured_media":133,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false},"product_brand":[],"product_cat":[26],"product_tag":[],"class_list":["post-40","product","type-product","status-publish","has-post-thumbnail","product_cat-uncategorized","first","instock","shipping-taxable","purchasable","product-type-variable","has-default-attributes"],"_links":{"self":[{"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/product\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/types\/product"}],"replies":[{"embeddable":true,"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/comments?post=40"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/media\/133"}],"wp:attachment":[{"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/product_brand?post=40"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/product_cat?post=40"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/plugins.yithemes.com\/yith-woocommerce-uploads\/wp-json\/wp\/v2\/product_tag?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}