Skip to content
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

When enabling Pay Later messages, settings for both layouts (text/flex) are being shown simultaneously #138

Closed
jorgeatorres opened this issue Mar 26, 2021 · 0 comments · Fixed by #141
Labels
bug Something isn't working

Comments

@jorgeatorres
Copy link
Member

Describe the bug

On the settings screen, when Pay Later messages is initially disabled (or if you disable it first) enabling the option displays settings that apply to both the "Text" and "Flex" layouts, which is incorrect. This is true for the checkout, single product and cart sections.

This is because groupToggle() in settings.js only takes into account settings that immediately depend on the "parent" toggle, but not settings that in turn depend on one of the possibly displayed toggles.

For example #field-message_flex_color depends on #ppcp-message_enabled and so toggling the latter makes the former immediately appear, but that's not correct because #field-message_flex_color also depends on #ppcp-message_layout being set to flex.

To reproduce

  1. Uncheck "Enable message on Checkout" if initially enabled.
  2. Enable message on Checkout by clicking "Enable on Checkout".
  3. Confirm that regardless of the current layout, the following settings appear: layout, logo, logo position, text color, color, ratio.
  4. Choose a different layout and confirm that now only settings that appear to that layout are shown.
  5. Repeat the above with the other layout option.

Screenshots

Screencast illustrating the problem:

screencast

Expected behavior

Only settings that apply to the layout chosen should appear.

@jorgeatorres jorgeatorres added the bug Something isn't working label Mar 26, 2021
@jorgeatorres jorgeatorres changed the title When enabling Pay Later messages, settings for both layouts (text/flex) are being shown When enabling Pay Later messages, settings for both layouts (text/flex) are being shown simultaneously Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant