{"id":6472,"date":"2021-11-15T08:33:00","date_gmt":"2021-11-15T08:33:00","guid":{"rendered":"https:\/\/musilda.cz\/?p=6472"},"modified":"2021-11-15T08:33:00","modified_gmt":"2021-11-15T08:33:00","slug":"detekce-existence-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/detekce-existence-woocommerce\/","title":{"rendered":"Detekce existence WooCommerce"},"content":{"rendered":"\n

Kdykoliv p\u00ed\u0161ete n\u011bjak\u00fd k\u00f3d, u kter\u00e9ho jeho funk\u010dnost z\u00e1vis\u00ed na k\u00f3du t\u0159et\u00ed strany, mus\u00edte po\u010d\u00edtat s t\u00edm, \u017ee nebude dostupn\u00fd. Proto je nezbytn\u00e9 u k\u00f3du pro WooCommerce \u0159e\u0161it to, zda je v\u016fbec plugin nainstalov\u00e1n a aktivn\u00ed. <\/p>\n\n\n\n

Zase nejde o nic slo\u017eit\u00e9ho, ide\u00e1ln\u00ed pro uk\u00e1zku bude n\u011bjak\u00fd plugin, kter\u00fd si vyrob\u00edme. <\/p>\n\n\n\n

Vzal jsem k\u00f3d ze v\u010derej\u0161\u00edho n\u00e1vodu https:\/\/musilda.cz\/jak-vytvorit-vlastni-typ-produktu\/<\/a> a ud\u011blal z n\u011bj mal\u00fd plugin. <\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

Bohu\u017eel, je pln\u011b z\u00e1visl\u00fd na WooCommerce, tak\u017ee p\u0159i pokusu o aktivaci se stane toto:<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

To je ta lep\u0161\u00ed varianta, plugin nejde aktivovat. V p\u0159\u00edpad\u011b, \u017ee je ji\u017e aktivn\u00ed a n\u011bkdo vypne WooCommerce, chyba sund\u00e1 cel\u00fd web. A tomu te\u010f zabr\u00e1n\u00edme. <\/p>\n\n\n\n

M\u016f\u017eeme pou\u017e\u00edt dv\u011b PHP funkce:<\/p>\n\n\n\n