Color swatch and text swatch issue in magento 2How to change the dropdown option on a product page?How to display crossed swatches for not available sizes in Magento 2?How to get quantity of simple product on configurable product pageMagento 2.1.3 - no Text Swatches on Frontend [SOLVED]Magento 2 - Change Input type of Size attribute cause problem not showingMagneto2 : Add color swatch attribute option with colorcode value programmaticallyprogrammatically add color swatches to color attribute Magento2Can't change dropdown attribute to visual swatch on Magento 2Magento 2 - Setting “Text Swatch” or “Visual Swatch” does not work. Attribute still shows as dropdown on frontendMagento 2 - Set “Text Swatch” or “Visual Swatch” then images does not changed in frontend

Missing Piece of Pie - Can you find it?

Why is "Vayechulu" said 3 times on Leil Shabbat?

Expressing 'our' for objects belonging to our apartment

What is the most remote airport from the center of the city it supposedly serves?

Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?

Why was the battle set up *outside* Winterfell?

Why do money exchangers give different rates to different bills?

Would glacier 'trees' be plausible?

What was the design of the Macintosh II's MMU replacement?

What does this colon mean? It is not labeling, it is not ternary operator

What matters more when it comes to book covers? Is it ‘professional quality’ or relevancy?

Shantae Dance Matching

Why is B♯ higher than C♭ in 31-ET?

How do I make a function that generates nth natural number that isn't a perfect square?

Can a nothic's Weird Insight action discover secrets about a player character that the character doesn't know about themselves?

Should I mention being denied entry to UK due to a confusion in my Visa and Ticket bookings?

Fitch Proof Question

As matter approaches a black hole, does it speed up?

Can hackers enable the camera after the user disabled it?

Verb "geeitet" in an old scientific text

How important is people skills in academic career and applications?

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

I drew a randomly colored grid of points with tikz, how do I force it to remember the first grid from then on?

what to look for in luxury cars like Acura/Lexus



Color swatch and text swatch issue in magento 2


How to change the dropdown option on a product page?How to display crossed swatches for not available sizes in Magento 2?How to get quantity of simple product on configurable product pageMagento 2.1.3 - no Text Swatches on Frontend [SOLVED]Magento 2 - Change Input type of Size attribute cause problem not showingMagneto2 : Add color swatch attribute option with colorcode value programmaticallyprogrammatically add color swatches to color attribute Magento2Can't change dropdown attribute to visual swatch on Magento 2Magento 2 - Setting “Text Swatch” or “Visual Swatch” does not work. Attribute still shows as dropdown on frontendMagento 2 - Set “Text Swatch” or “Visual Swatch” then images does not changed in frontend






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








4















If I used color and text swatch in magento 2, sequence/order of option isn't changing. I mean I want to show



1. size
2. color


but it always show



1. color
2. size


if I used dropdown instead of color and text swatch. it is working fine.
Can anyone tell me, is that isssue comes with magento 2.0?










