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;








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










share|improve this question






























    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










    share|improve this question


























      0












      0








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer























          • 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













          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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.






          share|improve this answer























          • 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















          0














          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.






          share|improve this answer























          • 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













          0












          0








          0







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?