Get tiered price by customer group id Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Getting Current Customer Group Price, and Tier PriceGroup Price ReportHowto disable Price per Customer group?Multi Select Customer Group Promotion Price Rules Not Appliedcustomer group restriction and price managementCopy Customer Group and Group PriceHow to add price for the customer group and add it to the customer registration pageMagento 2: How to display all Customer Group Price on Product Detail PageMagento 2.2.1 Bug price by customer group not working after add to cartHow to get all bundle items price as per selected customer group level price?Get Product price by customer Group magento 2

What helicopter has the most rotor blades?

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

How is an IPA symbol that lacks a name (e.g. ɲ) called?

Why not use the yoke to control yaw, as well as pitch and roll?

Protagonist's race is hidden - should I reveal it?

Why did Europeans not widely domesticate foxes?

Why do people think Winterfell crypts is the safest place for women, children & old people?

Married in secret, can marital status in passport be changed at a later date?

How do I deal with an erroneously large refund?

Does traveling In The United States require a passport or can I use my green card if not a US citizen?

Etymology of 見舞い

Can gravitational waves pass through a black hole?

Would I be safe to drive a 23 year old truck for 7 hours / 450 miles?

What could prevent concentrated local exploration?

Import keychain to clean macOS install?

How to charge percentage of transaction cost?

reduction from 3-SAT to Subset Sum problem

Determine the generator of an ideal of ring of integers

Unix AIX passing variable and arguments to expect and spawn

Pointing to problems without suggesting solutions

Is "ein Herz wie das meine" an antiquated or colloquial use of the possesive pronoun?

Can 'non' with gerundive mean both lack of obligation and negative obligation?

tabularx column has extra padding at right?

Compiling and throwing simple dynamic exceptions at runtime for JVM



Get tiered price by customer group id



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Getting Current Customer Group Price, and Tier PriceGroup Price ReportHowto disable Price per Customer group?Multi Select Customer Group Promotion Price Rules Not Appliedcustomer group restriction and price managementCopy Customer Group and Group PriceHow to add price for the customer group and add it to the customer registration pageMagento 2: How to display all Customer Group Price on Product Detail PageMagento 2.2.1 Bug price by customer group not working after add to cartHow to get all bundle items price as per selected customer group level price?Get Product price by customer Group magento 2



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm writing a maintenance script to tidy up unused customer group tiered prices. How can I programatically get either:
All products that have a tiered price for the selected customer group and then delete the tiered price for that group
OR
Check if a product has a tiered price for the selected customer group and then delete the tiered price for that group.



Bear in mind I don't know the quantity, only the group id so I can't use getTierPrice() as that needs a quantity.



How do I delete the tiered price? Can I just use setTierPrice() and set the price and quantity to 0?










share|improve this question
















bumped to the homepage by Community 20 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Possible duplicate of Getting Current Customer Group Price, and Tier Price

    – Teja Bhagavan Kollepara
    Dec 28 '17 at 16:01

















0















I'm writing a maintenance script to tidy up unused customer group tiered prices. How can I programatically get either:
All products that have a tiered price for the selected customer group and then delete the tiered price for that group
OR
Check if a product has a tiered price for the selected customer group and then delete the tiered price for that group.



Bear in mind I don't know the quantity, only the group id so I can't use getTierPrice() as that needs a quantity.



How do I delete the tiered price? Can I just use setTierPrice() and set the price and quantity to 0?










share|improve this question
















bumped to the homepage by Community 20 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Possible duplicate of Getting Current Customer Group Price, and Tier Price

    – Teja Bhagavan Kollepara
    Dec 28 '17 at 16:01













0












0








0








I'm writing a maintenance script to tidy up unused customer group tiered prices. How can I programatically get either:
All products that have a tiered price for the selected customer group and then delete the tiered price for that group
OR
Check if a product has a tiered price for the selected customer group and then delete the tiered price for that group.



Bear in mind I don't know the quantity, only the group id so I can't use getTierPrice() as that needs a quantity.



How do I delete the tiered price? Can I just use setTierPrice() and set the price and quantity to 0?










share|improve this question
















I'm writing a maintenance script to tidy up unused customer group tiered prices. How can I programatically get either:
All products that have a tiered price for the selected customer group and then delete the tiered price for that group
OR
Check if a product has a tiered price for the selected customer group and then delete the tiered price for that group.



Bear in mind I don't know the quantity, only the group id so I can't use getTierPrice() as that needs a quantity.



How do I delete the tiered price? Can I just use setTierPrice() and set the price and quantity to 0?







magento-1.9 customer-group tierprice






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '15 at 18:28









Amit Bera

60.2k1678178




60.2k1678178










asked Nov 23 '15 at 14:33









Denial DesignDenial Design

9813




9813





bumped to the homepage by Community 20 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 20 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Possible duplicate of Getting Current Customer Group Price, and Tier Price

    – Teja Bhagavan Kollepara
    Dec 28 '17 at 16:01

















  • Possible duplicate of Getting Current Customer Group Price, and Tier Price

    – Teja Bhagavan Kollepara
    Dec 28 '17 at 16:01
















Possible duplicate of Getting Current Customer Group Price, and Tier Price

– Teja Bhagavan Kollepara
Dec 28 '17 at 16:01





Possible duplicate of Getting Current Customer Group Price, and Tier Price

– Teja Bhagavan Kollepara
Dec 28 '17 at 16:01










2 Answers
2






active

oldest

votes


















0














$roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
$TierPrice = $product->getData('tier_price');
$customer_grouptier = array_column($TierPrice, 'price','cust_group');
$customer_tier = $customer_grouptier[$roleId];


$product is the product Object.


More information click below.
Getting Current Customer Group Price, and Tier Price






share|improve this answer
































    -1














    Go to magento admin > product manager > edit a producct > price tab, add price according to customer group, then use the below code to display the price according to customer group ID but you need to loged-in first a customer to check the customer ID



    $now = Mage::getSingleton('core/date')->timestamp( time() );
    $websiteId = Mage::app()->getStore()->getWebsiteId();
    $customerGroup = 4; /* get logged-in customer group ID */

    Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);


    If you are in product listing OR detail page you can also use this code:



    $product = Mage::getModel('catalog/product')->load($productId);


    $groupPrices = $product->getData('group_price')



    Enjoy! it will help you.






    share|improve this answer























    • Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

      – Denial Design
      Nov 23 '15 at 19:01












    • you have added price as per group from admin?

      – Surya prakash Patel
      Nov 24 '15 at 6:29











    • Yes, the tiered prices have been added.

      – Denial Design
      Nov 24 '15 at 10:38











    • Not Tire prices, add "Group Price" and then check again

      – Surya prakash Patel
      Nov 24 '15 at 11:14











    • I'm not using group prices, I'm using tiered pricing.

      – Denial Design
      Nov 24 '15 at 11:42











    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%2f91250%2fget-tiered-price-by-customer-group-id%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









    0














    $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
    $TierPrice = $product->getData('tier_price');
    $customer_grouptier = array_column($TierPrice, 'price','cust_group');
    $customer_tier = $customer_grouptier[$roleId];


    $product is the product Object.


    More information click below.
    Getting Current Customer Group Price, and Tier Price






    share|improve this answer





























      0














      $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
      $TierPrice = $product->getData('tier_price');
      $customer_grouptier = array_column($TierPrice, 'price','cust_group');
      $customer_tier = $customer_grouptier[$roleId];


      $product is the product Object.


      More information click below.
      Getting Current Customer Group Price, and Tier Price






      share|improve this answer



























        0












        0








        0







        $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
        $TierPrice = $product->getData('tier_price');
        $customer_grouptier = array_column($TierPrice, 'price','cust_group');
        $customer_tier = $customer_grouptier[$roleId];


        $product is the product Object.


        More information click below.
        Getting Current Customer Group Price, and Tier Price






        share|improve this answer















        $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
        $TierPrice = $product->getData('tier_price');
        $customer_grouptier = array_column($TierPrice, 'price','cust_group');
        $customer_tier = $customer_grouptier[$roleId];


        $product is the product Object.


        More information click below.
        Getting Current Customer Group Price, and Tier Price







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:55









        Community

        1




        1










        answered Nov 28 '16 at 10:21









        CrockCrock

        454313




        454313























            -1














            Go to magento admin > product manager > edit a producct > price tab, add price according to customer group, then use the below code to display the price according to customer group ID but you need to loged-in first a customer to check the customer ID



            $now = Mage::getSingleton('core/date')->timestamp( time() );
            $websiteId = Mage::app()->getStore()->getWebsiteId();
            $customerGroup = 4; /* get logged-in customer group ID */

            Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);


            If you are in product listing OR detail page you can also use this code:



            $product = Mage::getModel('catalog/product')->load($productId);


            $groupPrices = $product->getData('group_price')



            Enjoy! it will help you.






            share|improve this answer























            • Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

              – Denial Design
              Nov 23 '15 at 19:01












            • you have added price as per group from admin?

              – Surya prakash Patel
              Nov 24 '15 at 6:29











            • Yes, the tiered prices have been added.

              – Denial Design
              Nov 24 '15 at 10:38











            • Not Tire prices, add "Group Price" and then check again

              – Surya prakash Patel
              Nov 24 '15 at 11:14











            • I'm not using group prices, I'm using tiered pricing.

              – Denial Design
              Nov 24 '15 at 11:42















            -1














            Go to magento admin > product manager > edit a producct > price tab, add price according to customer group, then use the below code to display the price according to customer group ID but you need to loged-in first a customer to check the customer ID



            $now = Mage::getSingleton('core/date')->timestamp( time() );
            $websiteId = Mage::app()->getStore()->getWebsiteId();
            $customerGroup = 4; /* get logged-in customer group ID */

            Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);


            If you are in product listing OR detail page you can also use this code:



            $product = Mage::getModel('catalog/product')->load($productId);


            $groupPrices = $product->getData('group_price')



            Enjoy! it will help you.






            share|improve this answer























            • Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

              – Denial Design
              Nov 23 '15 at 19:01












            • you have added price as per group from admin?

              – Surya prakash Patel
              Nov 24 '15 at 6:29











            • Yes, the tiered prices have been added.

              – Denial Design
              Nov 24 '15 at 10:38











            • Not Tire prices, add "Group Price" and then check again

              – Surya prakash Patel
              Nov 24 '15 at 11:14











            • I'm not using group prices, I'm using tiered pricing.

              – Denial Design
              Nov 24 '15 at 11:42













            -1












            -1








            -1







            Go to magento admin > product manager > edit a producct > price tab, add price according to customer group, then use the below code to display the price according to customer group ID but you need to loged-in first a customer to check the customer ID



            $now = Mage::getSingleton('core/date')->timestamp( time() );
            $websiteId = Mage::app()->getStore()->getWebsiteId();
            $customerGroup = 4; /* get logged-in customer group ID */

            Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);


            If you are in product listing OR detail page you can also use this code:



            $product = Mage::getModel('catalog/product')->load($productId);


            $groupPrices = $product->getData('group_price')



            Enjoy! it will help you.






            share|improve this answer













            Go to magento admin > product manager > edit a producct > price tab, add price according to customer group, then use the below code to display the price according to customer group ID but you need to loged-in first a customer to check the customer ID



            $now = Mage::getSingleton('core/date')->timestamp( time() );
            $websiteId = Mage::app()->getStore()->getWebsiteId();
            $customerGroup = 4; /* get logged-in customer group ID */

            Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);


            If you are in product listing OR detail page you can also use this code:



            $product = Mage::getModel('catalog/product')->load($productId);


            $groupPrices = $product->getData('group_price')



            Enjoy! it will help you.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 23 '15 at 16:07









            Surya prakash PatelSurya prakash Patel

            184119




            184119












            • Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

              – Denial Design
              Nov 23 '15 at 19:01












            • you have added price as per group from admin?

              – Surya prakash Patel
              Nov 24 '15 at 6:29











            • Yes, the tiered prices have been added.

              – Denial Design
              Nov 24 '15 at 10:38











            • Not Tire prices, add "Group Price" and then check again

              – Surya prakash Patel
              Nov 24 '15 at 11:14











            • I'm not using group prices, I'm using tiered pricing.

              – Denial Design
              Nov 24 '15 at 11:42

















            • Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

              – Denial Design
              Nov 23 '15 at 19:01












            • you have added price as per group from admin?

              – Surya prakash Patel
              Nov 24 '15 at 6:29











            • Yes, the tiered prices have been added.

              – Denial Design
              Nov 24 '15 at 10:38











            • Not Tire prices, add "Group Price" and then check again

              – Surya prakash Patel
              Nov 24 '15 at 11:14











            • I'm not using group prices, I'm using tiered pricing.

              – Denial Design
              Nov 24 '15 at 11:42
















            Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

            – Denial Design
            Nov 23 '15 at 19:01






            Sorry but that doesn't seem to work. If I echo: $price = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId); it doesn't return anything

            – Denial Design
            Nov 23 '15 at 19:01














            you have added price as per group from admin?

            – Surya prakash Patel
            Nov 24 '15 at 6:29





            you have added price as per group from admin?

            – Surya prakash Patel
            Nov 24 '15 at 6:29













            Yes, the tiered prices have been added.

            – Denial Design
            Nov 24 '15 at 10:38





            Yes, the tiered prices have been added.

            – Denial Design
            Nov 24 '15 at 10:38













            Not Tire prices, add "Group Price" and then check again

            – Surya prakash Patel
            Nov 24 '15 at 11:14





            Not Tire prices, add "Group Price" and then check again

            – Surya prakash Patel
            Nov 24 '15 at 11:14













            I'm not using group prices, I'm using tiered pricing.

            – Denial Design
            Nov 24 '15 at 11:42





            I'm not using group prices, I'm using tiered pricing.

            – Denial Design
            Nov 24 '15 at 11:42

















            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%2f91250%2fget-tiered-price-by-customer-group-id%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

            Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

            Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

            Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»