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

[TAS-2565] 👔 Set 100% cross-sell for free books #1938

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.productAvailablePriceLabel === 'FREE' ||
(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
Loading