Sylius: Rework the order item quantity limit into a parameter

Created on 6 Oct 2019  路  2Comments  路  Source: Sylius/Sylius

Sylius version affected: 1.5, 1.6, master

Description
Buying more than 9999 pieces of an article will be hard capped at 9999 as possible maximum value in service decoration of sylius.order_item_quantity_modifier.limiting.

Steps to reproduce

  1. Order more than 9999 pieces of an article

or

  1. look at the source code: https://github.com/Sylius/Sylius/blob/23aeeb5e6b563518192c79a2bc768e254d9ea9ad/src/Sylius/Bundle/CoreBundle/Resources/config/services.xml#L158
        <service id="sylius.order_item_quantity_modifier.limiting" class="Sylius\Component\Core\Cart\Modifier\LimitingOrderItemQuantityModifier" decorates="sylius.order_item_quantity_modifier" decoration-priority="256">
            <argument type="service" id="sylius.order_item_quantity_modifier.limiting.inner" />
            <argument>9999</argument>
        </service>

Possible Solution

Such limiting values should not be set as magic values in service definition nor in source code. They rather should be parameters out of config files.

Why is it a bad idea to limit quantities to 9999? Because
a) shop owners should be able to meet there own limitation in general
b) especially for digital products a much higher limitation will be required

DX Do not stale Feature Good First Issue

Most helpful comment

Should be parametrized

All 2 comments

Should be parametrized

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings