diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index 6a53080899..ac11b332ff 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -1051,9 +1051,6 @@ Rectangle { function fromScript(message) { switch (message.method) { case 'updateCheckoutQML': - if (message.params.isUpdating) { - root.isUpdating = message.params.isUpdating; - } root.itemId = message.params.itemId; root.itemName = message.params.itemName.trim(); root.itemPrice = message.params.itemPrice; diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 903d15223c..46b0b6c971 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -255,19 +255,6 @@ })); } - function updateButtonClicked(id, name, author, href, referrer) { - EventBridge.emitWebEvent(JSON.stringify({ - type: "UPDATE", - isUpdating: true, - itemId: id, - itemName: name, - itemPrice: 0, - itemHref: href, - referrer: referrer, - itemAuthor: author - })); - } - function injectBuyButtonOnMainPage() { var cost; @@ -423,25 +410,18 @@ } var cost = $('.item-cost').text(); - if (availability !== 'available') { - purchaseButton.html('UNAVAILABLE (' + availability + ')'); - } else if (window.location.href.indexOf('certificateId=' != -1)) { + var isUpdating = window.location.href.indexOf('edition=') > -1; + if (isUpdating) { purchaseButton.html('UPDATE FOR FREE'); + } else if (availability !== 'available') { + purchaseButton.html('UNAVAILABLE (' + availability + ')'); } else if (parseInt(cost) > 0 && $('#side-info').find('#buyItemButton').size() === 0) { purchaseButton.html('PURCHASE ' + cost); } purchaseButton.on('click', function () { - var urlParams = new URLSearchParams(window.location.search); - - if (window.location.href.indexOf('edition=' != -1)) { // "Upgrading" case - updateButtonClicked(window.location.pathname.split("/")[3], - $('#top-center').find('h1').text(), - $('#creator').find('.value').text(), - href, - "itemPage"); - } else if ('available' === availability) { + if ('available' === availability || isUpdating) { buyButtonClicked(window.location.pathname.split("/")[3], $('#top-center').find('h1').text(), $('#creator').find('.value').text(), diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index 6e010943c7..d3620968c7 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -420,7 +420,7 @@ var selectionDisplay = null; // for gridTool.js to ignore isDownloadBeingCancelled = false; } else { var parsedJsonMessage = JSON.parse(message); - if (parsedJsonMessage.type === "CHECKOUT" || parsedJsonMessage.type === "UPDATE") { + if (parsedJsonMessage.type === "CHECKOUT") { wireEventBridge(true); tablet.pushOntoStack(MARKETPLACE_CHECKOUT_QML_PATH); tablet.sendToQml({