Skip to content

Commit

Permalink
👔 Set 100% cross-sell for free books
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Nov 6, 2024
1 parent e4e9942 commit 2255c12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/mixins/cross-sell.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import {
IS_TESTNET,
} from '~/constant';

import nftOrCollection from './nft-or-collection';

export default {
mixins: [nftOrCollection],
data() {
return {
isCrossSellDialogOpen: false,
Expand Down Expand Up @@ -63,7 +66,10 @@ export default {
id => id === this.classId || id === this.collectionId
);

return shouldAttemptCrossSell && !isCrossSellBlocked;
return (
this.productPrice === 0 ||
(shouldAttemptCrossSell && !isCrossSellBlocked)
);
},
shouldCrossSell() {
return this.isCrossSellEnabled && this.hasCrossSell;
Expand Down
11 changes: 4 additions & 7 deletions src/pages/nft/class/_classId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ export default {
}
if (this.isAddingToCart) {
this.handleAddToCart(selectedValue);
} else if (this.shouldCrossSell && edition?.price > 0) {
} else if (this.shouldCrossSell) {
this.selectedValue = selectedValue;
this.openCrossSellDialog();
} else {
Expand Down Expand Up @@ -1646,13 +1646,10 @@ export default {
this.isTippingDialogOpen = false;
if (this.isAddingToCart) {
this.handleAddToCart();
} else if (this.shouldCrossSell) {
this.openCrossSellDialog();
} else {
const edition = this.getEdition(this.selectedValue);
if (this.shouldCrossSell && edition?.price > 0) {
this.openCrossSellDialog();
} else {
this.handleCollectFromEdition();
}
this.handleCollectFromEdition();
}
},
handleClickBookBannerCTA() {
Expand Down

0 comments on commit 2255c12

Please sign in to comment.