Doesn't exist under Dynamic Dropdowns...
Printable View
Also found something in the original Dynamic Dropdowns file that may have sorted as was necessary when first developed but has changed since then.
When I was looking two attributes displayed, each had the same sort order, but alphabetically they would/may display in a modified sequence like what you showed above, when using Dynamic Dropdowns I too was seeing that the sequence did not follow the rules set by configuration->product info->Products Info - Products Option Name Sort Order..
I have locally updated the includes/classes/pad_base.php file to be uploaded with some other modifications/simplifications. Trying to clean up code as there are functions/features used in more than one location so would be best to consolidate the code rather than change multiple locations at least until it gets too complicated to keep as a single source.
The change was this for your interest:
includes/classes/pad_base.php
line 315 change from:
to:Code:$products_options_name_query = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock, popt.products_options_images_style, popt.products_options_type from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id = :products_id: and popt.products_options_id = patrib.options_id and popt.language_id = :languages_id: :stocked_where: order by popt.products_options_sort_order";
I do plan on updating the public download version of Dynamic Dropdowns plugin as there *are* some things about it that are broke or no longer accurate, but obviously still working out some of its operations.Code://LPAD - Return the string argument, left-padded with the specified string
//example: LPAD(po.products_options_sort_order,11,"0") the field is 11 digits, and is left padded with 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';
}
$products_options_name_query = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock, popt.products_options_images_style, popt.products_options_type from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id = :products_id: and popt.products_options_id = patrib.options_id and popt.language_id = :languages_id: :stocked_where:" . $options_order_by;
And in the same vein, looked at how the option values are/were sorted... Seems a similar "issue" was there...
So, to address that at "old" line 324 add the code that is below. Providing the code above and below the modification to show context:
Code:$products_options_name_query = $db->bindVars($products_options_name_query, ':products_id:', $this->products_id, 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':stocked_where:', $stocked_where, 'passthru');
$products_options_name = $db->Execute($products_options_name_query);
$attributes=array();
while (!$products_options_name->EOF) {
$products_options_array = array();
$products_options_query = "select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = :products_id: and pa.options_id = :products_options_id: and pa.options_values_id = pov.products_options_values_id and pov.language_id = :languages_id: order by pa.products_options_sort_order";
$products_options_query = $db->bindVars($products_options_query, ':products_id:', $this->products_id, 'integer');
$products_options_query = $db->bindVars($products_options_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':products_options_id:', $products_options_name->fields['products_options_id'], 'integer');
$products_options = $db->Execute($products_options_query);
Code:$products_options_name_query = $db->bindVars($products_options_name_query, ':products_id:', $this->products_id, 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':stocked_where:', $stocked_where, 'passthru');
$products_options_name = $db->Execute($products_options_name_query);
$attributes=array();
if (PRODUCTS_OPTIONS_SORT_BY_PRICE == '1') {
$order_by = ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name';
} else {
$order_by = ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price';
}
while (!$products_options_name->EOF) {
$products_options_array = array();
$products_options_query = "select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = :products_id: and pa.options_id = :products_options_id: and pa.options_values_id = pov.products_options_values_id and pov.language_id = :languages_id: :order_by:";
$products_options_query = $db->bindVars($products_options_query, ':products_id:', $this->products_id, 'integer');
$products_options_query = $db->bindVars($products_options_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':products_options_id:', $products_options_name->fields['products_options_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':order_by:', $order_by, 'passthru');
$products_options = $db->Execute($products_options_query);
Ohh, that.. Umm as far as I've seen that particular "list" doesn't support anything... In otherwords unless you are personally using it for something, I wouldn't worry about what is being populated there, but I have seen some cases when generating a combination that the unique combo field hasn't gotten updated. One case I have seen this in was where old data was imported to the table but that field wasn't populated... Further, all of the information that is "captured" in that field is a combination of other fields that already exist. If the data must be regrouped then can probably provide a sql statement to recreate all of the missing data for that field..
Under Configuration for SBA, run the rebuild/upgrade to repopulate the menu options with what is provided in the plugin. That is one of the options that was added in the process... The existing SBA stock table should remain untouched, but as with all things, please backup before doing so, just in case. :)
Nice to know it isn't a genuine break...I didn't see anything that broke, but there's a lot of functionality I don't play in on a daily basis. Just 'cuz I didn't see something break because of it still left me concerned.
Yeah, it's a tiny SQL statement to rebuild the column, which I did before I posted the "issue," but wanted to send up the flag just in case it was a monkeywrench. update products_with_attributes_stock set product_attribute_combo = CONCAT(products_id, '-', replace(stock_attributes, ',', '-')) ;
Now, I'm getting really worried...I'm not finding rebuild/upgrade anywhere on stock_by_attr_install.php or products_with_attributes_stock.php. The version of both on the site were updated 12/31/2015 when I updated it the last time.
Installation
Full/Upgrade DB Install
Removal
Remove All from DB
Optional SQL Scripts
Default SQL
Add all Product Attributes
Add display-only product attributes
Add product attributes that are NOT display-only
Remove product attributes that are ONLY read-only
Update Unique Combo field Here's a way to repopulate the field I mentioned earlier
Remove ALL entries from the PAS Table
Tests
File Check
Export / Import
Export Table Data
Import Table Data
Sorry, I know I should have used exact terminology, but I intended:
Installation
Full/Upgrade DB Install
That has/was written to preserve the existing data table, add any fields that were necessary and redo the configuration options back to "default"...
Sorry for the delayed response, I saw the first hooray and didn't follow up to see if there was more. :). Going to be uploading some more changes (though none to the configuration options) very soon. Trying to verify that I have captured in the fileset what worked on the test site.
Hello, I am running into a small issue with trying to install this on my 1.5.4 Zen cart...I have already backed up my website and made an exact copy of my existing database. I uploaded the files and chose replace existing. I went to the install.php address and logged in to my Zen cart admin area. I selected check files and verified no errors. I selected the Full/Upgrade option and ran the script. Nothing happened...my screen didn't change in display and it never said the database was successfully changed as the directions state would happen. Please advise as I still don't see the SBA option under Catalodg.
I am new to this and REALLY need this add-on to track my inventory.
Alana
Adding: The screen shows SBA Version 1.5.3 for Zen Cart Version 1.5.1. I chose the most recent download which showed that it works with 1.5.4.