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

feature: Added product variants feature #46

Draft
wants to merge 18 commits into
base: development
Choose a base branch
from

Conversation

tobi-or-not-tobi
Copy link
Contributor

@tobi-or-not-tobi tobi-or-not-tobi commented Aug 1, 2024

Select product (multi) variants based on attributes. The variant specific attributes are highlighted.

Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for dev-composable-storefront ready!

Name Link
🔨 Latest commit c5c5ed8
🔍 Latest deploy log https://app.netlify.com/sites/dev-composable-storefront/deploys/66ac68d971592e00086e1603
😎 Deploy Preview https://deploy-preview-46--dev-composable-storefront.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
3 paths audited
Performance: 42 (🟢 up 10 from production)
Accessibility: 90 (no change from production)
Best Practices: 94 (no change from production)
SEO: 80 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for dev-oryx-components ready!

Name Link
🔨 Latest commit c5c5ed8
🔍 Latest deploy log https://app.netlify.com/sites/dev-oryx-components/deploys/66ac68d91876aa000889c79d
😎 Deploy Preview https://deploy-preview-46--dev-oryx-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

return skuMap;
}, {} as Record<string, Record<string, string>>);

return { variants, variantDefinition };
Copy link
Contributor

Choose a reason for hiding this comment

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

If we providing parsing anywaay can we just move specifiv variantDefinition into variants object?

Comment on lines +159 to +165
const form = e.currentTarget as HTMLFormElement;
const formData = new FormData(form);

const selectedAttributes: Record<string, string> = {};
formData.forEach((value, key) => {
selectedAttributes[key] = value as string;
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just create state component variable with all selected options and add change method to the option so in this case we should not recalculate the whole form each time?

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.

2 participants