How to check if Magento Shopping Cart Price Rule Conditions have been metHow to check if shopping cart price...

How to prevent users from executing commands through browser URL

What is the purpose of easy combat scenarios that don't need resource expenditure?

Why would space fleets be aligned?

Why do no American passenger airlines still operate dedicated cargo flights?

Digits in an algebraic irrational number

Why do neural networks need so many training examples to perform?

If I deleted a game I lost the disc for, can I reinstall it digitally?

How to remove lines through the legend markers in ListPlot?

Why isn't there a non-conducting core wire for high-frequency coil applications

Find some digits of factorial 17

How much mayhem could I cause as a sentient fish?

Am I a Rude Number?

Avoiding morning and evening handshakes

Strange Sign on Lab Door

If I delete my router's history can my ISP still provide it to my parents?

How can I deliver in-universe written lore to players without it being dry exposition?

Why did other German political parties disband so fast when Hitler was appointed chancellor?

Can we use the stored gravitational potential energy of a building to produce power?

Would a National Army of mercenaries be a feasible idea?

How long is the D&D Starter Set campaign?

How should I handle players who ignore the session zero agreement?

Using only 1s, make 29 with the minimum number of digits

Why avoid shared user accounts?

How can I get my players to come to the game session after agreeing to a date?



How to check if Magento Shopping Cart Price Rule Conditions have been met


How to check if shopping cart price rule applied to quoteUse group price in shopping cart price rule conditionsHow to check if shopping cart price rule applied to quoteMagento shopping cart rule exclusion logicGet Applied shopping cart price rule/Catalog price Rule name in product details pageShopping card price rule NOT overriding catalog price ruleHow do I add a buy X get Y free product to cart programmatically with shopping cart rule?Exclude items from Cart Price Rule which have already Catalog Price RuleIssue in Fixed Amount Discount Shopping cart Price ruleShopping cart price rule with category exclusionsUsing special_price_to_date in shopping cart price rule













0















Really struggling with this. I'm trying to see if the conditions of a 'Shopping Cart Price Rule' have been met directly on the 'View Cart' page. If so, I want to add a product automatically to the cart.



I have been trying different methods using:



Mage::getModel('salesrule/rule')->load($id)->getConditions();


with the rule ID being 18, then echoing to see if it worked, no such luck yet.



I'm trying to make it so I can at least see if the conditions have been met before I try to automatically add a product to the cart.



Something along the lines of:



if (product conditions have been met) {
automatically add product to cart
}


I have already seen this How to check if shopping cart price rule applied to quote, however that is showing rules that have already been applied, rather than rule that 'could' be applied.



Any help would be much appreciated.



James










