{"id":1051,"date":"2024-04-16T20:02:17","date_gmt":"2024-04-16T11:02:17","guid":{"rendered":"http:\/\/inwelly.com\/?p=1051"},"modified":"2024-04-23T05:34:09","modified_gmt":"2024-04-22T20:34:09","slug":"wordpress-woocommerce-settings-tax-%eb%a9%94%eb%89%b4-%ec%b6%94%ea%b0%80","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=1051","title":{"rendered":"wordpress woocommerce > settings > tax \uba54\ub274 \ucd94\uac00"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>classMainextendsBridge<\/p>\n\n\n\n<p>{ \/** Display Price and Tax *\/<\/p>\n\n\n\n<p>$this-&gt;add_filter(<\/p>\n\n\n\n<p>&#8216;woocommerce_get_sections_tax&#8217;,<\/p>\n\n\n\n<p>&#8216;WooComInfusionSettingTax@showTab&#8217;<\/p>\n\n\n\n<p>);<\/p>\n\n\n\n<p>$this-&gt;add_filter(<\/p>\n\n\n\n<p>&#8216;woocommerce_get_settings_tax&#8217;,<\/p>\n\n\n\n<p>&#8216;WooComInfusionSettingTax@showForm&#8217;,<\/p>\n\n\n\n<p>10,<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>);<br><br>&#8230;..<br>}<br><br><br><br><\/p>\n\n\n\n<p>classWooComInfusionSettingTaxextendsController<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>const SECTION_ID = &#8216;wc_dispaly_price_tax&#8217;;<\/p>\n\n\n\n<p>const SECTION_NAME = &#8216;Display Inc\/Exc Price,Tax&#8217;;<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>* @since 1.0.2<\/p>\n\n\n\n<p>*<\/p>\n\n\n\n<p>*<\/p>\n\n\n\n<p>* @return<\/p>\n\n\n\n<p>*\/<\/p>\n\n\n\n<p>publicfunctionshowTab($sections)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>$sections[self::SECTION_ID] = self::SECTION_NAME;<\/p>\n\n\n\n<p>return$sections;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>* @since 1.0.2<\/p>\n\n\n\n<p>*<\/p>\n\n\n\n<p>*<\/p>\n\n\n\n<p>* @return<\/p>\n\n\n\n<p>*\/<\/p>\n\n\n\n<p>publicfunctionshowForm($settings, $current_section)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>if($current_section != self::SECTION_ID)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>return$settings;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>$settings[] = [<\/p>\n\n\n\n<p>&#8216;id&#8217; =&gt; self::SECTION_ID,<\/p>\n\n\n\n<p>&#8216;name&#8217; =&gt; &#8216;Display Price,Tax&#8217;,<\/p>\n\n\n\n<p>&#8216;type&#8217; =&gt; &#8216;title&#8217;,<\/p>\n\n\n\n<p>&#8216;desc&#8217; =&gt; &#8216;Settings display price and tax according to user.&#8217;,<\/p>\n\n\n\n<p>];<\/p>\n\n\n\n<p>$settings[] = [<\/p>\n\n\n\n<p>&#8216;id&#8217; =&gt; self::SECTION_ID . &#8216;_select_scenarios&#8217;,<\/p>\n\n\n\n<p>&#8216;name&#8217; =&gt; &#8216;Show Scenario&#8217;,<\/p>\n\n\n\n<p>&#8216;type&#8217; =&gt; &#8216;select&#8217;,<\/p>\n\n\n\n<p>&#8216;desc&#8217; =&gt; __( &#8216;Set #1,2 in &#8220;Tax &gt; Tax options&#8221; and in order to use #3, it must be excluded tax in &#8220;Tax options(Display prices)&#8221; &#8216;, &#8216;woocommerce&#8217; ),<\/p>\n\n\n\n<p>&#8216;desc_tip&#8217; =&gt; true,<\/p>\n\n\n\n<p>&#8216;options&#8217; =&gt; array(<\/p>\n\n\n\n<p>&#8221; =&gt;&#8217;1,2.Show GST inc or exc (guest +loged in)&#8217;,<\/p>\n\n\n\n<p>&#8216;scenario_3&#8242; =&gt;&#8217;3.Show GST inc pricing to guest, show GST exc pricing to logged in users&#8217;,<\/p>\n\n\n\n<p>),<\/p>\n\n\n\n<p>];<\/p>\n\n\n\n<p>$settings[] = [<\/p>\n\n\n\n<p>&#8216;id&#8217; =&gt; self::SECTION_ID . &#8216;_suffix_inc_gst&#8217;,<\/p>\n\n\n\n<p>&#8216;name&#8217; =&gt; &#8216;Price display include GST&#8217;,<\/p>\n\n\n\n<p>&#8216;type&#8217; =&gt; &#8216;text&#8217;,<\/p>\n\n\n\n<p>&#8216;desc&#8217; =&gt; __( &#8216;It only affects the &#8220;show scenario 3&#8221; &#8216;, &#8216;woocommerce&#8217; ),<\/p>\n\n\n\n<p>&#8216;desc_tip&#8217; =&gt; true,<\/p>\n\n\n\n<p>&#8216;css&#8217; =&gt; &#8216;min-width:300px;&#8217;,<\/p>\n\n\n\n<p>];<\/p>\n\n\n\n<p>$settings[] = [<\/p>\n\n\n\n<p>&#8216;id&#8217; =&gt; self::SECTION_ID . &#8216;_suffix_exc_gst&#8217;,<\/p>\n\n\n\n<p>&#8216;name&#8217; =&gt; &#8216;Price display exclude GST&#8217;,<\/p>\n\n\n\n<p>&#8216;type&#8217; =&gt; &#8216;text&#8217;,<\/p>\n\n\n\n<p>&#8216;desc&#8217; =&gt; __( &#8216;It only affects the &#8220;show scenario 3&#8221; &#8216;, &#8216;woocommerce&#8217; ),<\/p>\n\n\n\n<p>&#8216;desc_tip&#8217; =&gt; true,<\/p>\n\n\n\n<p>&#8216;css&#8217; =&gt; &#8216;min-width:300px;&#8217;,<\/p>\n\n\n\n<p>];<\/p>\n\n\n\n<p>\/\/ Price display suffix<\/p>\n\n\n\n<p>$settings[] = [<\/p>\n\n\n\n<p>&#8216;type&#8217; =&gt; &#8216;sectionend&#8217;,<\/p>\n\n\n\n<p>&#8216;id&#8217; =&gt; self::SECTION_ID,<\/p>\n\n\n\n<p>];<\/p>\n\n\n\n<p>return$settings;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>}<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>classMainextendsBridge { \/** Display Price and Tax *\/ $this-&gt;add_filter( &#8216;woocommerce_get_sections_tax&#8217;, &#8216;WooComInfusionSettingTax@showTab&#8217; ); $this-&gt;add_filter( &#8216;woocommerce_get_settings_tax&#8217;, &#8216;WooComInfusionSettingTax@showForm&#8217;, 10, 2 ); &#8230;..} classWooComInfusionSettingTaxextendsController [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1250,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[109],"tags":[],"class_list":["post-1051","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/1051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1051"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/1051\/revisions"}],"predecessor-version":[{"id":1052,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/1051\/revisions\/1052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/media\/1250"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}