Sylius / Sylius

Open Source eCommerce Framework on Symfony
https://sylius.com
MIT License
7.84k stars 2.08k forks source link

Disabled channels should not be actionable (or invisible) when editing a product or variant #16479

Open ebarbeito opened 2 months ago

ebarbeito commented 2 months ago

Current Behavior In the Sylius admin panel, channels can be disabled within the shop configuration. However, when a channel that is associated with some product(s) or variant(s) is disabled, this "disabled channel" remains visible and configurable. It is still possible to enable or disable it for specific products, edit prices, etc.

Proposal Once a channel is disabled (e.g., using the Sylius admin panel /administration/channels or via the REST API), the following changes should be implemented when editing or creating a product:

What do you think about adopting this more restrictive approach to handle disabled channels in the Product and Variant sections of the administration panel? This change would benefit shop administrators by simplifying management, especially for e-commerce platforms with numerous channels and pricing configurations.

Thanks in advance for your consideration.

Chrysweel commented 2 months ago

I think that disabled channels should be used in the products to allow for price entry before they are enabled.

However, a disabled channel on the product page can be quite frustrating, as it might cause colleagues managing the products to mistakenly enter data into it.

Therefore, I suggest to provide an option to hide or show disabled channels.

What do you think?

An example of this solution: imagen

Chrysweel commented 2 months ago

Another option is to add a new option.

Disable a channel or "Delete" a channel.

If it is disabled it can appear on the product page, if it is removed it should not appear almost anywhere.

But I think this is the most expensive to implement.

If sylius would accept the option I've proposed, I could make a PR to submit.

ebarbeito commented 2 months ago

@Chrysweel: I agree that allowing edits to disabled channels for the use case you’re discussing makes sense. A less restrictive solution to prevent incorrect usage of disabled channels would indeed be more convenient.

Adding a button to toggle the visibility of pricing for disabled channels sounds like a good idea 👍🏼

This approach looks good to me. Thanks

Chrysweel commented 2 months ago

@CoderMaggie we could make a PR with the option that is decided, how do you see it? Is this something that would be accepted by sylius?

CoderMaggie commented 2 months ago

In my opinion, adding a "Show disabled channels" toggle in the channel pricing is a good idea. You will have my approval when submitting a PR @Chrysweel

ebarbeito commented 1 month ago

Hello. I am starting the change to propose a PR when is ready.

As this represents a new feature, the base branch I use for the change proposal is 1.13. I also will follow the contributing guidelines for Code and Documentation.