share|improve this question





























    0















    Really struggling with this. I'm trying to see if the conditions of a 'Shopping Cart Price Rule' have been met directly on the 'View Cart' page. If so, I want to add a product automatically to the cart.



    I have been trying different methods using:



    Mage::getModel('salesrule/rule')->load($id)->getConditions();


    with the rule ID being 18, then echoing to see if it worked, no such luck yet.



    I'm trying to make it so I can at least see if the conditions have been met before I try to automatically add a product to the cart.



    Something along the lines of:



    if (product conditions have been met) {
    automatically add product to cart
    }


    I have already seen this How to check if shopping cart price rule applied to quote, however that is showing rules that have already been applied, rather than rule that 'could' be applied.



    Any help would be much appreciated.



    James










    share|improve this question



























      0












      0








      0








      Really struggling with this. I'm trying to see if the conditions of a 'Shopping Cart Price Rule' have been met directly on the 'View Cart' page. If so, I want to add a product automatically to the cart.



      I have been trying different methods using:



      Mage::getModel('salesrule/rule')->load($id)->getConditions();


      with the rule ID being 18, then echoing to see if it worked, no such luck yet.



      I'm trying to make it so I can at least see if the conditions have been met before I try to automatically add a product to the cart.



      Something along the lines of:



      if (product conditions have been met) {
      automatically add product to cart
      }


      I have already seen this How to check if shopping cart price rule applied to quote, however that is showing rules that have already been applied, rather than rule that 'could' be applied.



      Any help would be much appreciated.



      James










      share|improve this question
















      Really struggling with this. I'm trying to see if the conditions of a 'Shopping Cart Price Rule' have been met directly on the 'View Cart' page. If so, I want to add a product automatically to the cart.



      I have been trying different methods using:



      Mage::getModel('salesrule/rule')->load($id)->getConditions();


      with the rule ID being 18, then echoing to see if it worked, no such luck yet.



      I'm trying to make it so I can at least see if the conditions have been met before I try to automatically add a product to the cart.



      Something along the lines of:



      if (product conditions have been met) {
      automatically add product to cart
      }


      I have already seen this How to check if shopping cart price rule applied to quote, however that is showing rules that have already been applied, rather than rule that 'could' be applied.



      Any help would be much appreciated.



      James







      shopping-cart-price-rules quote programmatically






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:54









      Community

      1




      1










      asked Feb 1 '16 at 18:00









      James LaneJames Lane

      294




      294






















          2 Answers
          2






          active

          oldest

          votes


















          1














          You need to make a Observer.php file where you will be defining your rule. So when that particular product or group of product will be added to the cart,at that moment,the Observer.php will be called,will apply the rule if applicable.



          I will be writing a blog on that and will be releasing it soon.For the time being,you better try to create a Observer.php file and define the rule there and see what happens next.



          Note:For that you will have to change the config.xml file for that particular module.






          share|improve this answer

































            0














            You need to go to this path as given below->
            Promotions->Shopping Cart Rules->(Click on the rule you defined)->Conditions
            And, you will get to know if any condition is defined for that particular rule or not.I am sharing the screenshot,refer to it.



            Shopping Cart Rule Condition Section






            share|improve this answer


























            • Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

              – James Lane
              Feb 3 '16 at 11:36











            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%2f99920%2fhow-to-check-if-magento-shopping-cart-price-rule-conditions-have-been-met%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            You need to make a Observer.php file where you will be defining your rule. So when that particular product or group of product will be added to the cart,at that moment,the Observer.php will be called,will apply the rule if applicable.



            I will be writing a blog on that and will be releasing it soon.For the time being,you better try to create a Observer.php file and define the rule there and see what happens next.



            Note:For that you will have to change the config.xml file for that particular module.






            share|improve this answer






























              1














              You need to make a Observer.php file where you will be defining your rule. So when that particular product or group of product will be added to the cart,at that moment,the Observer.php will be called,will apply the rule if applicable.



              I will be writing a blog on that and will be releasing it soon.For the time being,you better try to create a Observer.php file and define the rule there and see what happens next.



              Note:For that you will have to change the config.xml file for that particular module.






              share|improve this answer




























                1












                1








                1







                You need to make a Observer.php file where you will be defining your rule. So when that particular product or group of product will be added to the cart,at that moment,the Observer.php will be called,will apply the rule if applicable.



                I will be writing a blog on that and will be releasing it soon.For the time being,you better try to create a Observer.php file and define the rule there and see what happens next.



                Note:For that you will have to change the config.xml file for that particular module.






                share|improve this answer















                You need to make a Observer.php file where you will be defining your rule. So when that particular product or group of product will be added to the cart,at that moment,the Observer.php will be called,will apply the rule if applicable.



                I will be writing a blog on that and will be releasing it soon.For the time being,you better try to create a Observer.php file and define the rule there and see what happens next.



                Note:For that you will have to change the config.xml file for that particular module.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 54 mins ago









                Teja Bhagavan Kollepara

                2,96341847




                2,96341847










                answered Feb 3 '16 at 13:55









                Arijit DeArijit De

                262




                262

























                    0














                    You need to go to this path as given below->
                    Promotions->Shopping Cart Rules->(Click on the rule you defined)->Conditions
                    And, you will get to know if any condition is defined for that particular rule or not.I am sharing the screenshot,refer to it.



                    Shopping Cart Rule Condition Section






                    share|improve this answer


























                    • Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

                      – James Lane
                      Feb 3 '16 at 11:36
















                    0














                    You need to go to this path as given below->
                    Promotions->Shopping Cart Rules->(Click on the rule you defined)->Conditions
                    And, you will get to know if any condition is defined for that particular rule or not.I am sharing the screenshot,refer to it.



                    Shopping Cart Rule Condition Section






                    share|improve this answer


























                    • Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

                      – James Lane
                      Feb 3 '16 at 11:36














                    0












                    0








                    0







                    You need to go to this path as given below->
                    Promotions->Shopping Cart Rules->(Click on the rule you defined)->Conditions
                    And, you will get to know if any condition is defined for that particular rule or not.I am sharing the screenshot,refer to it.



                    Shopping Cart Rule Condition Section






                    share|improve this answer















                    You need to go to this path as given below->
                    Promotions->Shopping Cart Rules->(Click on the rule you defined)->Conditions
                    And, you will get to know if any condition is defined for that particular rule or not.I am sharing the screenshot,refer to it.



                    Shopping Cart Rule Condition Section







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 53 mins ago









                    Teja Bhagavan Kollepara

                    2,96341847




                    2,96341847










                    answered Feb 3 '16 at 10:57









                    Arijit DeArijit De

                    262




                    262













                    • Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

                      – James Lane
                      Feb 3 '16 at 11:36



















                    • Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

                      – James Lane
                      Feb 3 '16 at 11:36

















                    Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

                    – James Lane
                    Feb 3 '16 at 11:36





                    Hi Arijit, I get that, and understand the conditions part which I have already set up, but I want to automatically add a product to the cart when those conditions have been met, rather than the customer having to add the product manually. In my actions, I have already set the product to be added as 100% off the price.

                    – James Lane
                    Feb 3 '16 at 11:36


















                    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%2f99920%2fhow-to-check-if-magento-shopping-cart-price-rule-conditions-have-been-met%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

                    “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                    How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                    變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...