jamesblackburn Posted December 11, 2006 Share Posted December 11, 2006 I think I am going to give up on this contribution until someone can come up with a solution to the consistent problems that people seem to be having with the sort field. Shame as it is very useful. :( Quote Link to comment Share on other sites More sharing options...
jamesblackburn Posted December 11, 2006 Share Posted December 11, 2006 I believe I found the correct sort contribution that adds the SQL inquestion: see http://www.oscommerce.com/community/contri...s+Sorter+Copier Did you ever get this contribtion working fully? There are people who are having lots of bother with it but noone seems to be able to help. Here's hoping you can help me and others who are having a problem. :rolleyes: Quote Link to comment Share on other sites More sharing options...
HelleM Posted December 11, 2006 Share Posted December 11, 2006 I am trying to use this too. For now I sort the attributes on the product_info.php page like this - around line 150: $products_options_query = tep_db_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 = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_name asc"); I know it doesn't solve all - but at least the customers can see it nice Helle :-) Quote Link to comment Share on other sites More sharing options...
opurahman Posted December 12, 2006 Share Posted December 12, 2006 (edited) I do not know why this functions, but functioned... In attributeManager.php, find: // db wrapper require_once('classes/amDB.class.php'); // session functions require_once('includes/attributeManagerSessionFunctions.inc.php'); Change to: // db wrapper if(class_exists("amDB")) require_once('classes/amDB.class.php'); // session functions if(function_exists("amSessionUnregister")) require_once('includes/attributeManagerSessionFunctions.inc.php'); Your contribuition is very cool!! Thanks! Adriano Same problem here. Fatal error: Cannot redeclare class amdb in .....\admin\attributeManager\classes\amDB.class.php on line 18 Thanx for your solution. I think it is for php version. Edited December 12, 2006 by opurahman Quote Arafat Rahman Web Developer Dhaka, Bangladesh Link to comment Share on other sites More sharing options...
Phocea Posted December 12, 2006 Share Posted December 12, 2006 I have posted the latest version I am working on which should work for everyone. Up to you thereafter to turn on the sort order support or not it is set to false by default Quote Link to comment Share on other sites More sharing options...
wolfalex Posted December 12, 2006 Share Posted December 12, 2006 Hello, I have just installed Version 2.3 beta and I have a little problem. When I want to add an option to a product I get redirected to the product_preview page and the option is not added to the attributes. If the product allread has attributes and I want to add another value it is no problem. Am I doing something wrong or is it not installed corecctly? Alex Quote Link to comment Share on other sites More sharing options...
Phocea Posted December 13, 2006 Share Posted December 13, 2006 Wolfalex, try the new update should be ok. Thanks for the feedback. problem was when sort order was not used I missed a couple of spots where code needed to be change. Should be ok now. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 13, 2006 Share Posted December 13, 2006 Phocea - Thanks for taking this one on, I don't seem to be able to find the time these days. If you get it stable, please feel free to take it out of beta, I can't realistically see myself delving back into it. Thanks again, Nimmit :thumbsup: Quote Link to comment Share on other sites More sharing options...
Phocea Posted December 13, 2006 Share Posted December 13, 2006 No problem, I think it is a way before it comes out of beta. Adding the edit, delete functionality like you intended should be pretty easy since you left the ground work to do so. Addin QT Pro plugin functionality is however giving me grief at the moment. Thanks for the original code anyway, it is very clearly coded and following OO coding to the letter (or as mush as PHP4 let u !) Quote Link to comment Share on other sites More sharing options...
Andrew Yuen Posted December 13, 2006 Share Posted December 13, 2006 I get 1054 - Unknown column 'products_options_sort_order' in 'order clause' What sql query needs to be executed to get this thing to work? I added this sql query ALTER TABLE products_attributes ADD products_options_sort_order int(6) NOT NULL default '0' AFTER price_prefix; ALTER TABLE products_options_values_to_products_options ADD products_options_values_sort_order int(6) NOT NULL default '0' AFTER products_options_values_id; Quote Andrew Yuen osCommerce, Community Team Link to comment Share on other sites More sharing options...
Phocea Posted December 13, 2006 Share Posted December 13, 2006 The sorting is not part of this contribution, it is to be used if you have installed one of the numerous attribute sorting contribution existing. The code you are refering to is from this contribution: http://www.oscommerce.com/community/contri...,attribute+sort So it should be fine. The point of the config area is that people can choose which contribution to use or have already use and change the name of the field accordingly Quote Link to comment Share on other sites More sharing options...
HelleM Posted December 13, 2006 Share Posted December 13, 2006 I really like the concept of Ajax, but I really need to fill in a filename - I have lots of downloads.... This Attributes Copier - does it also copy the "file field" ?? Helle :-) Quote Link to comment Share on other sites More sharing options...
Andrew Yuen Posted December 14, 2006 Share Posted December 14, 2006 Hi Greg, Thanks for the reply. I still get 1054 - Unknown column 'products_options_sort_order' in 'order clause' After running that sql query. This was my original question, I may not have worded clearly. How would I go about fixing this 1054 error? Thanks Quote Andrew Yuen osCommerce, Community Team Link to comment Share on other sites More sharing options...
HelleM Posted December 14, 2006 Share Posted December 14, 2006 :::::andyy15 Did you remember to read the lines at the bottom in the install.htm?? I think I had the same error all I did was putting // in front of those two lines Hope it helps you Helle :-) admin/attributeManager/classes/attributeManagerConfig.class.php Find (Around line 65) $this->add('AM_FIELD_OPTION_SORT_ORDER','products_options_sort_order'); // Sort column on Products_options table $this->add('AM_FIELD_OPTION_VALUE_SORT_ORDER','products_options_sort_order'); // Sort column on product_attributes table Quote Link to comment Share on other sites More sharing options...
Phocea Posted December 14, 2006 Share Posted December 14, 2006 Hi Greg, Thanks for the reply. I still get 1054 - Unknown column 'products_options_sort_order' in 'order clause' After running that sql query. This was my original question, I may not have worded clearly. How would I go about fixing this 1054 error? Thanks Did you change the Sort order option to true to false or not ? in attributemanager/classes/attributeManagerConfig.class.php $this->add('AM_USE_SORT_ORDER' , false); Quote Link to comment Share on other sites More sharing options...
Phocea Posted December 14, 2006 Share Posted December 14, 2006 I have tried removing the sort column from my database and to run the contribution with $this->add('AM_USE_SORT_ORDER' , false); and i am not getting any errors, so you must have done something wrong. Hellem, if you keep the switxh to off you do not need to comment out this 2 lines Quote Link to comment Share on other sites More sharing options...
HelleM Posted December 14, 2006 Share Posted December 14, 2006 phocea Is was already set like this: $this->add('AM_USE_SORT_ORDER' , false); That's way I // the two lines... Is there any way to get these two fields into the tables? Then everything should work - right?? Maybe a small SQL query? $this->add('AM_FIELD_OPTION_SORT_ORDER','products_options_sort_order'); // Sort column on Products_options table $this->add('AM_FIELD_OPTION_VALUE_SORT_ORDER','products_options_sort_order'); // Sort column on product_attributes table Helle :-) Quote Link to comment Share on other sites More sharing options...
HelleM Posted December 14, 2006 Share Posted December 14, 2006 ..... or should I install Attributes Copier too?? Helle :-) Quote Link to comment Share on other sites More sharing options...
Phocea Posted December 14, 2006 Share Posted December 14, 2006 Note that just adding the 2 columns for the fun of it will let you store the sort order for the attributes and attributes values but if it is not used anywhere else on the catalogue there is not much point using this functionality :) If you add this column or any other sort column using one of the contribution existing, make sure you also follow the changes on product_info Quote Link to comment Share on other sites More sharing options...
HelleM Posted December 14, 2006 Share Posted December 14, 2006 That means - if I add Attributes Copier - I can "active" the sort columns? One thing this really great contributions lacks - for my use anyway - is the option to fill in a download file - that would be SO awsome - thanks for the fast reply Quote Link to comment Share on other sites More sharing options...
Phocea Posted December 14, 2006 Share Posted December 14, 2006 Functionality for downloadable product will follow, once the rest works ok and is stable :) Quote Link to comment Share on other sites More sharing options...
Andrew Yuen Posted December 14, 2006 Share Posted December 14, 2006 Greg, I have set the below code to true: $this->add('AM_USE_SORT_ORDER' , true); Changes are made in my product_info page but I still get the 1054 error. Quote Andrew Yuen osCommerce, Community Team Link to comment Share on other sites More sharing options...
Pilly Posted December 15, 2006 Share Posted December 15, 2006 (edited) Hi, ive just installed the 2.3b beta. with the admin access option Getting when creating a product: Fatal error: Call to undefined function: getallproductoptionsandvalues() in /home/mojointe/public_html/testbed/uk/admin/attributeManager/attributeManager.php on line 64 Any ideas what ive messed up? also the Attribute manager doesnt appear in the left column menu? Edited December 15, 2006 by Pilly Quote Link to comment Share on other sites More sharing options...
pdm Posted December 17, 2006 Share Posted December 17, 2006 (edited) The same problem !! Only can edit :angry: When click new product : Fatal error: Call to undefined method attributeManagerAtomic::getAllProductOptionsAndValues() in D:\WebServ\httpd\admin\attributeManager\attributeManager.php on line 63 I try bypass this on line 63: if ($_GET['a']==1) {$allProductOptionsAndValues = $attributeManager->getAllProductOptionsAndValues();} else if ($_GET['a']==0) {} 'a' is my variable but dont work :'( HELP ? i try oder version v2.1-beta work, v2.3-beta and v2.3b-beta dont work :'( Any ideas what ive messed up? also the Attribute manager doesnt appear in the left column menu? it's ok AJAX doesnt add to the left menu Edited December 17, 2006 by pdm Quote Link to comment Share on other sites More sharing options...
pdm Posted December 17, 2006 Share Posted December 17, 2006 Ok i find this BUG :rolleyes: to fix you have to edit attributeManager\classes\attributeManagerAtomic.class.php Line 139: Find: // QT pro /** * Updates the quantity on the products stock table * @access public * @author Phocea * @param $get $_GET * @return void */ function AddStockToProduct($get) { customprompt(); $this->getAndPrepare('stockQuantity',$get,$stockQuantity); //$this->getAndPrepare('option_id', $get, $optionId); //$this->getAndPrepare('option_value_id', $get, $optionValueId); //$this->getAndPrepare('price', $get, $price); //$this->getAndPrepare('prefix', $get, $prefix); //$this->getAndPrepare('sortOrder', $get, $sortOrder); $this->arrSessionVar[] = array( 'product_stock_quantity' => $productStockQuantity ); } } // QT pro And replace: // QT pro /** * Updates the quantity on the products stock table * @access public * @author Phocea * @param $get $_GET * @return void */ function AddStockToProduct($get) { customprompt(); $this->getAndPrepare('stockQuantity',$get,$stockQuantity); //$this->getAndPrepare('option_id', $get, $optionId); //$this->getAndPrepare('option_value_id', $get, $optionValueId); //$this->getAndPrepare('price', $get, $price); //$this->getAndPrepare('prefix', $get, $prefix); //$this->getAndPrepare('sortOrder', $get, $sortOrder); $this->arrSessionVar[] = array( 'product_stock_quantity' => $productStockQuantity ); } // QT pro Find: on the end file ?> And replace: } ?> You should see on the end of the file something like this: if (AM_USE_SORT_ORDER) { $this->arrAllProductOptionsAndValues[$optionsId]['values'][$res['options_values_id']]['sortOrder'] = $res[AM_FIELD_OPTION_VALUE_SORT_ORDER]; } } } return $this->arrAllProductOptionsAndValues; } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.