{"id":54395,"date":"2021-09-13T10:58:21","date_gmt":"2021-09-13T16:58:21","guid":{"rendered":"https:\/\/help.foosales.com\/?post_type=docs&#038;p=54395"},"modified":"2026-07-27T13:41:52","modified_gmt":"2026-07-27T19:41:52","slug":"proc-se-pri-pokusu-o-pripojeni-k-memu-obchodu-zobrazi-chyba-site","status":"publish","type":"docs","link":"https:\/\/help.foosales.com\/cs\/docs\/frequently-asked-questions\/errors\/why-do-i-get-a-network-error-when-trying-to-connect-to-my-store\/","title":{"rendered":"Pro\u010d se p\u0159i pokusu o p\u0159ipojen\u00ed k m\u00e9mu obchodu zobraz\u00ed chyba s\u00edt\u011b?"},"content":{"rendered":"<p>Pokud dost\u00e1v\u00e1te <strong>chyba s\u00edt\u011b<\/strong> kdy\u017e <strong>p\u0159ipojen\u00ed k va\u0161emu obchodu<\/strong>, m\u016f\u017ee b\u00fdt konfigurace serveru, kter\u00e1 br\u00e1n\u00ed odesl\u00e1n\u00ed po\u017eadavku, nebo mo\u017en\u00e1 n\u011bjak\u00e1 jin\u00e1 chyba, kter\u00e1 se vyskytla ve va\u0161em backendu WordPress.<\/p>\n<p>Chcete-li zkontrolovat, zda do\u0161lo k chyb\u011b WordPress, kter\u00e1 zp\u016fsobila selh\u00e1n\u00ed p\u0159ipojen\u00ed, m\u016f\u017eete otev\u0159\u00edt ovl\u00e1dac\u00ed panel spr\u00e1vce WordPress a p\u0159ej\u00edt na adresu. <strong>WooCommerce <\/strong>-&gt;<strong> Stav <\/strong>-&gt;<strong> Protokoly<\/strong> a prohl\u00e9dnout si nejnov\u011bj\u0161\u00ed <a href=\"https:\/\/woocommerce.com\/document\/finding-php-error-logs\/#woocommerce-fatal-errors-log\" target=\"_blank\" rel=\"noopener\">protokol fat\u00e1ln\u00edch chyb<\/a>. Odtud byste m\u011bli b\u00fdt schopni zjistit, zda se vyskytly n\u011bjak\u00e9 chyby souvisej\u00edc\u00ed s FooSales nebo p\u0159\u00edpadn\u011b konflikt s jin\u00fdm z\u00e1suvn\u00fdm modulem. Pokud se neobjev\u00ed \u017e\u00e1dn\u00e9 chyby nebo se nezd\u00e1, \u017ee by n\u011bco souviselo s FooSales, pak je mo\u017en\u00e9, \u017ee odesl\u00e1n\u00ed po\u017eadavku br\u00e1n\u00ed konfigurace serveru.<\/p>\n<p>If you are not using web app that is bundled with the FooSales plugin on your own site and are using the hosted web app at <em>https:\/\/web.foosales.com<\/em>, FooSales will to your store from a domain that is different from your domain. Requests between different domains are known as <strong>po\u017eadavky na sd\u00edlen\u00ed zdroj\u016f nap\u0159\u00ed\u010d p\u016fvodem (CORS).<\/strong>. V\u00e1\u0161 server mus\u00ed tyto typy po\u017eadavk\u016f speci\u00e1ln\u011b povolit. Obvykle jsou servery ji\u017e nastaveny tak, aby tyto po\u017eadavky p\u0159ij\u00edmaly a vracely odpov\u011bdi s p\u0159\u00edslu\u0161n\u00fdmi hlavi\u010dkami, ale n\u011bkter\u00e9 servery mohou b\u00fdt nakonfigurov\u00e1ny tak, aby je blokovaly. V\u00e1\u0161 prohl\u00ed\u017ee\u010d bude <strong>zabr\u00e1nit po\u017eadavku<\/strong> z dokon\u010den\u00ed, pokud odpov\u011b\u010f nem\u00e1 hodnotu <strong>po\u017eadovan\u00e9 hlavi\u010dky<\/strong>.<\/p>\n<p>V\u00e1\u0161 server mus\u00ed vr\u00e1tit <strong>Z\u00e1hlav\u00ed Access-Control-Allow-Origin<\/strong> kter\u00fd umo\u017e\u0148uje spole\u010dnosti FooSales odes\u00edlat data do va\u0161eho obchodu. M\u016f\u017eete zkusit p\u0159idat n\u00e1sleduj\u00edc\u00ed k\u00f3d do t\u00e9matu WordPress. <strong>functions.php<\/strong> a zjistit, zda to n\u011bco zm\u011bn\u00ed:<\/p>\n<pre>funkce add_foosales_cors_http_header(){\r\n    header(\"Access-Control-Allow-Origin: https:\/\/web.foosales.com\");\r\n}\r\nadd_action('init','add_foosales_cors_http_header');<\/pre>\n<p>M\u016f\u017eete zkusit pou\u017e\u00edt\u00a0<strong>https:\/\/web.foosales.com<\/strong> nebo jednodu\u0161e <strong>*<\/strong> (hv\u011bzdi\u010dka, kter\u00e1 umo\u017e\u0148uje libovoln\u00fd p\u016fvod) jako hodnotu p\u016fvodu.<\/p>\n<p>Pokud v\u00fd\u0161e uveden\u00fd k\u00f3d nefunguje, m\u011bli byste b\u00fdt schopni zjistit, zda je tato hlavi\u010dka povolena a jak\u00e1 je jej\u00ed hodnota, pokud m\u00e1te p\u0159\u00edstup ke konfiguraci serveru. M\u016f\u017eete se tak\u00e9 obr\u00e1tit na sv\u016fj <strong>spr\u00e1vce serveru<\/strong> nebo <strong>webov\u00fd hostitel<\/strong> se zeptat na povolen\u00ed <strong>po\u017eadavky REST API nap\u0159\u00ed\u010d dom\u00e9nami<\/strong> pro FooSales. N\u011bkter\u00e9 prohl\u00ed\u017ee\u010de maj\u00ed tak\u00e9 nastaven\u00ed, kter\u00e9 m\u016f\u017eete upravit tak, aby tyto po\u017eadavky pro FooSales povolily. P\u0159\u00edpadn\u011b m\u016f\u017eete pou\u017e\u00edt <strong>proxy server<\/strong> kter\u00fd zaji\u0161\u0165uje, aby byly mezi va\u0161imi webov\u00fdmi str\u00e1nkami a FooSales nastaveny a vr\u00e1ceny v\u0161echny spr\u00e1vn\u00e9 hlavi\u010dky.<\/p>\n<p>We recommend using the web app that is bundled with the plugin by launching the POS directly from your WordPress admin dashboard. Authentication is handled automatically and and server requests will be made from the same domain, therefore eliminating any CORS issues.<\/p>","protected":false},"featured_media":0,"parent":485,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_is_vendor_doc":"0","footnotes":""},"doc_tag":[98,101,102,103,104,105,106,107,108,109,110,21,16],"class_list":["post-54395","docs","type-docs","status-publish","hentry","doc_tag-api","doc_tag-blocked","doc_tag-cors","doc_tag-cross-origin","doc_tag-headers","doc_tag-network-error","doc_tag-permission","doc_tag-post","doc_tag-proxy","doc_tag-request","doc_tag-rest","doc_tag-rest-api","doc_tag-web-app"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs\/54395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/comments?post=54395"}],"version-history":[{"count":2,"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs\/54395\/revisions"}],"predecessor-version":[{"id":56508,"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs\/54395\/revisions\/56508"}],"up":[{"embeddable":true,"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs\/485"}],"next":[{"title":"Pro\u010d se mi p\u0159i odes\u00edl\u00e1n\u00ed objedn\u00e1vky zobrazuje chyba s\u00edt\u011b?","link":"https:\/\/help.foosales.com\/cs\/docs\/frequently-asked-questions\/errors\/why-do-i-get-a-network-error-when-submitting-an-order\/","href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs\/1123"}],"prev":[{"title":"Why does FooSales lose its Bluetooth connection to my Star mPOP?","link":"https:\/\/help.foosales.com\/cs\/docs\/frequently-asked-questions\/errors\/why-does-foosales-lose-bluetooth-connection-to-my-star-mpop\/","href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/docs\/463"}],"wp:attachment":[{"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/media?parent=54395"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.foosales.com\/cs\/wp-json\/wp\/v2\/doc_tag?post=54395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}