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

Implemented: product identifier component in settings page from dxp-components (dxp-178) #237

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

amansinghbais
Copy link
Contributor

@amansinghbais amansinghbais commented Sep 25, 2023

Related Issues

Related Issue: hotwax/dxp-components#178

Short Description and Why It's Useful

Improved the code to use the product identifier component implemented in dxp-components on the settings page.

Testing

The working of this code can be tested with the following pr: hotwax/dxp-components#192

Screenshots of Visual Changes before/after (If There Are Any)

IMPORTANT NOTICE - Remember to update CHANGELOG.md with description of your change

Contribution and Currently Important Rules Acceptance

// Get product identification from api using dxp-component and set the state if eComStore is defined
if (this.currentEComStore.productStoreId) {
await useProductIdentificationStore().getIdentificationPref(this.currentEComStore.productStoreId)
.catch((error) => console.error(error));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.catch((error) => console.error(error));
.catch((error) => console.error(error));

Comment on lines 77 to 80
if (preferredStoreId){
await useProductIdentificationStore().getIdentificationPref(preferredStoreId)
.catch((error) => console.error(error));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move this logic above, where we are checking for preferredStoreId.

@@ -120,7 +120,7 @@
<ShopifyImg :src="getProduct(item.productId).mainImageUrl" size="small"></ShopifyImg>
</ion-thumbnail>
<ion-label>
<h2>{{ item.parentProductName ? item.parentProductName :item.productName }}</h2>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, item) }}</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the selected primaryId is not available on the product?

// Get product identification from api using dxp-component and set the state if eComStore is defined
if (payload.eComStore.productStoreId) {
await useProductIdentificationStore().getIdentificationPref(payload.eComStore.productStoreId)
.catch((error) => console.error(error));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.catch((error) => console.error(error));
.catch((error) => console.error(error));

Comment on lines 20 to 21
<h4>{{ getProductIdentificationValue(productIdentificationPref.primaryId, currentVariant) }}</h4>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, currentVariant) }}</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check if these changes are required or not.

@amansinghbais amansinghbais changed the title Implemented: product identifier component in settings page from dxp-components (#178) Implemented: product identifier component in settings page from dxp-components (dxp-178) Oct 12, 2023
Ridwan6947 added a commit to Ridwan6947/preorder that referenced this pull request Jul 22, 2024
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