{"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":"

Jedna z v\u011bc\u00ed, kter\u00e1 je WordPressu vy\u010d\u00edt\u00e1no, pota\u017emo i 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

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 miliony z\u00e1znam\u016f<\/strong>.<\/p>\n

Prvn\u00edm krokem, jak tento probl\u00e9m \u0159e\u0161it, alespo\u0148 z \u010d\u00e1sti, bylo zaveden\u00ed CRUD<\/strong> a 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

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 – 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

Pokud to mysl\u00edte s provozov\u00e1n\u00edm e-shop na WooCommerce v\u00e1\u017en\u011b, zkuste otestovat tento plugin, jen\u017e je zat\u00edm ve v\u00fdvoji<\/strong> –\u00a0https:\/\/github.com\/woocommerce\/woocommerce-product-tables-feature-plugin.<\/p>\n

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

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

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

\"\"<\/a><\/p>\n

Tabulka wc_products<\/strong><\/h2>\n

\"\"<\/a><\/p>\n

\"\"<\/a><\/p>\n

Tabulka wc_product_attributes<\/p>\n

\"\"<\/a><\/p>\n

Tabulka wc_product_attribute_values<\/p>\n

\"\"<\/a><\/p>\n

Tabulka wc_product_downloads<\/p>\n

\"\"<\/a><\/p>\n

Tabulka wc_product_relationships<\/p>\n

\"\"<\/a><\/p>\n

Doporu\u010den\u00e1 verze WooCommerce<\/strong> – 3.4.7 a vy\u0161\u0161\u00ed<\/p>\n

Minim\u00e1ln\u00ed verze pro zkou\u0161en\u00ed<\/strong> 3.0 (2.6 je\u0161t\u011b nem\u00e1 CRUD a data-stores)<\/p>\n

Zn\u00e1m\u00e9 bugy: <\/strong><\/p>\n