{"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\"> <\/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\"> <\/th>\n<\/tr><\/code><\/pre>\n\n\n\nA 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\nA tady m\u00e1me v\u00fdsledek:<\/p>\n\n\n\n