Re: Flexible Attributes addon support
Oops, didn't see that the previous try at this post actually posted:)
The corresponding database field stores the products_options_sort_order value, but I'm not sure where the PRODUCTS_OPTIONS_SORT_ORDER constant's value is set. It is not defined in a PHP file, so it must be set in admin and stored in the db, then retrieved at runtime. I've never been able to find out how/where stored settings are turned into constants for use.
Re: Flexible Attributes addon support
Quote:
Originally Posted by
gjh42
Oops, didn't see that the previous try at this post actually posted:)
The corresponding database field stores the products_options_sort_order value, but I'm not sure where the PRODUCTS_OPTIONS_SORT_ORDER constant's value is set. It is not defined in a PHP file, so it must be set in admin and stored in the db, then retrieved at runtime. I've never been able to find out how/where stored settings are turned into constants for use.
I did a comparison of all files that contain "PRODUCTS_OPTIONS_SORT_ORDER" via Dev Toolkit in the localhost files and the live site files. the only difference I found was in admin/option_name.php:
Localhost:
Line #37 : $db->Execute("UPDATE " . TABLE_PRODUCTS_OPTIONS . " set products_options_sort_order= " . (int)$_POST['products_options_sort_order'][$id] . " where products_options_id=" . (int)$id . " and language_id=" . (int)$_GET['lng_id']);
Live Site:
Line #37 : $db->Execute("UPDATE " . TABLE_PRODUCTS_OPTIONS . " set products_options_sort_order= " . $_POST['products_options_sort_order'][$id] . " where products_options_id= $id and language_id=" . $_GET['lng_id']);
I modified the live site's file to match the code in the localhost file, but it did not make any difference. Still stumped...
Re: Flexible Attributes addon support
Quote:
Originally Posted by
gjh42
attributes.php sets the query sort order with this:
PHP Code:
if ($pr_attr->fields['total'] > 0) {
if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
$options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
} else {
$options_order_by= ' order by popt.products_options_name';
}
so finding where the PRODUCTS_OPTIONS_SORT_ORDER constant is defined/set will be helpful. It should be set in admin and stored in the database, but I'm not sure that constant name will help to track down the setting location.
Hmmm... so the code says to order it by the sort order, and if that doesn't work then order them by option name in alphabetical order, right? It does indeed seem to be ordering it by name right now (Juice 1, Juice 2, Juice 3, Juice Choice, etc...). I wonder if that code could be tweaked to tell it to sort by ID instead, since I added the options in the order I want them to show up...
I changed order by popt.products_options_name to order by popt.products_options_id and it looks like it's gonna work!!!! I need to add a few CSS modifications, but I think I'm on to something here. I'll post back here with my final results.
Re: Flexible Attributes addon support
Somehow there is a PRODUCTS_OPTIONS_SORT_ORDER constant that should be generated (or should be empty or '0' or null); if that is 0 then the correct sort order is used. If it has a nonzero value, then the name sort is used.
So the real question is how to control that constant. If that can be done, the stock code will work correctly. Until then, a tweak may be what you need to get on with the rest of your work.
Re: Flexible Attributes addon support
I would copy the desired statement to replace the name statement for now:
PHP Code:
if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
$options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
} else {
//$options_order_by= ' order by popt.products_options_name';
$options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
}
Re: Flexible Attributes addon support
Quote:
Originally Posted by
gjh42
I would copy the desired statement to replace the name statement for now:
PHP Code:
if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
$options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
} else {
//$options_order_by= ' order by popt.products_options_name';
$options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
}
That seems to work as well. I have made that change. Thanks again for all your help!!!!
Re: Flexible Attributes support
Could this mod be used to setup the attributes just like the left eye/right eye grid on this page:
http://www.clearlycontacts.ca/contac...prod91399.html
Re: Flexible Attributes addon support
This mod is awesome! I am having a difficult time doing a few things though. You can see my live page here: http://www.framesforlife.com/copy-ex...example-1-p-11
Here is my flexible_attributes.css stylesheet coding:
Code:
/* Global Entries*/
.wrapperAttribsOptions label {font-size: 1.0em;}/*make "label" elements match other text*/
h3#attribsOptionsText {display: none;}/*hide the "Please Choose:" heading*/
h4.optionName {font-size: 1.0em;}
.wrapperAttribsOptions+br.clearBoth {display: none;}/*allows floated attributes to sit side by side if desired. Without this each attribute has to go to new line*/
/*My Entries*/
#wAttrib-4 {clear: left;} /*Artwork Size Text Box. This starts on a new line*/
#wAttrib-1 {clear: left; float: left;}/*Select Width Drop-down*/
#wAttrib-2 {clear: left; float: left;}/*Select Height Drop-down*/
#wAttrib-3 {float: left;} /*Width Fractions. this will sit beside width drop-down*/
#wAttrib-5 {float: left;} /*Height Fractions. this will sit beside width drop-down*/
#wAttrib-42 .attribPrice {display: none;} /*this is not working yet*/
#wAttrib-78 .attribPrice {display: none;} /*this is not working yet*/
Here are my issues:
1. Is it possible to make the text disappear for attribute #3 and attribute #5 (Width and Height Fractions)? I want the title text to be hidden from the visitors so the field can come closer to the first box (as both tie together). I tried this code:
Code:
#wAttrib-3 {float: left; display:none;}
but the whole box disappeared. My plan is to preferably hide this text so the visitor cannot see it.
2. Is is possible to make text appear to the right of the field instead instead of before the field?
3. The rules for attribute #42 and #78 above do not seem to be working. I am trying to hide the (+3.33) pricing in both of these drop-downs. All pricing in these two drop-down menus need to be hidden. The ID #'s are 42 and 78 and you can see I have them defined. I am following the rules of this post: http://www.zen-cart.com/forum/showpo...01&postcount=5 according to blackbelt.
Any ideas please?
Re: Flexible Attributes addon support
Danielle - Yes, you can get that layout.
Set up the four headings as read-only attributes floated left, then the four right eye attributes floated left with the first one also clear:left;, then the left eye the same. You can hide attribute labels per the method I will show sports guy. (The details may differ for some kinds of attributes.)
Re: Flexible Attributes addon support
sports guy - Use this rule for hiding text as you describe:
#wAttrib-3 label, #wAttrib-5 label {display: none;} /*hide fraction text*/
A rule like this will put the text to the right of its input:
#wAttrib-5 h4.optionName {float: right;} /*text to right of input*/
The pricing span in the define does not actually function, as I found when I tested it some time later. I have added a note to that thread to alert people.
You would need to go into the attributes code and add the span with class.