Skip to content

Supported TaxZone in priceIncTax methods.#2406

Closed
MacTavish-69 wants to merge 2 commits intolunarphp:1.xfrom
MacTavish-69:patch-1
Closed

Supported TaxZone in priceIncTax methods.#2406
MacTavish-69 wants to merge 2 commits intolunarphp:1.xfrom
MacTavish-69:patch-1

Conversation

@MacTavish-69
Copy link
Copy Markdown
Contributor

@MacTavish-69 MacTavish-69 commented Feb 4, 2026

Added optional TaxZone parameter to priceIncTax, comparePriceIncTax, and getPriceableTaxRate methods to allow tax calculations based on specific tax zones.

Details

Lunar internally worked on default tax and default tax zone basis only. With this PR, we can provide our own determined tax zone (typically IP -> Country -> Tax Zone) and provide it to the method to show us tax inclusive prices.

Unless custom Tax zone is provided, the method continues to behave as normal and previously.

Documentation Update Link will be added after generation of this PR.

Added optional TaxZone parameter to priceIncTax, comparePriceIncTax, and getPriceableTaxRate methods to allow tax calculations based on specific tax zones.
@github-project-automation github-project-automation bot moved this to Todo in Roadmap Feb 4, 2026
MacTavish-69 added a commit to MacTavish-69/docs that referenced this pull request Feb 4, 2026
Added additional example for Tax Incl Price based on PR: lunarphp/lunar#2406
glennjacobs pushed a commit to lunarphp/docs that referenced this pull request Feb 26, 2026
)

Added additional example for Tax Incl Price based on PR: lunarphp/lunar#2406
glennjacobs added a commit to lunarphp/docs that referenced this pull request Feb 26, 2026
* Fixed typo in ## Determining cart changes (#8)

* Update overview.mdx (#7)

ProductOption{r}Resource > ProductOptionResource

* Fix grammatical error in storefront session documentation (#6)

Removed type "a"

* Added info about Root Collection in collections#add-a-child-collection (#10)

* Added info about Root Collection in collections#add-a-child-collection

* Added Warning about "name" being used internally from Attribute Data, in collections#create-a-collection

* Added notes about "name" attribute data being used internally (#9)

* Added notes about "name" attribute data being used internally

* Converted the added Note to "Warning"

* Add upgrade docs

* Lessen to low impact

* tweak wording

* Update installation.mdx

* Update installation.mdx

* Update table-rate-shipping.mdx

* Add page titles to support LLMS.txt

* Update CLAUDE.md

* Update CLAUDE.md

* Update CLAUDE.md

* Update CLAUDE.md

* Update CLAUDE.md

* Update CLAUDE.md

* Update CLAUDE.md

* Fix composer require command syntax (#16)

* Fix space after comma (#14)

* Update products.mdx with price method. Related to PR in Lunar Core, (#15)

Added additional example for Tax Incl Price based on PR: lunarphp/lunar#2406

* Addresses (#18)

* Update addresses.mdx

* Update addresses.mdx

* Update addresses.mdx

* Move countries and states

* Update addresses.mdx

* Carts (#19)

* Update carts.mdx

* Code fixes

* Update carts.mdx

* Update carts.mdx

* Update carts.mdx

* Update carts.mdx

* Update carts.mdx

* Update carts.mdx

* Update carts.mdx

* Update carts.mdx

* Customers (#20)

* Update customers.mdx

* Update customers.mdx

* Update customers.mdx

* Update customers.mdx

* Update discounts.mdx (#21)

* Update orders.mdx (#22)

* Update payments.mdx (#23)

* Update pricing.mdx (#24)

* Guides (#25)

* PDP

* Initial guide concepts

* Code fixes

* Basic guides

* More guides

* Update search.mdx

* Search add-on (fixes) (#26)

* Update search.mdx

* Update search.mdx

* Update table-rate-shipping.mdx (#27)

---------

Co-authored-by: Mac Tavish <49161243+MacTavish-69@users.noreply.github.com>
Co-authored-by: Waspar <1203589+waspar@users.noreply.github.com>
Co-authored-by: wupangyen <72144016+wupangyen@users.noreply.github.com>
Co-authored-by: Alec Ritson <hello@itsalec.co.uk>
Co-authored-by: Alec Garcia <alec@hyrograsper.com>
Co-authored-by: Samuel <ratto_trash@hotmail.it>
@alecritson alecritson requested a review from glennjacobs March 31, 2026 07:06
{
return Blink::once('price_tax_rate_'.$this->priceable->getTaxClass()->id, function () {
$taxZone = TaxZone::where('default', '=', 1)->first();
/* This function is called multiple times somewhere from the package and since we just added an optional
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alecritson not sure we want to leave this comment in the code

Copy link
Copy Markdown
Contributor Author

@MacTavish-69 MacTavish-69 Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this PR in favor of #2411 , because this functionality is present in the newer PR as well.

This PR/Code was our earlier solution to show Tax Incl. Prices but it wouldn't work on cart items. It would only be applicable on Models which had price attached to them.

@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants