{"id":6525,"date":"2021-11-27T16:23:31","date_gmt":"2021-11-27T16:23:31","guid":{"rendered":"https:\/\/musilda.cz\/?p=6525"},"modified":"2021-11-27T16:23:31","modified_gmt":"2021-11-27T16:23:31","slug":"jak-pridat-vlastni-razeni-produktu-v-e-shopu","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-pridat-vlastni-razeni-produktu-v-e-shopu\/","title":{"rendered":"Jak p\u0159idat vlastn\u00ed \u0159azen\u00ed produkt\u016f v e-shopu"},"content":{"rendered":"\n

Dostal jsem po\u017eadavek na p\u0159id\u00e1n\u00ed dal\u0161\u00ed mo\u017enosti volby \u0159azen\u00ed produkt\u016f v e-shopu. Krom\u011b voleb, kter\u00e9 jsou k dispozici po nainstalov\u00e1n\u00ed, cht\u011bl m\u00edt klient i volbu – Zobrazit produkty skladem. <\/p>\n\n\n\n

Na\u0161t\u011bst\u00ed je roz\u0161\u00ed\u0159en\u00ed roletky \u0159azen\u00ed pom\u011brn\u011b jednoduch\u00e9. Sta\u0159\u00ed v\u00e1m na to dv\u011b funkce.<\/p>\n\n\n\n

Prvn\u00ed p\u0159id\u00e1v\u00e1 dal\u0161\u00ed polo\u017eku do selectu:<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n
add_filter( 'woocommerce_default_catalog_orderby_options', 'musilda_add_stock_status_orderby' );\nadd_filter( 'woocommerce_catalog_orderby', 'musilda_add_stock_status_orderby' );\nfunction musilda_add_stock_status_orderby( $sortby ) {\n\n\t$sortby['stock_status'] = __( 'Zobrazit produkty skladem', 'musilda' );\n \treturn $sortby;\n\n}<\/code><\/pre>\n\n\n\n

Touto funkc\u00ed si m\u016f\u017eete roz\u0161\u00ed\u0159it v\u00fdb\u011br o jakoukoliv hodnotu, tak\u017ee jste schopni \u0159adit i t\u0159eba podle po\u010dtu prodej\u016f, \u010di jin\u00e9ho meta pole. <\/p>\n\n\n\n

A druhou funkci jsem ji\u017e psal zde https:\/\/musilda.cz\/jak-zobrazit-produkty-skladem-jako-prvni\/<\/a>, tak\u017ee ji jen dopln\u00edte a po v\u00fdb\u011bru \u0159azen\u00ed se v\u00e1m produkty v e-shopu set\u0159\u00edd\u00ed tak, \u017ee jako prvn\u00ed budou produkty skladem. <\/p>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

Dostal jsem po\u017eadavek na p\u0159id\u00e1n\u00ed dal\u0161\u00ed mo\u017enosti volby \u0159azen\u00ed produkt\u016f v e-shopu. Krom\u011b voleb, kter\u00e9 jsou k dispozici po nainstalov\u00e1n\u00ed, cht\u011bl m\u00edt klient i volbu – Zobrazit produkty skladem. Na\u0161t\u011bst\u00ed je roz\u0161\u00ed\u0159en\u00ed roletky \u0159azen\u00ed pom\u011brn\u011b jednoduch\u00e9. Sta\u0159\u00ed v\u00e1m na to dv\u011b funkce. Prvn\u00ed p\u0159id\u00e1v\u00e1 dal\u0161\u00ed polo\u017eku do selectu: Touto funkc\u00ed si m\u016f\u017eete roz\u0161\u00ed\u0159it v\u00fdb\u011br o<\/p>\n","protected":false},"author":1,"featured_media":5600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[29],"tags":[],"class_list":["post-6525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce-snippety"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6525"}],"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=6525"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/5600"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=6525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=6525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=6525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}