Magento 2: Hide tier price element The 2019 Stack Overflow Developer Survey Results Are InHow to import tier pricing using CSV in magento 2Getting Current Customer Group Price, and Tier PriceTier Price in configurable productMagento2 - How to hide price until login by using custom block about customer session?Showing tier price on cart page?Magento2 tier price on configurable productsTier Pricing For Configurable ProductsHow to update multiple tier price for product in magento2?Magento2 - Cart Price Rule & Tier Price IssueTier Price doesn't work after combining two or more custom options
Patience, young "Padovan"
Falsification in Math vs Science
What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?
I looked up a future colleague on LinkedIn before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?
What is the use of option -o in the useradd command?
Access elements in std::string where positon of string is greater than its size
Is this food a bread or a loaf?
What is this 4-propeller plane?
Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?
Is domain driven design an anti-SQL pattern?
How to change the limits of integration
Why is the maximum length of openwrt’s root password 8 characters?
Is three citations per paragraph excessive for undergraduate research paper?
Springs with some finite mass
"What time...?" or "At what time...?" - what is more grammatically correct?
Spanish for "widget"
Does a dangling wire really electrocute me if I'm standing in water?
How was Skylab's orbit inclination chosen?
What does Linus Torvalds means when he says that git "never ever" tracks a file?
What is the meaning of Triage in Cybersec world?
Geography at the pixel level
Which Sci-Fi work first showed weapon of galactic-scale mass destruction?
Why is Grand Jury testimony secret?
What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?
Magento 2: Hide tier price element
The 2019 Stack Overflow Developer Survey Results Are InHow to import tier pricing using CSV in magento 2Getting Current Customer Group Price, and Tier PriceTier Price in configurable productMagento2 - How to hide price until login by using custom block about customer session?Showing tier price on cart page?Magento2 tier price on configurable productsTier Pricing For Configurable ProductsHow to update multiple tier price for product in magento2?Magento2 - Cart Price Rule & Tier Price IssueTier Price doesn't work after combining two or more custom options
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Custom theme using Magento 2.2.1 in developer mode, inheriting from the Magento/blank
theme.
When selecting an item from a sizing dropdown on a product page, created using a configurable product, an element appears, which I believe is the 'tier price'.
The element in question is<div class="price-box price-tier_price" data-role="priceBox"></div>
.
I have tried adding <referenceBlock name="price-tier_price" remove="true" />
and <referenceBlock name="price-box" remove="true" />
to default.xml, but neither have worked.
Please can someone advise me how to hide this element?
Thanks.
EDIT:
Found this link.
Looks like this might be the root of the problem, which is marked 'Done' ready for Magento 2.3.
magento2 configurable-product pricing tiered-pricing visibility
add a comment |
Custom theme using Magento 2.2.1 in developer mode, inheriting from the Magento/blank
theme.
When selecting an item from a sizing dropdown on a product page, created using a configurable product, an element appears, which I believe is the 'tier price'.
The element in question is<div class="price-box price-tier_price" data-role="priceBox"></div>
.
I have tried adding <referenceBlock name="price-tier_price" remove="true" />
and <referenceBlock name="price-box" remove="true" />
to default.xml, but neither have worked.
Please can someone advise me how to hide this element?
Thanks.
EDIT:
Found this link.
Looks like this might be the root of the problem, which is marked 'Done' ready for Magento 2.3.
magento2 configurable-product pricing tiered-pricing visibility
add a comment |
Custom theme using Magento 2.2.1 in developer mode, inheriting from the Magento/blank
theme.
When selecting an item from a sizing dropdown on a product page, created using a configurable product, an element appears, which I believe is the 'tier price'.
The element in question is<div class="price-box price-tier_price" data-role="priceBox"></div>
.
I have tried adding <referenceBlock name="price-tier_price" remove="true" />
and <referenceBlock name="price-box" remove="true" />
to default.xml, but neither have worked.
Please can someone advise me how to hide this element?
Thanks.
EDIT:
Found this link.
Looks like this might be the root of the problem, which is marked 'Done' ready for Magento 2.3.
magento2 configurable-product pricing tiered-pricing visibility
Custom theme using Magento 2.2.1 in developer mode, inheriting from the Magento/blank
theme.
When selecting an item from a sizing dropdown on a product page, created using a configurable product, an element appears, which I believe is the 'tier price'.
The element in question is<div class="price-box price-tier_price" data-role="priceBox"></div>
.
I have tried adding <referenceBlock name="price-tier_price" remove="true" />
and <referenceBlock name="price-box" remove="true" />
to default.xml, but neither have worked.
Please can someone advise me how to hide this element?
Thanks.
EDIT:
Found this link.
Looks like this might be the root of the problem, which is marked 'Done' ready for Magento 2.3.
magento2 configurable-product pricing tiered-pricing visibility
magento2 configurable-product pricing tiered-pricing visibility
edited Dec 10 '17 at 21:03
Joshua Flood
asked Dec 9 '17 at 19:10
Joshua FloodJoshua Flood
349221
349221
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Did a little reading up on Khoa TruongDinh's answer and discovered this issue posted on Magento's github:
https://github.com/magento/magento2/issues/4945
Looks like this is a known bug that has been fixed for v2.3.
I've managed to work around the bug in my custom theme using three different methods.
Method One:
Added the line
<referenceBlock name="product.price.tier" remove="true" />
to
<Vendor>/<Theme>/Magento_Theme/layout/default.xml
and it seems to be working.
Method Two:
First, I copied the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
.
Then, I removed the following code from the new file:
<block class="MagentoCatalogPricingRender" name="product.price.tier" after="product.info.price">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">tier_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
Method 3 (from Khoa TruongDinh's answer):
See how tier price is rendered:
MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
Configurable product JS comes from here:
Magento_ConfigurableProduct/js/configurable
Create requirejs-config.js
file here:
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
Create the following mixin inside the file requirejs-config.js
:
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
Then create configurable-mixin.js
here:
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
configurable-mixin.js
should contain the following code:
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Method 4 (from goodlook's answer):
Copy the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
and remove the following line:
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
add a comment |
We can see how tier price was rendered: MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
.
There is an easy way to hide the tier price - but not sure it's the best way:
The js for changing value of configurable product comes from Magento_ConfigurableProduct/js/configurable
.
We need to override it by using mixin
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Where do I actually put therequirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?
– Joshua Flood
Dec 10 '17 at 20:04
1
This solution is for Magento 2. If having already a custom theme, put it underapp/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.
– Khoa TruongDinh
Dec 10 '17 at 23:52
1
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
1
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
|
show 2 more comments
on magento 2.3.0 you can remove by editing
Magento_Catalog/templates/product/price/final_price.phtml
I added text to tell there is % when buy more 'by more and get %'
then I marked out the render of tier price.
So, no tier price is shown, only some replace text with link to product page where tier prices are correct.
<a href="<?= /* @escapeNotVerified */ $block->getSaleableItem()->getProductUrl() ?>" class="minimal-price-link"> By more and get %
<!-- marke out code or delete line
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
--> </a>
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f205193%2fmagento-2-hide-tier-price-element%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Did a little reading up on Khoa TruongDinh's answer and discovered this issue posted on Magento's github:
https://github.com/magento/magento2/issues/4945
Looks like this is a known bug that has been fixed for v2.3.
I've managed to work around the bug in my custom theme using three different methods.
Method One:
Added the line
<referenceBlock name="product.price.tier" remove="true" />
to
<Vendor>/<Theme>/Magento_Theme/layout/default.xml
and it seems to be working.
Method Two:
First, I copied the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
.
Then, I removed the following code from the new file:
<block class="MagentoCatalogPricingRender" name="product.price.tier" after="product.info.price">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">tier_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
Method 3 (from Khoa TruongDinh's answer):
See how tier price is rendered:
MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
Configurable product JS comes from here:
Magento_ConfigurableProduct/js/configurable
Create requirejs-config.js
file here:
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
Create the following mixin inside the file requirejs-config.js
:
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
Then create configurable-mixin.js
here:
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
configurable-mixin.js
should contain the following code:
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Method 4 (from goodlook's answer):
Copy the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
and remove the following line:
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
add a comment |
Did a little reading up on Khoa TruongDinh's answer and discovered this issue posted on Magento's github:
https://github.com/magento/magento2/issues/4945
Looks like this is a known bug that has been fixed for v2.3.
I've managed to work around the bug in my custom theme using three different methods.
Method One:
Added the line
<referenceBlock name="product.price.tier" remove="true" />
to
<Vendor>/<Theme>/Magento_Theme/layout/default.xml
and it seems to be working.
Method Two:
First, I copied the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
.
Then, I removed the following code from the new file:
<block class="MagentoCatalogPricingRender" name="product.price.tier" after="product.info.price">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">tier_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
Method 3 (from Khoa TruongDinh's answer):
See how tier price is rendered:
MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
Configurable product JS comes from here:
Magento_ConfigurableProduct/js/configurable
Create requirejs-config.js
file here:
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
Create the following mixin inside the file requirejs-config.js
:
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
Then create configurable-mixin.js
here:
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
configurable-mixin.js
should contain the following code:
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Method 4 (from goodlook's answer):
Copy the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
and remove the following line:
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
add a comment |
Did a little reading up on Khoa TruongDinh's answer and discovered this issue posted on Magento's github:
https://github.com/magento/magento2/issues/4945
Looks like this is a known bug that has been fixed for v2.3.
I've managed to work around the bug in my custom theme using three different methods.
Method One:
Added the line
<referenceBlock name="product.price.tier" remove="true" />
to
<Vendor>/<Theme>/Magento_Theme/layout/default.xml
and it seems to be working.
Method Two:
First, I copied the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
.
Then, I removed the following code from the new file:
<block class="MagentoCatalogPricingRender" name="product.price.tier" after="product.info.price">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">tier_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
Method 3 (from Khoa TruongDinh's answer):
See how tier price is rendered:
MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
Configurable product JS comes from here:
Magento_ConfigurableProduct/js/configurable
Create requirejs-config.js
file here:
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
Create the following mixin inside the file requirejs-config.js
:
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
Then create configurable-mixin.js
here:
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
configurable-mixin.js
should contain the following code:
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Method 4 (from goodlook's answer):
Copy the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
and remove the following line:
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
Did a little reading up on Khoa TruongDinh's answer and discovered this issue posted on Magento's github:
https://github.com/magento/magento2/issues/4945
Looks like this is a known bug that has been fixed for v2.3.
I've managed to work around the bug in my custom theme using three different methods.
Method One:
Added the line
<referenceBlock name="product.price.tier" remove="true" />
to
<Vendor>/<Theme>/Magento_Theme/layout/default.xml
and it seems to be working.
Method Two:
First, I copied the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
.
Then, I removed the following code from the new file:
<block class="MagentoCatalogPricingRender" name="product.price.tier" after="product.info.price">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">tier_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
Method 3 (from Khoa TruongDinh's answer):
See how tier price is rendered:
MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
Configurable product JS comes from here:
Magento_ConfigurableProduct/js/configurable
Create requirejs-config.js
file here:
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
Create the following mixin inside the file requirejs-config.js
:
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
Then create configurable-mixin.js
here:
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
configurable-mixin.js
should contain the following code:
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Method 4 (from goodlook's answer):
Copy the file
Magento/Catalog/layout/catalog_product_view.xml
to
<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
and remove the following line:
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
edited 5 hours ago
answered Dec 10 '17 at 23:59
Joshua FloodJoshua Flood
349221
349221
add a comment |
add a comment |
We can see how tier price was rendered: MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
.
There is an easy way to hide the tier price - but not sure it's the best way:
The js for changing value of configurable product comes from Magento_ConfigurableProduct/js/configurable
.
We need to override it by using mixin
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Where do I actually put therequirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?
– Joshua Flood
Dec 10 '17 at 20:04
1
This solution is for Magento 2. If having already a custom theme, put it underapp/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.
– Khoa TruongDinh
Dec 10 '17 at 23:52
1
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
1
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
|
show 2 more comments
We can see how tier price was rendered: MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
.
There is an easy way to hide the tier price - but not sure it's the best way:
The js for changing value of configurable product comes from Magento_ConfigurableProduct/js/configurable
.
We need to override it by using mixin
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Where do I actually put therequirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?
– Joshua Flood
Dec 10 '17 at 20:04
1
This solution is for Magento 2. If having already a custom theme, put it underapp/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.
– Khoa TruongDinh
Dec 10 '17 at 23:52
1
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
1
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
|
show 2 more comments
We can see how tier price was rendered: MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
.
There is an easy way to hide the tier price - but not sure it's the best way:
The js for changing value of configurable product comes from Magento_ConfigurableProduct/js/configurable
.
We need to override it by using mixin
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
We can see how tier price was rendered: MagentoConfigurableProductBlockProductViewTypeConfigurable::getOptionPrices
.
There is an easy way to hide the tier price - but not sure it's the best way:
The js for changing value of configurable product comes from Magento_ConfigurableProduct/js/configurable
.
We need to override it by using mixin
app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
var config =
config:
mixins:
'Magento_ConfigurableProduct/js/configurable':
'Vendor_Catalog/js/configurable-mixin': true
;
app/code/[Vendor]/[Module]/view/frontend/web/js/configurable-mixin.js
define(
[
'jquery'
],
function ($)
'use strict';
return function (target)
$.widget('mage.configurable', target,
_displayTierPriceBlock: function (optionId)
//Do no thing here.
);
return $.mage.configurable;
;
);
edited Dec 10 '17 at 15:02
answered Dec 10 '17 at 14:35
Khoa TruongDinhKhoa TruongDinh
22.2k64187
22.2k64187
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Where do I actually put therequirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?
– Joshua Flood
Dec 10 '17 at 20:04
1
This solution is for Magento 2. If having already a custom theme, put it underapp/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.
– Khoa TruongDinh
Dec 10 '17 at 23:52
1
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
1
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
|
show 2 more comments
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Where do I actually put therequirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?
– Joshua Flood
Dec 10 '17 at 20:04
1
This solution is for Magento 2. If having already a custom theme, put it underapp/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.
– Khoa TruongDinh
Dec 10 '17 at 23:52
1
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
1
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Thanks for your response. Just making a few other changes and then I'll try this out. It may or may not be the 'best' way, but it is certainly a much cleaner solution than I have seen mentioned elsewhere. Will get back to you soon!
– Joshua Flood
Dec 10 '17 at 19:57
Where do I actually put the
requirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?– Joshua Flood
Dec 10 '17 at 20:04
Where do I actually put the
requirejs-config.js
file inside app/design/frontend/[Vendor]/[Module]/... ? Or is this a solution for 1.9?– Joshua Flood
Dec 10 '17 at 20:04
1
1
This solution is for Magento 2. If having already a custom theme, put it under
app/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.– Khoa TruongDinh
Dec 10 '17 at 23:52
This solution is for Magento 2. If having already a custom theme, put it under
app/design/frontend/[Vendor]/[Theme_name]/requirejs-config.js
.– Khoa TruongDinh
Dec 10 '17 at 23:52
1
1
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
Good to know you resolve your issue.
– Khoa TruongDinh
Dec 11 '17 at 0:31
1
1
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
@JoshuaFlood no worries.
– Khoa TruongDinh
Dec 12 '17 at 16:33
|
show 2 more comments
on magento 2.3.0 you can remove by editing
Magento_Catalog/templates/product/price/final_price.phtml
I added text to tell there is % when buy more 'by more and get %'
then I marked out the render of tier price.
So, no tier price is shown, only some replace text with link to product page where tier prices are correct.
<a href="<?= /* @escapeNotVerified */ $block->getSaleableItem()->getProductUrl() ?>" class="minimal-price-link"> By more and get %
<!-- marke out code or delete line
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
--> </a>
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
add a comment |
on magento 2.3.0 you can remove by editing
Magento_Catalog/templates/product/price/final_price.phtml
I added text to tell there is % when buy more 'by more and get %'
then I marked out the render of tier price.
So, no tier price is shown, only some replace text with link to product page where tier prices are correct.
<a href="<?= /* @escapeNotVerified */ $block->getSaleableItem()->getProductUrl() ?>" class="minimal-price-link"> By more and get %
<!-- marke out code or delete line
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
--> </a>
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
add a comment |
on magento 2.3.0 you can remove by editing
Magento_Catalog/templates/product/price/final_price.phtml
I added text to tell there is % when buy more 'by more and get %'
then I marked out the render of tier price.
So, no tier price is shown, only some replace text with link to product page where tier prices are correct.
<a href="<?= /* @escapeNotVerified */ $block->getSaleableItem()->getProductUrl() ?>" class="minimal-price-link"> By more and get %
<!-- marke out code or delete line
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
--> </a>
on magento 2.3.0 you can remove by editing
Magento_Catalog/templates/product/price/final_price.phtml
I added text to tell there is % when buy more 'by more and get %'
then I marked out the render of tier price.
So, no tier price is shown, only some replace text with link to product page where tier prices are correct.
<a href="<?= /* @escapeNotVerified */ $block->getSaleableItem()->getProductUrl() ?>" class="minimal-price-link"> By more and get %
<!-- marke out code or delete line
<?= /* @escapeNotVerified */ $block->renderAmountMinimal() ?>
--> </a>
answered Feb 24 at 9:11
goodlookgoodlook
474
474
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
add a comment |
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
Thanks goodlook. I've added this method to the answer and given you an upvote.
– Joshua Flood
4 hours ago
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f205193%2fmagento-2-hide-tier-price-element%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown