How i can join eav_attribute_option_value table into my collection and get from him “frontend_label” of colors?Join Collection to tableJoin Collection With Country TableHow to join custom table with product collectionHow to Get Distinct Entries from Joined Tables Through Join()How to join a calculated column from a table to collectionHow to get collection from table 'sales_flat_creditmemo_item'Get multiple element in join on sql request into collectionJoin Collection with other table to get title from another tableLeft join on custom collection, to get product name by product IDHow to join Sales order collection and order item collection

How do I run a game when my PCs have different approaches to combat?

Determine if a triangle is equilateral, isosceles, or scalene

How may I shorten this shell script?

Book with a female main character living in a convent who has to fight gods

What is "ass door"?

Is the 2-Category of groupoids locally presentable?

Does static fire reduce reliability?

Why are angular mometum and angular velocity not necessarily parallel, but linear momentum and linear velocity are always parallel?

Sitecore Powershell extensions module compatibility with Sitecore 9.2

Why keep the bed heated after initial layer(s) with PLA (or PETG)?

Area of parallelogram = Area of square. Shear transform

Spacing setting of math mode

Can GPL and BSD licensed applications be used for government work?

How can I create a shape in Illustrator which follows a path in descending order size?

Why did NASA use U.S customary units?

Passing lines from the text file of a list of files to or as arguments

Strange Cron Job takes up 100% of CPU Ubuntu 18 LTS Server

Will LSST make a significant increase in the rate of astronomical event alerts?

Where to place an artificial gland in the human body?

What should I say when a company asks you why someone (a friend) who was fired left?

Other than a swing wing, what types of variable geometry have flown?

Is the apartment I want to rent a scam?

Sextortion with actual password not found in leaks

How do campaign rallies gain candidates votes?



How i can join eav_attribute_option_value table into my collection and get from him “frontend_label” of colors?


Join Collection to tableJoin Collection With Country TableHow to join custom table with product collectionHow to Get Distinct Entries from Joined Tables Through Join()How to join a calculated column from a table to collectionHow to get collection from table 'sales_flat_creditmemo_item'Get multiple element in join on sql request into collectionJoin Collection with other table to get title from another tableLeft join on custom collection, to get product name by product IDHow to join Sales order collection and order item collection






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








0















I have a products collections. But in "color" i see option_id number.



Mage::getModel('catalog/product')
->getCollection()
->addStoreFilter(Mage::app()->getStore())
->addAttributeToSelect('color')
->addAttributeToSelect('url_path')
->addAttributeToFilter('name', $name)
->addAttributeToFilter('status', 1)
->addAttributeToFilter('visibility', 4);


How i can join eav_attribute_option_value table into my collection and get from him "frontend_label" of colors?










share|improve this question




























    0















    I have a products collections. But in "color" i see option_id number.



    Mage::getModel('catalog/product')
    ->getCollection()
    ->addStoreFilter(Mage::app()->getStore())
    ->addAttributeToSelect('color')
    ->addAttributeToSelect('url_path')
    ->addAttributeToFilter('name', $name)
    ->addAttributeToFilter('status', 1)
    ->addAttributeToFilter('visibility', 4);


    How i can join eav_attribute_option_value table into my collection and get from him "frontend_label" of colors?










    share|improve this question
























      0












      0








      0








      I have a products collections. But in "color" i see option_id number.



      Mage::getModel('catalog/product')
      ->getCollection()
      ->addStoreFilter(Mage::app()->getStore())
      ->addAttributeToSelect('color')
      ->addAttributeToSelect('url_path')
      ->addAttributeToFilter('name', $name)
      ->addAttributeToFilter('status', 1)
      ->addAttributeToFilter('visibility', 4);


      How i can join eav_attribute_option_value table into my collection and get from him "frontend_label" of colors?










      share|improve this question














      I have a products collections. But in "color" i see option_id number.



      Mage::getModel('catalog/product')
      ->getCollection()
      ->addStoreFilter(Mage::app()->getStore())
      ->addAttributeToSelect('color')
      ->addAttributeToSelect('url_path')
      ->addAttributeToFilter('name', $name)
      ->addAttributeToFilter('status', 1)
      ->addAttributeToFilter('visibility', 4);


      How i can join eav_attribute_option_value table into my collection and get from him "frontend_label" of colors?







      collection attribute-options join






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 10 '17 at 12:31









      Sergiy NenkoSergiy Nenko

      413 bronze badges




      413 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can not use "eav_attribute_option_value" directly its store only store_id, option_id and value SO before join with eav_attribute_option_value table you have to join with "catalog_product_entity_int"



          $coll = Mage::getModel('catalog/product')
          ->getCollection()
          ->addStoreFilter(Mage::app()->getStore())
          //->addAttributeToFilter('test_option_value' , 232)
          ->addAttributeToFilter('status', 1);
          $coll->getSelect()->joinLeft(array('c_p_e_i'=>'catalog_product_entity_int'),'e.entity_id = c_p_e_i.entity_id',array('value'));
          $coll->getSelect()->joinLeft(array('attribute_option'=>'eav_attribute_option_value'),'c_p_e_i.value = attribute_option.option_id and attribute_option.store_id = 0',array('eaov_val'=>'value' , 'eaov_option'=>'option_id'));

          $attribute_name = 'test1';
          echo $coll->getSelect()->where("`attribute_option`.`value` = '$attribute_name'");
          die();


          cheers






          share|improve this answer

























            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%2f169457%2fhow-i-can-join-eav-attribute-option-value-table-into-my-collection-and-get-from%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














            You can not use "eav_attribute_option_value" directly its store only store_id, option_id and value SO before join with eav_attribute_option_value table you have to join with "catalog_product_entity_int"



            $coll = Mage::getModel('catalog/product')
            ->getCollection()
            ->addStoreFilter(Mage::app()->getStore())
            //->addAttributeToFilter('test_option_value' , 232)
            ->addAttributeToFilter('status', 1);
            $coll->getSelect()->joinLeft(array('c_p_e_i'=>'catalog_product_entity_int'),'e.entity_id = c_p_e_i.entity_id',array('value'));
            $coll->getSelect()->joinLeft(array('attribute_option'=>'eav_attribute_option_value'),'c_p_e_i.value = attribute_option.option_id and attribute_option.store_id = 0',array('eaov_val'=>'value' , 'eaov_option'=>'option_id'));

            $attribute_name = 'test1';
            echo $coll->getSelect()->where("`attribute_option`.`value` = '$attribute_name'");
            die();


            cheers






            share|improve this answer



























              0














              You can not use "eav_attribute_option_value" directly its store only store_id, option_id and value SO before join with eav_attribute_option_value table you have to join with "catalog_product_entity_int"



              $coll = Mage::getModel('catalog/product')
              ->getCollection()
              ->addStoreFilter(Mage::app()->getStore())
              //->addAttributeToFilter('test_option_value' , 232)
              ->addAttributeToFilter('status', 1);
              $coll->getSelect()->joinLeft(array('c_p_e_i'=>'catalog_product_entity_int'),'e.entity_id = c_p_e_i.entity_id',array('value'));
              $coll->getSelect()->joinLeft(array('attribute_option'=>'eav_attribute_option_value'),'c_p_e_i.value = attribute_option.option_id and attribute_option.store_id = 0',array('eaov_val'=>'value' , 'eaov_option'=>'option_id'));

              $attribute_name = 'test1';
              echo $coll->getSelect()->where("`attribute_option`.`value` = '$attribute_name'");
              die();


              cheers






              share|improve this answer

























                0












                0








                0







                You can not use "eav_attribute_option_value" directly its store only store_id, option_id and value SO before join with eav_attribute_option_value table you have to join with "catalog_product_entity_int"



                $coll = Mage::getModel('catalog/product')
                ->getCollection()
                ->addStoreFilter(Mage::app()->getStore())
                //->addAttributeToFilter('test_option_value' , 232)
                ->addAttributeToFilter('status', 1);
                $coll->getSelect()->joinLeft(array('c_p_e_i'=>'catalog_product_entity_int'),'e.entity_id = c_p_e_i.entity_id',array('value'));
                $coll->getSelect()->joinLeft(array('attribute_option'=>'eav_attribute_option_value'),'c_p_e_i.value = attribute_option.option_id and attribute_option.store_id = 0',array('eaov_val'=>'value' , 'eaov_option'=>'option_id'));

                $attribute_name = 'test1';
                echo $coll->getSelect()->where("`attribute_option`.`value` = '$attribute_name'");
                die();


                cheers






                share|improve this answer













                You can not use "eav_attribute_option_value" directly its store only store_id, option_id and value SO before join with eav_attribute_option_value table you have to join with "catalog_product_entity_int"



                $coll = Mage::getModel('catalog/product')
                ->getCollection()
                ->addStoreFilter(Mage::app()->getStore())
                //->addAttributeToFilter('test_option_value' , 232)
                ->addAttributeToFilter('status', 1);
                $coll->getSelect()->joinLeft(array('c_p_e_i'=>'catalog_product_entity_int'),'e.entity_id = c_p_e_i.entity_id',array('value'));
                $coll->getSelect()->joinLeft(array('attribute_option'=>'eav_attribute_option_value'),'c_p_e_i.value = attribute_option.option_id and attribute_option.store_id = 0',array('eaov_val'=>'value' , 'eaov_option'=>'option_id'));

                $attribute_name = 'test1';
                echo $coll->getSelect()->where("`attribute_option`.`value` = '$attribute_name'");
                die();


                cheers







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 11 '17 at 11:34









                MonarchMonarch

                3683 silver badges10 bronze badges




                3683 silver badges10 bronze badges



























                    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%2f169457%2fhow-i-can-join-eav-attribute-option-value-table-into-my-collection-and-get-from%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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form