3

The error indicates that you're type-hinting the wrong class. Note this line in the error message: Argument 1 passed to amss\amss\AMSS::amss\amss{closure}() must be an instance of amss\amss\RegisterComponentTypesEvent, instance of craft\events\RegisterComponentTypesEvent given This comes from the type-hint in your function: function(...


2

Your instinct to try the Adjuster API is spot-on. However, you've missed one critical aspect of how Adjusters work that may help explain why the changes you're making are unstable or invisible. Modifying the price attribute of a LineItem is not a guarantor of any particular behavior. In fact, the price is often just the Variant's base price, memoized—not ...


Only top voted, non community-wiki answers of a minimum length are eligible