How to add remove from cart button onto category pageAdd to Cart button redirects to empty cart on category view pageIssue with implementing Ajax Buy Now button to Magento List.phtmlStop “Please match the requested format: Qty.” from displaying when updating a decimal quantity field in shopping cartRemove Add To Cart Button in product List page magento2 without using template fileHow to Change the position of breadcrumbs in list page?remove Qty option from product add to cart pageRemove Category from Product Page titlewant to replace select button with add to cart button in product listHow to show products from subcategories in a category pageHow to remove default generated canonical tag in category page?
Would dual wielding daggers be a viable choice for a covert bodyguard?
How to know if blackberries are safe to eat
How quality assurance engineers test calculations?
Why weren't bootable game disks ever common on the IBM PC?
How can I effectively communicate to recruiters that a phone call is not possible?
Does Lufthansa weigh your carry on luggage?
Do I have a right to cancel a purchase of foreign currency in the UK?
OR-backed serious games
How do native German speakers usually express skepticism (using even) about a premise?
What is the measurable difference between dry basil and fresh?
Does Multiverse exist in MCU?
Are there any balance issues in allowing two half-feats to be taken without the Ability Score Increase instead of a feat?
Is English unusual in having no second person plural form?
Why didn't Thanos kill all the Dwarves on Nidavellir?
Why did Harry Potter get a bedroom?
How do you move up one folder in Finder?
What is a "shilicashe?"
What does the phrase "head down the rat's hole" mean here?
Why isn't pressure filtration popular compared to vacuum filtration?
How to deal with moral/legal subjects in writing?
The tensor product of two monoidal categories
Why would non-kinetic weapons be used for orbital bombardment?
Is a request to book a business flight ticket for a graduate student an unreasonable one?
Confirming the Identity of a (Friendly) Reviewer After the Reviews
How to add remove from cart button onto category page
Add to Cart button redirects to empty cart on category view pageIssue with implementing Ajax Buy Now button to Magento List.phtmlStop “Please match the requested format: Qty.” from displaying when updating a decimal quantity field in shopping cartRemove Add To Cart Button in product List page magento2 without using template fileHow to Change the position of breadcrumbs in list page?remove Qty option from product add to cart pageRemove Category from Product Page titlewant to replace select button with add to cart button in product listHow to show products from subcategories in a category pageHow to remove default generated canonical tag in category page?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am currently developing Magento 1.9 (yes I know it's outdated) and they have requested remove from cart buttons on the category page (list.phtml), however, I cannot seem to find a way to add the button.
I have successfully added the button to the page, but can't seem to get the actual like to be correct with the correct data, I believe this to be because I cannot match the quote id to the product id correctly, however it also seems that this gives a much shorter form key than what is normally used by Magento.
$productid = $_product->getId();
<a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $productid, Mage_Core_Model_Url::FORM_KEY => $this->_getSingletonModel('core/session')->getFormKey())); ?>">X</a>
Any help would be much appreciated
magento-1.9 category-listing list.phtml
add a comment |
I am currently developing Magento 1.9 (yes I know it's outdated) and they have requested remove from cart buttons on the category page (list.phtml), however, I cannot seem to find a way to add the button.
I have successfully added the button to the page, but can't seem to get the actual like to be correct with the correct data, I believe this to be because I cannot match the quote id to the product id correctly, however it also seems that this gives a much shorter form key than what is normally used by Magento.
$productid = $_product->getId();
<a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $productid, Mage_Core_Model_Url::FORM_KEY => $this->_getSingletonModel('core/session')->getFormKey())); ?>">X</a>
Any help would be much appreciated
magento-1.9 category-listing list.phtml
add a comment |
I am currently developing Magento 1.9 (yes I know it's outdated) and they have requested remove from cart buttons on the category page (list.phtml), however, I cannot seem to find a way to add the button.
I have successfully added the button to the page, but can't seem to get the actual like to be correct with the correct data, I believe this to be because I cannot match the quote id to the product id correctly, however it also seems that this gives a much shorter form key than what is normally used by Magento.
$productid = $_product->getId();
<a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $productid, Mage_Core_Model_Url::FORM_KEY => $this->_getSingletonModel('core/session')->getFormKey())); ?>">X</a>
Any help would be much appreciated
magento-1.9 category-listing list.phtml
I am currently developing Magento 1.9 (yes I know it's outdated) and they have requested remove from cart buttons on the category page (list.phtml), however, I cannot seem to find a way to add the button.
I have successfully added the button to the page, but can't seem to get the actual like to be correct with the correct data, I believe this to be because I cannot match the quote id to the product id correctly, however it also seems that this gives a much shorter form key than what is normally used by Magento.
$productid = $_product->getId();
<a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $productid, Mage_Core_Model_Url::FORM_KEY => $this->_getSingletonModel('core/session')->getFormKey())); ?>">X</a>
Any help would be much appreciated
magento-1.9 category-listing list.phtml
magento-1.9 category-listing list.phtml
edited Jul 2 at 9:16
poojan sharma
8511 silver badge10 bronze badges
8511 silver badge10 bronze badges
asked Jul 2 at 8:39
Mage NoobMage Noob
208 bronze badges
208 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This could help you.
Override below file
/app/design/frontend/rwd/default/template/catalog/product/list.phtml
Put below code in **<ul class="add-to-links">**
<?php
$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item)
$productName = $item->getProduct()->getName();
if($productName == $_product->getName()) ?>
<a href="<?= $this->getBaseUrl().'custommodule/index/deleteItem/id/'.$item->getId() ?>" class="link-wishlist"><?php echo $this->__('Remove form cart') ?></a>
<?php
?>
Now in your custom controller place this function:
public function deleteItemAction()
$cartItemId = $this->getRequest()->getParam('id');
$cartHelper = Mage::helper('checkout/cart');
$cartHelper->getCart()->removeItem($cartItemId)->save();
$this->_redirectReferer();
I have tested it's working properly.
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
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%2f280401%2fhow-to-add-remove-from-cart-button-onto-category-page%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This could help you.
Override below file
/app/design/frontend/rwd/default/template/catalog/product/list.phtml
Put below code in **<ul class="add-to-links">**
<?php
$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item)
$productName = $item->getProduct()->getName();
if($productName == $_product->getName()) ?>
<a href="<?= $this->getBaseUrl().'custommodule/index/deleteItem/id/'.$item->getId() ?>" class="link-wishlist"><?php echo $this->__('Remove form cart') ?></a>
<?php
?>
Now in your custom controller place this function:
public function deleteItemAction()
$cartItemId = $this->getRequest()->getParam('id');
$cartHelper = Mage::helper('checkout/cart');
$cartHelper->getCart()->removeItem($cartItemId)->save();
$this->_redirectReferer();
I have tested it's working properly.
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
add a comment |
This could help you.
Override below file
/app/design/frontend/rwd/default/template/catalog/product/list.phtml
Put below code in **<ul class="add-to-links">**
<?php
$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item)
$productName = $item->getProduct()->getName();
if($productName == $_product->getName()) ?>
<a href="<?= $this->getBaseUrl().'custommodule/index/deleteItem/id/'.$item->getId() ?>" class="link-wishlist"><?php echo $this->__('Remove form cart') ?></a>
<?php
?>
Now in your custom controller place this function:
public function deleteItemAction()
$cartItemId = $this->getRequest()->getParam('id');
$cartHelper = Mage::helper('checkout/cart');
$cartHelper->getCart()->removeItem($cartItemId)->save();
$this->_redirectReferer();
I have tested it's working properly.
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
add a comment |
This could help you.
Override below file
/app/design/frontend/rwd/default/template/catalog/product/list.phtml
Put below code in **<ul class="add-to-links">**
<?php
$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item)
$productName = $item->getProduct()->getName();
if($productName == $_product->getName()) ?>
<a href="<?= $this->getBaseUrl().'custommodule/index/deleteItem/id/'.$item->getId() ?>" class="link-wishlist"><?php echo $this->__('Remove form cart') ?></a>
<?php
?>
Now in your custom controller place this function:
public function deleteItemAction()
$cartItemId = $this->getRequest()->getParam('id');
$cartHelper = Mage::helper('checkout/cart');
$cartHelper->getCart()->removeItem($cartItemId)->save();
$this->_redirectReferer();
I have tested it's working properly.
This could help you.
Override below file
/app/design/frontend/rwd/default/template/catalog/product/list.phtml
Put below code in **<ul class="add-to-links">**
<?php
$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item)
$productName = $item->getProduct()->getName();
if($productName == $_product->getName()) ?>
<a href="<?= $this->getBaseUrl().'custommodule/index/deleteItem/id/'.$item->getId() ?>" class="link-wishlist"><?php echo $this->__('Remove form cart') ?></a>
<?php
?>
Now in your custom controller place this function:
public function deleteItemAction()
$cartItemId = $this->getRequest()->getParam('id');
$cartHelper = Mage::helper('checkout/cart');
$cartHelper->getCart()->removeItem($cartItemId)->save();
$this->_redirectReferer();
I have tested it's working properly.
answered Jul 2 at 10:03
Ravi SoniRavi Soni
1,0415 silver badges18 bronze badges
1,0415 silver badges18 bronze badges
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
add a comment |
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Thank you very much this worked perfectly.
– Mage Noob
Jul 2 at 11:08
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
Welcome, Please mark as right answer and also upvote if it helps you. :)
– Ravi Soni
Jul 2 at 11:11
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%2f280401%2fhow-to-add-remove-from-cart-button-onto-category-page%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