share|improve this question






























    4















    If I used color and text swatch in magento 2, sequence/order of option isn't changing. I mean I want to show



    1. size
    2. color


    but it always show



    1. color
    2. size


    if I used dropdown instead of color and text swatch. it is working fine.
    Can anyone tell me, is that isssue comes with magento 2.0?










    share|improve this question


























      4












      4








      4








      If I used color and text swatch in magento 2, sequence/order of option isn't changing. I mean I want to show



      1. size
      2. color


      but it always show



      1. color
      2. size


      if I used dropdown instead of color and text swatch. it is working fine.
      Can anyone tell me, is that isssue comes with magento 2.0?










      share|improve this question
















      If I used color and text swatch in magento 2, sequence/order of option isn't changing. I mean I want to show



      1. size
      2. color


      but it always show



      1. color
      2. size


      if I used dropdown instead of color and text swatch. it is working fine.
      Can anyone tell me, is that isssue comes with magento 2.0?







      magento2 attributes product-attribute






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 4 '16 at 11:10









      Rohit Kundale

      2,91711327




      2,91711327










      asked Mar 4 '16 at 10:48









      Ravi MuleRavi Mule

      2116




      2116




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I have same issue just today and able to fix it by changing each attribute key as string by adding any character like "_" in the getJsonConfig result. It seems its a browser or javascript issue where it automatically sort numeric array keys so changing it to string key will prevent it from sorting automatically.



          Testing Solution:
          1. Edit vendormagentomodule-swatchesBlockProductRendererConfigurable.php
          2. Add the below function to override the getJsonConfig:



          public function getJsonConfig() 
          $jsonConfig = parent::getJsonConfig();
          $decodedConfig = json_decode($jsonConfig, true);

          foreach ($decodedConfig['attributes'] as $attributeId => $attributeData)
          $decodedConfig['attributes']["_" . $attributeId] = $attributeData;
          unset($decodedConfig['attributes'][$attributeId]);


          return $this->jsonEncoder->encode($decodedConfig);



          You have two choices, either use plugin or extend that file. I use plugin for this.



          Hope that helps :)






          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%2f104705%2fcolor-swatch-and-text-swatch-issue-in-magento-2%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














            I have same issue just today and able to fix it by changing each attribute key as string by adding any character like "_" in the getJsonConfig result. It seems its a browser or javascript issue where it automatically sort numeric array keys so changing it to string key will prevent it from sorting automatically.



            Testing Solution:
            1. Edit vendormagentomodule-swatchesBlockProductRendererConfigurable.php
            2. Add the below function to override the getJsonConfig:



            public function getJsonConfig() 
            $jsonConfig = parent::getJsonConfig();
            $decodedConfig = json_decode($jsonConfig, true);

            foreach ($decodedConfig['attributes'] as $attributeId => $attributeData)
            $decodedConfig['attributes']["_" . $attributeId] = $attributeData;
            unset($decodedConfig['attributes'][$attributeId]);


            return $this->jsonEncoder->encode($decodedConfig);



            You have two choices, either use plugin or extend that file. I use plugin for this.



            Hope that helps :)






            share|improve this answer





























              0














              I have same issue just today and able to fix it by changing each attribute key as string by adding any character like "_" in the getJsonConfig result. It seems its a browser or javascript issue where it automatically sort numeric array keys so changing it to string key will prevent it from sorting automatically.



              Testing Solution:
              1. Edit vendormagentomodule-swatchesBlockProductRendererConfigurable.php
              2. Add the below function to override the getJsonConfig:



              public function getJsonConfig() 
              $jsonConfig = parent::getJsonConfig();
              $decodedConfig = json_decode($jsonConfig, true);

              foreach ($decodedConfig['attributes'] as $attributeId => $attributeData)
              $decodedConfig['attributes']["_" . $attributeId] = $attributeData;
              unset($decodedConfig['attributes'][$attributeId]);


              return $this->jsonEncoder->encode($decodedConfig);



              You have two choices, either use plugin or extend that file. I use plugin for this.



              Hope that helps :)






              share|improve this answer



























                0












                0








                0







                I have same issue just today and able to fix it by changing each attribute key as string by adding any character like "_" in the getJsonConfig result. It seems its a browser or javascript issue where it automatically sort numeric array keys so changing it to string key will prevent it from sorting automatically.



                Testing Solution:
                1. Edit vendormagentomodule-swatchesBlockProductRendererConfigurable.php
                2. Add the below function to override the getJsonConfig:



                public function getJsonConfig() 
                $jsonConfig = parent::getJsonConfig();
                $decodedConfig = json_decode($jsonConfig, true);

                foreach ($decodedConfig['attributes'] as $attributeId => $attributeData)
                $decodedConfig['attributes']["_" . $attributeId] = $attributeData;
                unset($decodedConfig['attributes'][$attributeId]);


                return $this->jsonEncoder->encode($decodedConfig);



                You have two choices, either use plugin or extend that file. I use plugin for this.



                Hope that helps :)






                share|improve this answer















                I have same issue just today and able to fix it by changing each attribute key as string by adding any character like "_" in the getJsonConfig result. It seems its a browser or javascript issue where it automatically sort numeric array keys so changing it to string key will prevent it from sorting automatically.



                Testing Solution:
                1. Edit vendormagentomodule-swatchesBlockProductRendererConfigurable.php
                2. Add the below function to override the getJsonConfig:



                public function getJsonConfig() 
                $jsonConfig = parent::getJsonConfig();
                $decodedConfig = json_decode($jsonConfig, true);

                foreach ($decodedConfig['attributes'] as $attributeId => $attributeData)
                $decodedConfig['attributes']["_" . $attributeId] = $attributeData;
                unset($decodedConfig['attributes'][$attributeId]);


                return $this->jsonEncoder->encode($decodedConfig);



                You have two choices, either use plugin or extend that file. I use plugin for this.



                Hope that helps :)







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 5 '16 at 10:23









                Qaisar Satti

                27.2k1258110




                27.2k1258110










                answered Apr 5 '16 at 9:57









                znarfznarf

                1




                1



























                    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%2f104705%2fcolor-swatch-and-text-swatch-issue-in-magento-2%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

                    Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                    Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                    Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림