Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
Quote:
Originally Posted by
mattys
i am using SBA Version 1.5.4 for Zen Cart Version 1.5.4, but on zencart 1.5.3
is working, but with a few niggles
one of them being the sort order of colours, e.g.
https://www.jarbon.com/alpaca-socks/...-country-socks, if you first select shoe size you will then see the colour options, these are in the incorrect order, as set in attributes controller
SBA is setting the sort order by attribute value ID, lowest first:
<select name="id[3]" onchange="i3(this.form);">
<option value="0" selected="selected">Next select colour</option>
<option value="18">Black </option><option value="21">dark green </option><option value="272">Red </option><option value="367">damson </option><option value="370">natural white </option></select>
this is overriding the order i set in attributes controller
i tried using the sort order you get when adding stock, but this didnt work
any ideas how this might be fixed?
Looked at site... Order of attributes was different than described above and appeared to match the sequence of the items in the javascript as expected. What was done to resolve your issue? I wasn't able to reproduce it.
1 Attachment(s)
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
This is how they are ordered:
<select name="id[3]" onchange="i3(this.form);">
<option value="0" selected="selected">Next select colour</option>
<option value="18">Black </option>
<option value="21">dark green </option>
<option value="272">Red </option>
<option value="367">damson </option>
<option value="370">natural white </option>
</select>
as you can see, ordered numerically by attribute option value
they should be ordered as per:
Attachment 15753
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
That's the sequence my browser presents and how I see it... Sorry can't take a screen capture... Try a dfferent browser or something, as the issue makes little sense unless they were originally filtered in that order, the page loaded, the order changed, and the page "reloaded"... When dealing with attributes, not clearing the cache/session can cause changes to not appear.
4 Attachment(s)
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
Here are 3 screen grabs, one for firefox, one for ie, one for chrome, all the incorrect order:
Chrome
Attachment 15754
firefox
Attachment 15755
internet explorer
Attachment 15756
they all list the colours numerically, which is incorrect:
Black
dark green
Red
damson
natural white
i would like them to be ordered as i have set them up in attributes controller:
natural white
Black
damson
Red
dark green
Attachment 15757
P.S.
The client also sees the incorrect order, so, not just me.
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
Here is the source code that I see whch produces the desired order as expected:
Code:
<tr><td align="right" class="main"><b>colour:</b></td><td class="main"><select name="id[3]" onchange="i3(this.form);">
<option value="0" selected="selected">Next select colour</option>
</select>
</td></tr>
<tr><td> </td><td><span id="oosmsg" class="errorBox"></span>
<tr><td colspan="2">
<script type="text/javascript" language="javascript"><!--
var stk={1:{370:1,18:1,367:1,272:1,21:1},2:{370:1,18:1,367:1,272:1,21:1},3:{370:1,18:1,367:1,272:1,21:1}};
var stk2={1:{370:1,18:1,367:1,272:1,21:1},2:{370:1,18:1,367:1,272:1,21:1},3:{370:1,18:1,367:1,272:1,21:1}};
var txt3={370:'natural white ',18:'Black ',367:'damson ',272:'Red ',21:'dark green '};
function i1(frm) {
var displayshown = false;
var span=document.getElementById("oosmsg");
while (span.childNodes[0]) {
span.removeChild(span.childNodes[0]);
}
frm['id[3]'].length=1;
for (opt in stk[frm['id[1]'].value]) {
if (typeof stk2[frm['id[1]'].value] != "undefined") {
if (typeof stk2[frm['id[1]'].value][opt] != "undefined") {
frm['id[3]'].options[frm['id[3]'].length]=new Option(txt3[opt],opt);
} else {
frm['id[3]'].options[frm['id[3]'].length]=new Option(txt3[opt] + '- Unavailable ',opt);
}
} else {
frm['id[3]'].options[frm['id[3]'].length]=new Option(txt3[opt] + '- Unavailable ',opt);
if (displayshown != true) {
alert('All selections of the attributes below this one are Out of Stock. Please select a different option.');
stkmsg(frm);
displayshown=true;
}
}
}
The mportant part being the sequence ofthe sub groups of stk.
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
Also, may want to correct the validation issues with that page (and likely other product pages).
Further, may want to try turning off the Dynamic Dropdown part and see if the same result or different. May have sme sort of Javascript conflict not appearing on my device.
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
I can see that the code looks like it should be working, but it would be great if you could provide a screen grab of it working as a drop down, can you sort this please?
the javascript code above appears after the drop downs, i wander whether this is why the sort order isnt working??
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
Quote:
Originally Posted by
mc12345678
Also, may want to correct the validation issues with that page (and likely other product pages).
Further, may want to try turning off the Dynamic Dropdown part and see if the same result or different. May have sme sort of Javascript conflict not appearing on my device.
ok, i'll try this
thanks
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
i plumped for deactivating dynamic drop downs, all seems to be working now
matt
Re: "Stock by Attributes" (version 1.5.3). This MOD is ONLY for Zen Cart 1.5.1 ..whad
actually, deactivating dynamic drop down creates to many issues, so am reactivating, will investigate why javascript order not being displayed
matt