Skip to content

Massive Update: Breaking Changes / Less Bugs / Easier to Maintain

Compare
Choose a tag to compare
@lukepolo lukepolo released this 08 Jul 21:21

Hey All!

I want to start off with, I'm sorry. LaraCart has been needing some love lately, as they are numerous (but minor) bugs that made some significant changes on how taxes / discounts work in tandem.

That being said, I've started on a new version of the package that should solve the broad cases of taxation / discount issues.

To Summarize what has changed:

Totals / SubTotals

The sub totals / totals / net totals were filled with passable arguments to have tax / formatting and more. This cause maintablity issues as they weren't turley sub totals in some ways.

These have been revamped to only be singular. They will only show the proper sub totals etc. If a function needed an extra param those were removed and renamed

Item / Sub Items

Price use to be the sub total and now has been converted just to be the actual price (silly of me right?) .

Taxation / Discounts

Firstly, based on the most used practice taxation happens AFTER discounts. This has become the default and currently the only way in 2.0.

The reason behind this is complicated, but to put shortly each item should be its own line item that correctly tracks it's own discount / taxation.

Items QTY's are now Line Itemed

There has been massive problems when it comes to rounding / discounts / taxation when laracart was using the sub total function with the QTY. This would lead to improper rounding and wrong taxation in some cases.

Now, each item is a line item to calculate the proper taxation / discounts etc.

Features Missing

There are some features missing (sorry...) , eventually can be put back if there was an actual need for it.

  • tax_by_item (done by default now)
  • tax_item_before_discount (taxes should be applied AFTER discounts in MOST cases) .. this is one that may need to go back in~
  • discountTaxable (yes it was different cased....) was removed in favor of taxation happens after discounts (so discounts cant be taxed)
  • discountsAlreadyTaxed refer to above

There are other changes that may not be listed here , such as signature changes. A upgrade guide will be put out before full release.

Thanks for reading if you've made it this far.

Also would like to thank

@dennisoderwald for sponsoring LaraCart!

Upgrade Guide https://github.com/lukepolo/laracart/blob/2.0/upgrade-1.0-2.0.md

--
Docs will be updated this week!