How to remove the Add to Cart button from Catalog pages in Magento 2?Magento 2.2.5: Disable Add to Cart buttonMeesed up “Add to cart” button in product pagesRemove Add to Cart button on select productsMagento 2: How to remove add to cart template from product detail pageMagento 2: add product (catalog) to cart when button is clickedHow to add “Empty Cart” button to minicartMagento 2 remove options from item cartMagento2 Add to cart button in row with grouped ProductsMagento2: How to remove ‘Add New’ button from Admin Grid?Magento 2 | Remove add to cart from catalog/category/view/How to add 'addToCart' GA event to Add To Cart button on wishlist page?
Why have both: BJT and FET transistors on IC output?
Map vs. Table for index-specific operations on 2D arrays
Applying for mortgage when living together but only one will be on the mortgage
How to trick a fairly simplistic kill-counter?
When did J.K. Rowling decide to make Ron and Hermione a couple?
How does Rust's 128-bit integer `i128` work on a 64-bit system?
Who's behind community AMIs on Amazon EC2?
Pre-Greek θάλασσα "thalassa" and Turkish talaz
What is the most 'environmentally friendly' way to learn to fly?
What's the term for a group of people who enjoy literary works?
Is this popular optical illusion made of a grey-scale image with coloured lines?
What is the reason behind water not falling from a bucket at the top of loop?
What does the "きゃ" in "していきゃがらなかった" stand for?
Skipping same old introductions
Can an alphabet for a Turing machine contain subsets of other alphabets?
Will medical institutions reject an applicant based on being 28 years of age?
If I buy and download a game through second Nintendo account do I own it on my main account too?
Export economy of Mars
What does a number above the 'staff' mean in tablature?
Why are sugars in whole fruits not digested the same way sugars in juice are?
How do I respond appropriately to an overseas company that obtained a visa for me without hiring me?
Protect a 6 inch air hose from physical damage
In Haskell, when using the XStrict language extension, is if short-circuiting?
Declaring a visitor to the UK as my "girlfriend" - effect on getting a Visitor visa?
How to remove the Add to Cart button from Catalog pages in Magento 2?
Magento 2.2.5: Disable Add to Cart buttonMeesed up “Add to cart” button in product pagesRemove Add to Cart button on select productsMagento 2: How to remove add to cart template from product detail pageMagento 2: add product (catalog) to cart when button is clickedHow to add “Empty Cart” button to minicartMagento 2 remove options from item cartMagento2 Add to cart button in row with grouped ProductsMagento2: How to remove ‘Add New’ button from Admin Grid?Magento 2 | Remove add to cart from catalog/category/view/How to add 'addToCart' GA event to Add To Cart button on wishlist page?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
How to remove the Add to Cart button from Catalog pages only?
magento2 theme design
add a comment |
How to remove the Add to Cart button from Catalog pages only?
magento2 theme design
add a comment |
How to remove the Add to Cart button from Catalog pages only?
magento2 theme design
How to remove the Add to Cart button from Catalog pages only?
magento2 theme design
magento2 theme design
asked May 3 '16 at 23:01
Luis GarciaLuis Garcia
6745 gold badges23 silver badges44 bronze badges
6745 gold badges23 silver badges44 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
In Magento 2 they've hardcoded them into the catalog product list template.
This can be found around line 80 of app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
:
<?php if ($_product->isSaleable()): ?>
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
</button>
</form>
A few options exist to suppress them:
- Create an
around
plugin for the block and change$_product->isSaleable()
to return false for the render of the template, and swap it back afterward - Replace this template in your custom theme's layout
- Hide with CSS
Honestly hiding via CSS isn't the worst option here:
.catalog-category-view .action.tocart display: none;
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Actually I tried to make salable false usingcatalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle
– siddhesh
Jul 21 '17 at 14:22
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
add a comment |
You can always hide it via CSS but i will highly recommend to copy the app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
into YourVendor/YourTheme/Magento_Catalog/view/frontend/templates/product/list.phtml
and remove all the form code fall in the if ($_product->isSaleable()):
condition.
add a comment |
protected by Community♦ Jan 6 '17 at 12:59
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In Magento 2 they've hardcoded them into the catalog product list template.
This can be found around line 80 of app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
:
<?php if ($_product->isSaleable()): ?>
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
</button>
</form>
A few options exist to suppress them:
- Create an
around
plugin for the block and change$_product->isSaleable()
to return false for the render of the template, and swap it back afterward - Replace this template in your custom theme's layout
- Hide with CSS
Honestly hiding via CSS isn't the worst option here:
.catalog-category-view .action.tocart display: none;
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Actually I tried to make salable false usingcatalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle
– siddhesh
Jul 21 '17 at 14:22
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
add a comment |
In Magento 2 they've hardcoded them into the catalog product list template.
This can be found around line 80 of app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
:
<?php if ($_product->isSaleable()): ?>
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
</button>
</form>
A few options exist to suppress them:
- Create an
around
plugin for the block and change$_product->isSaleable()
to return false for the render of the template, and swap it back afterward - Replace this template in your custom theme's layout
- Hide with CSS
Honestly hiding via CSS isn't the worst option here:
.catalog-category-view .action.tocart display: none;
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Actually I tried to make salable false usingcatalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle
– siddhesh
Jul 21 '17 at 14:22
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
add a comment |
In Magento 2 they've hardcoded them into the catalog product list template.
This can be found around line 80 of app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
:
<?php if ($_product->isSaleable()): ?>
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
</button>
</form>
A few options exist to suppress them:
- Create an
around
plugin for the block and change$_product->isSaleable()
to return false for the render of the template, and swap it back afterward - Replace this template in your custom theme's layout
- Hide with CSS
Honestly hiding via CSS isn't the worst option here:
.catalog-category-view .action.tocart display: none;
In Magento 2 they've hardcoded them into the catalog product list template.
This can be found around line 80 of app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
:
<?php if ($_product->isSaleable()): ?>
<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
</button>
</form>
A few options exist to suppress them:
- Create an
around
plugin for the block and change$_product->isSaleable()
to return false for the render of the template, and swap it back afterward - Replace this template in your custom theme's layout
- Hide with CSS
Honestly hiding via CSS isn't the worst option here:
.catalog-category-view .action.tocart display: none;
edited May 4 '16 at 22:54
answered May 4 '16 at 0:27
philwinklephilwinkle
33.6k5 gold badges83 silver badges145 bronze badges
33.6k5 gold badges83 silver badges145 bronze badges
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Actually I tried to make salable false usingcatalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle
– siddhesh
Jul 21 '17 at 14:22
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
add a comment |
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Actually I tried to make salable false usingcatalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle
– siddhesh
Jul 21 '17 at 14:22
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Hiding via CSS also removed the "Add to Cart" button from product pages. Is there a way to remove it only from Catalog pages?
– Luis Garcia
May 4 '16 at 17:38
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Ah yes. See the update.
– philwinkle
May 4 '16 at 22:53
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Can you elaborate fist option plugin around to chang $_product->isSaleable()
– siddhesh
Jul 21 '17 at 14:12
Actually I tried to make salable false using
catalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle– siddhesh
Jul 21 '17 at 14:22
Actually I tried to make salable false using
catalog_product_is_salable_after
event but it gives side effects like it doesn't show product options, it's make product qty 0 and show product as 'out of stock' I would like to do it only for addtocart renderer only.@philwinkle– siddhesh
Jul 21 '17 at 14:22
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
It can be remove using the layout overide the file in the catalog_product_view.xml file in the theme folder. <referenceBlock name="product.info.addtocart.additional" remove="true" />
– Divya
Jul 24 at 4:50
add a comment |
You can always hide it via CSS but i will highly recommend to copy the app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
into YourVendor/YourTheme/Magento_Catalog/view/frontend/templates/product/list.phtml
and remove all the form code fall in the if ($_product->isSaleable()):
condition.
add a comment |
You can always hide it via CSS but i will highly recommend to copy the app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
into YourVendor/YourTheme/Magento_Catalog/view/frontend/templates/product/list.phtml
and remove all the form code fall in the if ($_product->isSaleable()):
condition.
add a comment |
You can always hide it via CSS but i will highly recommend to copy the app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
into YourVendor/YourTheme/Magento_Catalog/view/frontend/templates/product/list.phtml
and remove all the form code fall in the if ($_product->isSaleable()):
condition.
You can always hide it via CSS but i will highly recommend to copy the app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
into YourVendor/YourTheme/Magento_Catalog/view/frontend/templates/product/list.phtml
and remove all the form code fall in the if ($_product->isSaleable()):
condition.
edited Jun 6 '17 at 3:32
sv3n
10.2k6 gold badges25 silver badges57 bronze badges
10.2k6 gold badges25 silver badges57 bronze badges
answered Jun 5 '17 at 20:59
Zeeshan KhuwajaZeeshan Khuwaja
5174 silver badges14 bronze badges
5174 silver badges14 bronze badges
add a comment |
add a comment |
protected by Community♦ Jan 6 '17 at 12:59
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?