Skip to content

Commit

Permalink
👽 Use index field for priceIndex (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt authored Jul 31, 2023
1 parent 84025af commit 711d2fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pages/nft/class/_classId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -677,29 +677,29 @@ export default {
return this.handleCollect();
},
handleCollectFromEdition(selectedValue) {
const bookStorePrices =
this.getNFTBookStorePricesByClassId(this.classId) || {};
const hasStock = bookStorePrices[selectedValue]?.stock;
const editions = this.getNFTBookStorePricesByClassId(this.classId) || {};
const edition = editions[selectedValue];
const hasStock = edition?.stock;
if (!hasStock && !this.nftIsCollectable) return;
if (hasStock) {
const purchaseEventParams = {
items: [
{
name: this.NFTName,
price: bookStorePrices[selectedValue].price,
price: edition.price,
classId: this.classId,
},
],
price: bookStorePrices[selectedValue].price,
price: edition.price,
currency: 'USD',
isNFTBook: true,
};
logPurchaseFlowEvent(this, 'add_to_cart', purchaseEventParams);
logPurchaseFlowEvent(this, 'begin_checkout', purchaseEventParams);
const link = getNFTBookPurchaseLink({
classId: this.classId,
priceIndex: selectedValue,
priceIndex: edition.index,
platform: this.platform,
});
window.open(link, '_blank', 'noopener');
Expand Down

0 comments on commit 711d2fb

Please sign in to comment.