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;
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
add a comment |
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
add a comment |
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
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
magento2 attributes product-attribute
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
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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 :)
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 :)
add a comment |
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 :)
add a comment |
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 :)
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 :)
edited Apr 5 '16 at 10:23
Qaisar Satti
27.2k1258110
27.2k1258110
answered Apr 5 '16 at 9:57
znarfznarf
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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