woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.33k stars 10.75k forks source link

Variable Items display without Tax suffix on Products Page #14839

Closed AlmostMagic closed 7 years ago

AlmostMagic commented 7 years ago

EXPLANATION OF THE ISSUE

Variable Items display without Tax suffix on Products Page. Simple products display fine. See screenshot.

STEPS TO REPRODUCE THE ISSUE

Create Variable products Set Woocommerce Tax setting suffix to: (excl. VAT) {price_including_tax} (incl. VAT)

SYSTEM STATUS

`

WordPress Environment

Home URL: https://raisingrobots.com Site URL: https://raisingrobots.com WC Version: 3.0.5 Log Directory Writable: ✔ WP Version: 4.7.4 WP Multisite: – WP Memory Limit: 768 MB WP Debug Mode: – WP Cron: ✔ Language: en_GB

Server Environment

Server Info: Apache PHP Version: 7.0.18 PHP Post Max Size: 128 MB PHP Time Limit: 120 PHP Max Input Vars: 3000 cURL Version: 7.53.0 OpenSSL/1.0.2k

SUHOSIN Installed: – MySQL Version: 5.6.28 Max Upload Size: 128 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔

Database

WC Database Version: 3.0.5 WC Database Prefix: wptz_ woocommerce_sessions: ✔ woocommerce_api_keys: ✔ woocommerce_attribute_taxonomies: ✔ woocommerce_downloadable_product_permissions: ✔ woocommerce_order_items: ✔ woocommerce_order_itemmeta: ✔ woocommerce_tax_rates: ✔ woocommerce_tax_rate_locations: ✔ woocommerce_shipping_zones: ✔ woocommerce_shipping_zone_locations: ✔ woocommerce_shipping_zone_methods: ✔ woocommerce_payment_tokens: ✔ woocommerce_payment_tokenmeta: ✔ MaxMind GeoIP Database: ✔

Security

Secure connection (HTTPS): ✔ Hide errors from visitors: ✔

Active Plugins (36)

AfterShip - WooCommerce Tracking: by AfterShip – 1.6.8 All In One SEO Pack: by Michael Torbert – 2.3.12.4 Check Email: by Chris Taylor – 0.5.5 Contact Form 7: by Takayuki Miyoshi – 4.7 Decent Comments: by itthinx – 1.3.11 Duplicate Page: by mndpsingh287 – 2.3 Flamingo: by Takayuki Miyoshi – 1.5 Google XML Sitemaps: by Arne Brachhold – 4.0.8 Import users from CSV with meta: by codection – 1.10.6.2 Instagram Feed: by Smash Balloon – 1.4.8 MailChimp for WordPress: by ibericode – 4.1.1 Maintenance: by fruitfulcode – 3.4.1 Members: by Justin Tadlock – 1.1.3 Nextend Facebook Connect: by Nextendweb – 2.0.2 Nextend Google Connect: by Roland Soos Jamie Bainbridge – 1.6.1

Open in New Window Plugin: by Keith P. Graham – 2.4 Really Simple CSV Importer: by Takuro Hishikawa – 1.3 Really Simple SSL: by Rogier Lankhorst – 2.5.13 reGenerate Thumbnails - advanced: by turcuciprian – 1.4.3.2 Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6 Slimpack: by Tunghsiao Liu – 1.0.17 Smart Manager: by StoreApps – 3.9.21 Theme Check: by Otto42 pross – 20160523.1

UpdraftPlus - Backup/Restore: by UpdraftPlus.Com DavidAnderson – 1.12.40

WooCommerce Stripe Gateway: by WooCommerce – 3.1.7 WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 1.6.5 WooCommerce PDF Invoices & Packing Slips to Dropbox: by Ewout Fernhout – 1.6.0 WooCommerce PDF Invoices & Packing Slips Professional: by Ewout Fernhout – 1.5.1 WooCommerce PDF Invoices & Packing Slips Premium Templates: by Ewout Fernhout – 2.3.0 WooCommerce: by Automattic – 3.0.5 WooSidebars: by WooThemes – 1.4.3 Wordfence Security: by Wordfence – 6.3.7 WP Support Plus: by Pradeep Makone – 8.0.6 Forum - wpForo: by gVectors Team (A. Chakhoyan R. Hovhannisyan) – 1.2.0

WP Support Plus Email Pipe: by Pradeep Makone – 1.0.9 YITH WooCommerce Wishlist: by YITHEMES – 2.1.1

Settings

API Enabled: ✔ Force SSL: – Currency: GBP (£) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5)

WC Pages

Shop base: #5 - /shop/ Basket: #6 - /cart/ Checkout: #7 - /checkout/ My account: #8 - /my-account/

Theme

Name: Flatsome Child Version: 3.0 Author URL: Child Theme: ✔ Parent Theme Name: Flatsome Parent Theme Version: 3.3.4 Parent Theme Author URL: http://www.uxthemes.com/ WooCommerce Support: ✔

Templates

Overrides: flatsome/woocommerce/archive-product.php flatsome/woocommerce/cart/cart-empty.php flatsome/woocommerce/cart/cart.php flatsome/woocommerce/checkout/form-checkout.php flatsome/woocommerce/checkout/form-coupon.php flatsome/woocommerce/checkout/thankyou.php flatsome/woocommerce/content-product.php flatsome/woocommerce/content-product_cat.php flatsome/woocommerce/content-single-product.php flatsome-child/woocommerce/emails/admin-cancelled-order.php flatsome-child/woocommerce/emails/admin-failed-order.php flatsome-child/woocommerce/emails/admin-new-order.php flatsome-child/woocommerce/emails/customer-completed-order.php flatsome-child/woocommerce/emails/customer-new-account.php flatsome-child/woocommerce/emails/customer-note.php flatsome-child/woocommerce/emails/customer-on-hold-order.php flatsome-child/woocommerce/emails/customer-processing-order.php flatsome-child/woocommerce/emails/customer-refunded-order.php flatsome-child/woocommerce/emails/customer-reset-password.php flatsome/woocommerce/global/breadcrumb.php flatsome/woocommerce/global/quantity-input.php flatsome/woocommerce/global/wrapper-end.php flatsome/woocommerce/global/wrapper-start.php flatsome/woocommerce/loop/loop-end.php flatsome/woocommerce/loop/loop-start.php flatsome/woocommerce/loop/orderby.php flatsome/woocommerce/loop/pagination.php flatsome/woocommerce/loop/result-count.php flatsome/woocommerce/loop/sale-flash.php flatsome/woocommerce/myaccount/form-login.php flatsome/woocommerce/myaccount/navigation.php flatsome/woocommerce/notices/error.php flatsome/woocommerce/notices/notice.php flatsome/woocommerce/notices/success.php flatsome/woocommerce/product-searchform.php flatsome/woocommerce/single-product/photoswipe.php flatsome/woocommerce/single-product/price.php flatsome/woocommerce/single-product/product-image.php flatsome/woocommerce/single-product/product-thumbnails.php flatsome/woocommerce/single-product/related.php flatsome/woocommerce/single-product/review.php flatsome/woocommerce/single-product/sale-flash.php flatsome/woocommerce/single-product/share.php flatsome/woocommerce/single-product/short-description.php flatsome/woocommerce/single-product/tabs/tabs.php flatsome/woocommerce/single-product/title.php flatsome/woocommerce/single-product/up-sells.php flatsome/woocommerce/single-product-reviews.php flatsome/woocommerce/single-product.php

`

screen shot 2017-05-02 at 19 31 57 screen shot 2017-05-02 at 19 31 57
mikejolley commented 7 years ago

See the note here - suffixes cannot be shown accurately at variable product level (but are shown per variation):

https://github.com/woocommerce/woocommerce/blob/a6329fa68c90f6cbddd6cf16991bcb64252914ac/includes/class-wc-product-variable.php#L121-L125

Use the filter in that method if you want to force it programmatically.

Ramon18189 commented 6 years ago

@mikejolley

Use the filter in that method if you want to force it programmatically.

Hello Mike, where can I find the filter you mentioned?

Thanks

Best regards

mikejolley commented 6 years ago

It's called woocommerce_get_price_html

dianaricci commented 6 years ago

Hi mike. I have the same problems, I need to display my custom suffix to variable products. From which line to which line of your code should I replace?

peterfabian commented 6 years ago

Hi @dianaricci ,

you can use filter woocommerce_get_price_html to change how the price is displayed.

How filters work is explained for example here: https://developer.wordpress.org/reference/functions/add_filter/

Cheers.