{"id":24389,"date":"2013-07-21T21:45:52","date_gmt":"2013-07-21T21:45:52","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/woocommerce-custom-order-data\/"},"modified":"2013-07-23T18:00:06","modified_gmt":"2013-07-23T18:00:06","slug":"woocommerce-custom-order-data","status":"closed","type":"plugin","link":"https:\/\/da.wordpress.org\/plugins\/woocommerce-custom-order-data\/","author":9588304,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.1","stable_tag":"1.0.1","tested":"3.5.2","requires":"2.7","requires_php":"","requires_plugins":"","header_name":"WooCommerce Custom Order Data","header_author":"Milo\u0161 \u0110eki\u0107","header_description":"","assets_banners_color":"eee5de","last_updated":"2013-07-23 18:00:06","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/milos.djekic.net\/my-software\/woocommerce-custom-order-data","header_plugin_uri":"http:\/\/milos.djekic.net\/my-software\/wc-custom-order-data-plugin","header_author_uri":"http:\/\/milos.djekic.net","rating":0,"author_block_rating":0,"active_installs":50,"downloads":4073,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"744114","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[527,3524,282,1896,286],"plugin_category":[45],"plugin_contributors":[81450],"plugin_business_model":[],"class_list":["post-24389","plugin","type-plugin","status-closed","hentry","plugin_tags-custom","plugin_tags-data","plugin_tags-ecommerce","plugin_tags-order","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-mdjekic","plugin_committers-mdjekic"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/woocommerce-custom-order-data_eee5de.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>If you are extending WooCommerce by creating themes or developing plugins you will find this plugin to be priceless!<\/p>\n\n<p>WooCommerce uses WordPress logic and database tables to store data on store items, orders, checkouts\u2026\nIf you are integrating a payment gateway or any 3rd party app with your store, you sometimes need to\nstore some extra data for specific orders. It tends to be very hard or even impossible to extend orders\nwith custom data.<\/p>\n\n<h4>Extend WC Orders<\/h4>\n\n<p>Here\u2019s how easy it is to extend a WooCommerce order in your code:<\/p>\n\n<p>| WC_CustomOrderData::extend($order);<\/p>\n\n<p>To set a custom property to an order, just type:<\/p>\n\n<p>| $order-&gt;custom-&gt;your_custom_property = 'some value';<\/p>\n\n<p>After that you can use your custom order property by referring the \u201ccustom\u201d order property:<\/p>\n\n<p>| $custom_property = $order-&gt;custom-&gt;your_custom_property;<\/p>\n\n<p>You can allways check if a custom order property exists using the standard PHP way:<\/p>\n\n<p>| if(isset($order-&gt;custom-&gt;your_custom_property)) { doStuff(); }<\/p>\n\n<p>All custom order properties are saved in a separate database table. When you finish working with the order,\nmake sure you save custom data by typing:<\/p>\n\n<p>| $order-&gt;custom-&gt;save();<\/p>\n\n<p>Note: Storred objects and arrays will be restored as arrays.<\/p>\n\n<h4>Author<\/h4>\n\n<p><a href=\"http:\/\/milos.djekic.net\">Milo\u0161 \u0110eki\u0107<\/a> is a software enthusiast from Belgrade,\nSerbia. He loves to create useful software.<\/p>\n\n<!--section=installation-->\n<p>Just follow this simple guidelines.<\/p>\n\n<h4>Installation steps<\/h4>\n\n<ol>\n<li>Upload 'woocommerce-custom-order-data' to the '\/wp-content\/plugins\/' directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Use custom order data in your WooCommerce plugins and themes<\/li>\n<li>That's it. Enjoy!<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Added 'unset' support<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First version - WooCommerce orders can now be extended with custom data.<\/li>\n<\/ul>","raw_excerpt":"Extend WC orders with practically any custom data by writing just one line of code and use it wherever you need.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/24389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=24389"}],"author":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mdjekic"}],"wp:attachment":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=24389"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=24389"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=24389"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=24389"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=24389"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=24389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}