Skip to content

Added support for tierprices#1205

Merged
royduin merged 36 commits intomasterfrom
feature/tier-prices
Mar 10, 2026
Merged

Added support for tierprices#1205
royduin merged 36 commits intomasterfrom
feature/tier-prices

Conversation

@indykoning
Copy link
Copy Markdown
Member

This PR adds support for tier prices to Rapidez.

If a Tierprice with qty of 1 is added it will not be shown on the product page as is default in Magento.
This can be used to set different prices for different customer groups. Search and category pages also respect this.

image

Magento for reference:
image

ref: RAP-1626

@indykoning indykoning requested a review from royduin as a code owner February 20, 2026 15:04
Comment on lines +52 to +58
$appends = array_filter($attributes, fn ($key) => $product->hasAnyGetMutator($key));
$relations = array_filter(
array_map(fn ($key) => Str::camel($key), $attributes),
fn ($key) => $product->isRelation($key)
);

$data = Arr::only($product->toArray(), $attributes);
$data = Arr::only($product->append($appends)->loadMissing($relations)->toArray(), $attributes);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is not immediately used so could be removed.
But it adds the ability to activate getters and relationships when asking for them in the productpage.frontend.attributes filter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain this a bit more?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the values in $attributes are only kept after the toArray function.
If the attribute is not present in the appends, or is a relation which is not eager loaded it will still not show up.

This code checks if the attribute is a relation or attribute to append and does so

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These are changed due to the fusion backback tier price for qty of 1
(2nd row to the right)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This file is changed due to the fusion backpack being in the related products slider

Comment thread .github/workflows/playwright.yml Outdated
Comment thread resources/views/product/partials/tier-prices.blade.php
Comment thread resources/views/product/partials/addtocart.blade.php Outdated
Comment thread resources/views/product/partials/tier-prices.blade.php Outdated
Comment on lines +52 to +58
$appends = array_filter($attributes, fn ($key) => $product->hasAnyGetMutator($key));
$relations = array_filter(
array_map(fn ($key) => Str::camel($key), $attributes),
fn ($key) => $product->isRelation($key)
);

$data = Arr::only($product->toArray(), $attributes);
$data = Arr::only($product->append($appends)->loadMissing($relations)->toArray(), $attributes);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain this a bit more?

Comment thread tests/database/dump.sql
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you check this visually with @jordythevulder?

Copy link
Copy Markdown
Contributor

@jordythevulder jordythevulder Mar 10, 2026

Choose a reason for hiding this comment

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

Looks good! UI could change if they configure more then 10+ rules for this, then it's better to build it within a dropdown. But for now it's fine

@indykoning
Copy link
Copy Markdown
Member Author

The failed pipeline is due to the updated screenshots
Spacing has been fixed
comment has been added
calculated tier pricing has been moved to a mutator

@royduin royduin merged commit ec99b63 into master Mar 10, 2026
@royduin royduin deleted the feature/tier-prices branch March 10, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants