ryanf Posted June 23, 2004 Posted June 23, 2004 to get the attribute sorted you should be able to do this: In master listing change the line: $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); to $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.products_options_name"); That will sort them alphabetically. If you want them sorted in another order, just add a new field "sortorder" to the products_options table and in phpmyadmin, assign a value for each one (lowest will go first) then use the code: $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.sortorder, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.sortorder"); And of course if you don't know this all goes under case 'MASTER_LIST_OPTIONS': in master_listing.php Backup first, since I havn't tested this at all. Ryan Quote If I was crafty, this would be a funny signature.
Guest Posted June 23, 2004 Posted June 23, 2004 Ryan that is great thx for the help, the first change has not made any diff, I will try the second when my head is clearer, many thx for the help even if they do not change anything. Quote
phobos Posted June 24, 2004 Posted June 24, 2004 Hi, I've installed the last update for this contrib, but I've 2 problem ;) 1st problem: In application_top.php (catalog side) the old code case 'add_slave' : foreach ($HTTP_POST_VARS as $keyA => $valueA) { if (substr($keyA,0,11) == "Qty_ProdId_") { $prodId = substr($keyA,11); if ($valueA <= 0 ) continue; $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($valueA), $HTTP_POST_VARS['id']); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Works fine, but if I use the new code case 'add_slave' : while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) { if (substr($key,0,11) == "Qty_ProdId_") { $prodId = substr($key,11); $qty = $val; if ($qty <= 0 ) continue; $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($qty), $HTTP_POST_VARS['id']); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; when I add a product in the basket through the product_info page no article has added. 2nd problem: I've merged and controlled many times the code for the attribute to the slave product, but it don't work (for me :rolleyes: ), when I select a master product, I see the slave product but it don't have any visible attributes. Ps. The slave produt have a attributes :D Any idea? Thanks and compliment for this contrib. Jo. Quote
Guest Posted June 24, 2004 Posted June 24, 2004 (edited) That isn't the code I posted to the contrib page, where did you get it from? Edited June 24, 2004 by baj3171 Quote
Guest Posted June 24, 2004 Posted June 24, 2004 Hi, i really need help as mentioned before.. I am setting the buy now setting to non-zero and still get no buy now button... can anyone help? thanks Quote
phobos Posted June 25, 2004 Posted June 25, 2004 That isn't the code I posted to the contrib page, where did you get it from? I get this code from the various update for the attribute for the slave product all in this post Quote
tomcoh Posted June 25, 2004 Posted June 25, 2004 Anyone have a clean version of the contribution up to latest update. If not I may package one up myself after installing everything. I've made a couple of errors and I'm not sure what the issue is. Thanks, David Quote
Guest Posted June 25, 2004 Posted June 25, 2004 I want to add thsi contribution to a ctore. What do i need to downlaod. all the fiels on the contribution page confuse me. Should i install 1.15 then the attributes? Ahhhhhh i am so lost. Thanks, Danny does anyoen have any screen schots i would like to see it. Quote
Guest Posted June 25, 2004 Posted June 25, 2004 I want to add thsi contribution to a ctore. What do i need to downlaod. all the fiels on the contribution page confuse me. Should i install 1.15 then the attributes? Ahhhhhh i am so lost. Thanks, Danny does anyoen have any screen schots i would like to see it. Currently yes. phobos It looks like you have 1.1.5 installed, but haven't added the slave attributes mods over it. Get the lastest download. This contains instructions on how to do this. Brian. Quote
Guest Posted June 25, 2004 Posted June 25, 2004 Sry for my spelling, didnt read it over. Well can i have some example of this contrib? Danny Quote
Donovan Posted June 26, 2004 Posted June 26, 2004 In case anyone is still wondering about attributes sorting, I finally answered a private message about it and decided I would post a copy here as well in case it helps someone. File: includes/modules/master_listing.php $products_options = 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)$listing['products_id'] . "' and pa.options_id = '" . (int)$products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' ORDER BY pa.options_values_price ASC, pov.products_options_values_name ASC"); If you compare that line to your own code, you'll note the end of the SQL command is different. In the code above, I'm sorting: First by the product's price (referenced by pa.options_values_price [where pa refers to the products attributes table]), in ASCending order... so lowest priced attributes appear first Secondly by the name of the attribute (refenced by pov.products_options_values [where pov is the product options values table], in ASCending, alphabetical order To change the sort priority, just rearrange the order of the ORDER BY attributes and/or use DESCending order instead of ASCending, etc. Any questions, just ask B) ...Dono http://quotacious.com Quote
Donovan Posted June 26, 2004 Posted June 26, 2004 PS: Note that the previous message does not give you the flexibility to do anything non-standard, you can just sort from smaller to greater or greater to smaller, not a customized arrangement, as this is the easiest to implement. To make it work, just choose names that will sort the way you want or deal with it :) As an example, in my store it sorts size in the order of Large, Medium, Small, XLarge, XXLarge.... to me this is fine, it almost seems to be deliberate on my part. PPS: I haven't added slaves to all the products in my non-live store yet, I'm working on an Admin modification to Copy-To to add slaves to masters automatically and to add the attributes as well. The only product that is fully setup can be found at here. Quote
tmac2104 Posted June 26, 2004 Posted June 26, 2004 I have a question... is there a way to code Master Products so that any masters that have slaves will not display a quantity box in the generic "product listing place"? I don't know how to word it really but look here... HERE and then go to CUSTOM STUFF then you can basically pick any of those items. I want to make it so that that generic "Select quantity: " field isn't their. and If I can make it so it's only gone when a master has a slave. Thanks... Trevor and I tried searching for information on this concept but is it just me or is the search feature in this forum horrible? Thanks Again Quote
Guest Posted June 26, 2004 Posted June 26, 2004 (edited) I have a question... is there a way to code Master Products so that any masters that have slaves will not display a quantity box in the generic "product listing place"? I don't know how to word it really but look here... HERE and then go to CUSTOM STUFF then you can basically pick any of those items. I want to make it so that that generic "Select quantity: " field isn't their. and If I can make it so it's only gone when a master has a slave. Thanks... Trevor and I tried searching for information on this concept but is it just me or is the search feature in this forum horrible? Thanks Again The 'generic' product listing page does not have a quantity box :) The way to do this is quite simple:- ? ? ?if (products_master_status == 1) { ? ? ?output_this; ? ? } else { ? ? ?output_this_other; ? ? } Matti Edited June 26, 2004 by Johnson Quote
Guest Posted June 26, 2004 Posted June 26, 2004 (edited) Does anyone have or know of any instructions to install master products on an existing oscommerce snapshot? Also, has anyone had success doing it? Edited June 26, 2004 by computerwiz5 Quote
Guest Posted June 26, 2004 Posted June 26, 2004 Does anyone have or know of any instructions to install master products on an existing oscommerce snapshot? Also, has anyone had success doing it? I don't see the point in doing this - the snapshot is undergoing major changes prior to the release of MS3 :P Matti Quote
Guest Posted June 26, 2004 Posted June 26, 2004 I don't see the point in doing this - the snapshot is undergoing major changes prior to the release of MS3 :P Matti When is MS3 comming out? Will it be hard to upgrade from it. So no one has done it with out a copy and paste installation? Quote
Guest Posted June 26, 2004 Posted June 26, 2004 (edited) When is MS3 comming out? When its ready :) Will it be hard to upgrade from it. It will require a rewrite of the contribution :lol: So no one has done it with out a copy and paste installation? There is nothing in contributions for snapshots :blink: Edited June 26, 2004 by Johnson Quote
Guest Posted June 26, 2004 Posted June 26, 2004 There is nothing in contributions for snapshots I dont get what your saying...sry Quote
talon177 Posted June 27, 2004 Posted June 27, 2004 I would recommend using a stable MS2.2 as CVS always change, therefore Master Products wont work with it. Quote
Guest Posted June 27, 2004 Posted June 27, 2004 I got beyond compare and it looks like it'll work. I have ms2 2.2 its stable Quote
tmac2104 Posted June 27, 2004 Posted June 27, 2004 I thought it would be easy enough to change the product_info.php so that if the item was a master the "select quantity" and drop down box would not appear. However I cannot get it to work. Help anyone? Also TEXT_MASTER is just a variable with '' for the value I added in the includes/english/product_info.php... Lines Roughly 185-195 to 200-210 <td align="right" class="main"><?php if (products_master_status == 1) { echo $TEXT_MASTER; } elseif ($product_info['products_quantity'] > 0) { echo TEXT_QUANTITY . ' ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); } elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) { $qty_array = array(); for ($i=0; $ns = 20, $i <= $ns; $i++) { $qty_array[] = array('id' => $i, 'text' => $i); } echo TEXT_QUANTITY . ' ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); } else { echo TEXT_STOCK; } echo tep_draw_separator('pixel_trans.gif', '30', '10'); ?> </td> </tr> <?php Quote
Guest Posted June 27, 2004 Posted June 27, 2004 (edited) ? ? ? <td align="right" class="main"><?php ? ? ?$qty_array = array(); ? ? ? ? ? for ($i=0; $ns = 20, $i <= $ns; $i++) { ? ? ? ? ? $qty_array[] = array('id' => $i, 'text' => $i); ? ? ? } ? ? ? if ($product_info['products_master_status'] == 1) { ? ? ? ? echo TEXT_MASTER; ? } elseif ($product_info['products_quantity'] > 0) { ? ? echo TEXT_QUANTITY . ' ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); ? ? } elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) { ? ? ? ? echo TEXT_QUANTITY . ' ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); ? ? } else { ? ? echo TEXT_STOCK; } echo tep_draw_separator('pixel_trans.gif', '30', '10'); ?> ? ? ? </td> ? ? </tr> Dunno why you wish to do this - if you give the Master a zero dollar value they will not appear anyway. If you need to display a price, put it in the products_description :) Matti Edited June 27, 2004 by Johnson Quote
Guest Posted June 27, 2004 Posted June 27, 2004 Hi, i am so sorry if i am disturbing the flow of this forum... but i really need to fix this... as i mentioned before.. If the answer is it cant be done, just tell me, or if its back on the forum c an anyone please point me to it ? I dont know if i did something wrong while installing it or not, but what i need to do, is to have the slave products display the Buy Now, or Add to cart, on front of each slave item, and a input text instead of a drop down. Can anyone help me with this please? Thanks. Quote
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.
Note: Your post will require moderator approval before it will be visible.