Skip to content

Commit

Permalink
attributes validation implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmithi committed Dec 27, 2024
1 parent 63efa21 commit a4ed1b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/commerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ export async function getProductPriceDetails() {
throw new Error('Sorry, network error, not able to render response.');
});

if (Object.keys(priceResponse).length > 0 || {}) {
const presponse = priceResponse;
localStorage.setItem('price-details', JSON.stringify(priceResponse));
return presponse;
if (('attributes' in priceResponse) !== undefined) {
if (Object.keys(priceResponse).length > 0) {
const presponse = priceResponse;
localStorage.setItem('price-details', JSON.stringify(priceResponse));
return presponse;
}
}
} catch (error) {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit a4ed1b4

Please sign in to comment.