{"id":5108,"date":"2018-12-30T16:53:31","date_gmt":"2018-12-30T16:53:31","guid":{"rendered":"https:\/\/musilda.cz\/?p=5108"},"modified":"2018-12-30T16:53:31","modified_gmt":"2018-12-30T16:53:31","slug":"nove-tabulky-pro-data-produktu-ve-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/nove-tabulky-pro-data-produktu-ve-woocommerce\/","title":{"rendered":"Nov\u00e9 tabulky pro data produktu ve WooCommerce"},"content":{"rendered":"<p>Jedna z v\u011bc\u00ed, kter\u00e1 je WordPressu vy\u010d\u00edt\u00e1no, pota\u017emo i <strong>pluginu WooCommerce<\/strong>, je struktura datab\u00e1ze. V podstat\u011b v\u0161echno co u produkt\u016f ulo\u017e\u00edte, jde do tabulky postmeta. Co\u017e je kolem 30 z\u00e1znam\u016f u ka\u017ed\u00e9ho produktu, nebo varianty.<\/p>\n<p>A to nepo\u010d\u00edt\u00e1me dal\u0161\u00ed pluginy, transienty a podobn\u011b. Velmi lehce se dostanete na 50 polo\u017eek u ka\u017ed\u00e9ho produktu. K tomu dal\u0161\u00ed z\u00e1znamy pro \u010dl\u00e1nky, str\u00e1nky, revize a tak d\u00e1le. Nen\u00ed divu, \u017ee tabulka postmeta bobtn\u00e1 a bobtn\u00e1 a vyj\u00edmkou nejsou ani <strong>miliony z\u00e1znam\u016f<\/strong>.<\/p>\n<p>Prvn\u00edm krokem, jak tento probl\u00e9m \u0159e\u0161it, alespo\u0148 z \u010d\u00e1sti, bylo zaveden\u00ed <strong>CRUD<\/strong> a <strong>data-stores<\/strong> pro produkty a objedn\u00e1vky. T\u00edm \u017ee se standartizoval zp\u016fsob z\u00edsk\u00e1n\u00ed dat pro produkty, vznikla cesta, jak p\u0159ev\u00e9st tato data do vlastn\u00edch tabulek.<\/p>\n<p>V tuto chv\u00edli jsou k dizpozici dva pluginy, jen\u017e umo\u017e\u0148uj\u00ed ukl\u00e1dat informace objedn\u00e1vek a produkt\u016f do vlastn\u00edch tabulek a sni\u017eovat tak z\u00e1t\u011b\u017e na datab\u00e1zi. P\u0159esto\u017ee si m\u016f\u017eete \u0159\u00edct &#8211; m\u011b se to net\u00fdk\u00e1, pou\u017e\u00edv\u00e1m cache plugin a ten n\u00e1v\u0161t\u011bvn\u00edkovi nab\u00edz\u00ed ulo\u017eenou html str\u00e1nku, tak to plat\u00ed jen do chv\u00edle, ne\u017e se z\u00e1kazn\u00edk, nebo administr\u00e1tor p\u0159ihl\u00e1s\u00ed. V\u011bt\u0161ina plugin\u016f je nastaven\u00e1 tak, \u017ee p\u0159i p\u0159ihl\u00e1\u0161en\u00ed cache vyp\u00edn\u00e1.<\/p>\n<p>Pokud to mysl\u00edte s provozov\u00e1n\u00edm e-shop na WooCommerce v\u00e1\u017en\u011b, zkuste otestovat tento plugin, <strong>jen\u017e je zat\u00edm ve v\u00fdvoji<\/strong> &#8211;\u00a0https:\/\/github.com\/woocommerce\/woocommerce-product-tables-feature-plugin.<\/p>\n<p>D\u0159\u00edv nebo pozd\u011bji bude zaveden do j\u00e1dra WooCommerce, tak\u017ee je lep\u0161\u00ed se p\u0159ipravit a m\u016f\u017eete jej pou\u017e\u00edvat ji\u017e nyn\u00ed.<\/p>\n<p><strong>Upozorn\u011bn\u00ed:<\/strong> V \u017e\u00e1dn\u00e9m p\u0159\u00edpad\u011b nedoporu\u010duji, testovat jej na funk\u010dn\u00edm e-shop a bez z\u00e1loh datab\u00e1ze. Jde o plugin ve v\u00fdvoji a za p\u0159\u00edpadn\u00e9 \u0161kody nesete odpov\u011bdnost sami.<\/p>\n<p>Plugin do datab\u00e1ze p\u0159id\u00e1 nov\u00e9 tabulky, ud\u011blal jsem v\u00e1m screeny, aby jste v\u011bd\u011bli co se v\u00e1m vytvo\u0159\u00ed:<\/p>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/product-tables.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5109 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/product-tables.jpg\" alt=\"\" width=\"392\" height=\"183\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/product-tables.jpg 392w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/product-tables-300x140.jpg 300w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/a><\/p>\n<h2><strong>Tabulka wc_products<\/strong><\/h2>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_products_table.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5115 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_products_table.jpg\" alt=\"\" width=\"393\" height=\"739\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_products_table.jpg 393w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_products_table-160x300.jpg 160w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_products_table_indexes.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5116 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_products_table_indexes.jpg\" alt=\"\" width=\"192\" height=\"248\" \/><\/a><\/p>\n<p>Tabulka wc_product_attributes<\/p>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5111 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg\" alt=\"\" width=\"397\" height=\"508\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg 397w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes-234x300.jpg 234w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<p>Tabulka wc_product_attribute_values<\/p>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_variation_attribute_values.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5114 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_variation_attribute_values.jpg\" alt=\"\" width=\"492\" height=\"421\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_variation_attribute_values.jpg 492w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_variation_attribute_values-300x257.jpg 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/p>\n<p>Tabulka wc_product_downloads<\/p>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_downloads.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5112 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_downloads.jpg\" alt=\"\" width=\"363\" height=\"422\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_downloads.jpg 363w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_downloads-258x300.jpg 258w\" sizes=\"auto, (max-width: 363px) 100vw, 363px\" \/><\/a><\/p>\n<p>Tabulka wc_product_relationships<\/p>\n<p><a href=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_relationships.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5113 alignnone\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_relationships.jpg\" alt=\"\" width=\"383\" height=\"482\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_relationships.jpg 383w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_relationships-238x300.jpg 238w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/a><\/p>\n<p><strong>Doporu\u010den\u00e1 verze WooCommerce<\/strong> &#8211; 3.4.7 a vy\u0161\u0161\u00ed<\/p>\n<p><strong>Minim\u00e1ln\u00ed verze pro zkou\u0161en\u00ed<\/strong> 3.0 (2.6 je\u0161t\u011b nem\u00e1 CRUD a data-stores)<\/p>\n<p><strong>Zn\u00e1m\u00e9 bugy: <\/strong><\/p>\n<ul>\n<li>v administraci se nemus\u00ed zobrazovat n\u00e1hledy produkt\u016f &#8211; m\u011blo b\u00fdt odstran\u011bno ji\u017e ve verzi 3.5.1, zat\u00edm nen\u00ed<\/li>\n<li>pokud va\u0161e custom \u0161ablona pro z\u00edsk\u00e1n\u00ed obr\u00e1zku produktu nepou\u017e\u00edv\u00e1 $product-&gt;get_image_id, ale has_post_humbnail, obr\u00e1zek se nena\u010dte<\/li>\n<\/ul>\n<p>O data stores a CRUD ve WooCommerce budu mluvit na \u0161kolen\u00ed pro v\u00fdvoj\u00e1\u0159e 19.2. v Praze a 21.2. v Brn\u011b &#8211;\u00a0<a href=\"https:\/\/toret.cz\/woocommerce-pro-vyvojare-skoleni\/\" target=\"_blank\" rel=\"noopener\">https:\/\/toret.cz\/woocommerce-pro-vyvojare-skoleni\/ <\/a><\/p>\n<p>Potkat mne m\u016f\u017eete tak\u00e9 na Pra\u017esk\u00e9m WordCampu<\/p>\n<p><a href=\"https:\/\/2019.prague.wordcamp.org\/prednasejici\/#wcorg-speaker-vladislav-musilek\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5119 size-full\" src=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wpcamp2019_320x100.jpg\" alt=\"Prague WordCamp 2019\" width=\"320\" height=\"100\" srcset=\"https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wpcamp2019_320x100.jpg 320w, https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wpcamp2019_320x100-300x94.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jedna z v\u011bc\u00ed, kter\u00e1 je WordPressu vy\u010d\u00edt\u00e1no, pota\u017emo i pluginu WooCommerce, je struktura datab\u00e1ze. V podstat\u011b v\u0161echno co u produkt\u016f ulo\u017e\u00edte, jde do tabulky postmeta. Co\u017e je kolem 30 z\u00e1znam\u016f u ka\u017ed\u00e9ho produktu, nebo varianty. A to nepo\u010d\u00edt\u00e1me dal\u0161\u00ed pluginy, transienty a podobn\u011b. Velmi lehce se dostanete na 50 polo\u017eek u ka\u017ed\u00e9ho produktu. K tomu<\/p>\n","protected":false},"author":1,"featured_media":5111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[25,27],"tags":[425],"class_list":["post-5108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce","category-woocommerce-pluginy","tag-woocommerce"],"acf":[],"uagb_featured_image_src":{"full":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg",397,508,false],"thumbnail":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes-150x150.jpg",150,150,true],"medium":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes-234x300.jpg",234,300,true],"medium_large":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg",397,508,false],"large":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg",397,508,false],"1536x1536":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg",397,508,false],"2048x2048":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes.jpg",397,508,false],"archive-list":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2018\/12\/wc_product_attributes-397x265.jpg",397,265,true]},"uagb_author_info":{"display_name":"Affinite","author_link":"https:\/\/affinite.io\/cs\/author\/affinite\/"},"uagb_comment_info":0,"uagb_excerpt":"Jedna z v\u011bc\u00ed, kter\u00e1 je WordPressu vy\u010d\u00edt\u00e1no, pota\u017emo i pluginu WooCommerce, je struktura datab\u00e1ze. V podstat\u011b v\u0161echno co u produkt\u016f ulo\u017e\u00edte, jde do tabulky postmeta. Co\u017e je kolem 30 z\u00e1znam\u016f u ka\u017ed\u00e9ho produktu, nebo varianty. A to nepo\u010d\u00edt\u00e1me dal\u0161\u00ed pluginy, transienty a podobn\u011b. Velmi lehce se dostanete na 50 polo\u017eek u ka\u017ed\u00e9ho produktu. K tomu","_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/5108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=5108"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/5108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/5111"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=5108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=5108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=5108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}