{"id":6402,"date":"2021-10-22T15:04:00","date_gmt":"2021-10-22T15:04:00","guid":{"rendered":"https:\/\/musilda.cz\/?p=6402"},"modified":"2021-10-22T15:04:00","modified_gmt":"2021-10-22T15:04:00","slug":"zobrazeni-ceny-polozky-v-kosiku-bez-dph","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/zobrazeni-ceny-polozky-v-kosiku-bez-dph\/","title":{"rendered":"Zobrazen\u00ed ceny polo\u017eky v ko\u0161\u00edku bez DPH"},"content":{"rendered":"\n

WooCommerce s dan\u011bmi a jejich zobrazov\u00e1n\u00edm pracuje tak n\u011bjak p\u0159es ruku. V z\u00e1kladu ukazuje polo\u017eku ko\u0161\u00edku s cenou v\u010detn\u011b dan\u011b. <\/p>\n\n\n\n

Uk\u00e1\u017eeme si, jak p\u0159idat do tabulky ko\u0161\u00edku polo\u017eku ceny bez DPH. <\/p>\n\n\n\n

Mus\u00edm upozornit na to, \u017ee \u00faprava m\u00e1 jednu chybu. Nen\u00ed zcela univerz\u00e1ln\u00ed, proto\u017ee p\u0159edpokl\u00e1d\u00e1, \u017ee na e-shopu se s dan\u00ed pracuje. Na e-shopu, kter\u00fd nem\u00e1 DPH nastaveno nebude logicky fungovat. <\/p>\n\n\n\n

Otev\u0159eme si ve slo\u017ece \u0161ablony soubor cart.php a v n\u011bm uprav\u00edme k\u00f3d takto:<\/p>\n\n\n\n

<tr>\n\t<th class=\"product-thumbnail\">&nbsp;<\/th>\n\t<th class=\"product-name\"><?php esc_html_e( 'Product', 'woocommerce' ); ?><\/th>\n\t<th class=\"product-price\"><?php esc_html_e( 'Price', 'woocommerce' ); ?><\/th>\n\t<th class=\"product-quantity\"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?><\/th>\n\t<th class=\"product-subtotal\"><?php esc_html_e( 'Celkem bez DPH', 'woocommerce' ); ?><\/th>\n\t<th class=\"product-subtotal\"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?><\/th>\n\t<th class=\"product-remove\">&nbsp;<\/th>\n<\/tr><\/code><\/pre>\n\n\n\n

A v \u0159\u00e1dku tabulky p\u0159id\u00e1me bu\u0148ku:<\/p>\n\n\n\n

..............\n\n<td class=\"product-subtotal\" data-title=\"<?php esc_attr_e( 'Celkem bez DPH', 'musilda' ); ?>\">\n\t<?php\n\t\t$row_price = wc_get_price_excluding_tax( $_product, array( 'qty' => $cart_item['quantity'] ) );\n\t\techo wc_price( $row_price );\n\t?>\n<\/td>\n\n<td class=\"product-subtotal\" data-title=\"<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>\">\n\n..............<\/code><\/pre>\n\n\n\n

A tady m\u00e1me v\u00fdsledek:<\/p>\n\n\n\n

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

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

WooCommerce s dan\u011bmi a jejich zobrazov\u00e1n\u00edm pracuje tak n\u011bjak p\u0159es ruku. V z\u00e1kladu ukazuje polo\u017eku ko\u0161\u00edku s cenou v\u010detn\u011b dan\u011b. Uk\u00e1\u017eeme si, jak p\u0159idat do tabulky ko\u0161\u00edku polo\u017eku ceny bez DPH. Mus\u00edm upozornit na to, \u017ee \u00faprava m\u00e1 jednu chybu. Nen\u00ed zcela univerz\u00e1ln\u00ed, proto\u017ee p\u0159edpokl\u00e1d\u00e1, \u017ee na e-shopu se s dan\u00ed pracuje. Na e-shopu, kter\u00fd<\/p>\n","protected":false},"author":1,"featured_media":5600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-6402","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\/6402"}],"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=6402"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6402\/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=6402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=6402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=6402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}