-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Price component #362
base: master
Are you sure you want to change the base?
Price component #362
Conversation
if (['shipping', 'billing'].includes(window.config?.tax?.calculation.based_on)) { | ||
country_id = window.app?.$data?.checkout?.[window.config?.tax?.calculation.based_on + '_address']?.country_id || country_id | ||
region_id = window.app?.$data?.checkout?.[window.config?.tax?.calculation.based_on + '_address']?.region_id || region_id | ||
postcode = window.app?.$data?.checkout?.[window.config?.tax?.calculation.based_on + '_address']?.postcode || postcode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let basedOn = window.app?.$data?.checkout?.[window.config?.tax?.calculation.based_on + '_address']
And then use that instead of repeating it 3 times, would probably be much cleaner here.
->where(fn ($query) => $query | ||
->where('all_groups', 1) | ||
->orWhere('customer_group_id', auth('magento-customer')->user()?->group_id ?? 0) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting?
|
||
price() { | ||
return this.calculatePrice(this.options) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be thought out again, Magento doesn't work with prices this way.
Prices are calculated as follows: Final Price=Min(Regular(Base) Price, Group(Tier) Price, Special Price, Catalog Price Rule) + Sum(Min Price per each required custom option)
Note that prices are clamped to a minimum of 0 before and after the custom options are added. Also, the price gets rounded before getting multiplied by the qty.
Breaking: