diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index 4d47479589..b13f23f17d 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -552,6 +552,10 @@ Rectangle { // Alignment horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; + onLinkActivated: { + // Only case is to go to the bank. + sendToScript({method: 'gotoBank'}); + } } } @@ -1107,25 +1111,32 @@ Rectangle { } function handleBuyAgainLogic() { - // If you can buy this item again... - if (canBuyAgain()) { - // If you can't afford another copy of the item... - if (root.balanceAfterPurchase < 0) { - // If you already own the item... - if (root.alreadyOwned) { - buyText.text = "Your Wallet does not have sufficient funds to purchase this item again."; - // Else if you don't already own the item... - } else { - buyText.text = "Your Wallet does not have sufficient funds to purchase this item."; - } - buyTextContainer.color = "#FFC3CD"; - buyTextContainer.border.color = "#F3808F"; - buyGlyph.text = hifi.glyphs.alert; - buyGlyph.size = 54; - // If you CAN afford another copy of the item... + // General rules, implemented in various scattered places in this file: + // 1. If you already own the item, a viewInMyPurchasesButton is visible, + // and the buyButton is visible (and says "Buy it again") ONLY if it is a type you canBuyAgain. + // 2. Separately, + // a. If you don't have enough money to buy, the buyText becomes visible and tells you, and the buyButton is disabled. + // b. Otherwise, if the item is a content set and you don't have rez permission, the buyText becomes visible and tells you so. + + // If you can't afford another copy of the item... + if (root.balanceAfterPurchase < 0) { + // If you already own the item... + if (!root.alreadyOwned) { + buyText.text = "Your Wallet does not have sufficient funds to purchase this item."; + // Else if you don't already own the item... + } else if (canBuyAgain()) { + buyText.text = "Your Wallet does not have sufficient funds to purchase this item again."; } else { - handleContentSets(); + buyText.text = "While you do not have sufficient funds to buy this, you already have this item." } + buyText.text += " Visit Bank of High Fidelity to get more HFC." + buyTextContainer.color = "#FFC3CD"; + buyTextContainer.border.color = "#F3808F"; + buyGlyph.text = hifi.glyphs.alert; + buyGlyph.size = 54; + // If you CAN afford another copy of the item... + } else { + handleContentSets(); } } diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index 13ad1f6b69..58475d7653 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -773,6 +773,14 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) { return; } switch (message.method) { + case 'gotoBank': + ui.close(); + if (Account.metaverseServerURL.indexOf("staging") >= 0) { + Window.location = "hifi://hifiqa-master-metaverse-staging"; // So that we can test in staging. + } else { + Window.location = "hifi://BankOfHighFidelity"; + } + break; case 'purchases_openWallet': case 'checkout_openWallet': case 'checkout_setUpClicked':