Jump to content
Johnson

Master Products - MS2

Recommended Posts

K done that great fixed that error now getting this one:

 

Fatal error: Call to undefined function: tep_draw_attrib_pull_down_menu() in /home/sites/site38/web/test/includes/modules/master_listing.php on line 273

 

nock on effect or me. thx for help


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

I have had the same series of errors as Elwyn thus far (on a clean install of OScommerce with only Master Products installed). After tep_draw_attrib_pull_down_menu is changed to tep_draw_pull_down_menu I then get an empty options box.

 

 

Joe do sent me part of his code recently which resolved the errors in Brians code but the attribute price is not added to the total for the item when added to the cart. I'm not sure where to look to resolve that. I'll post the code that got me one step further that was from Joe Do as it may help someone (more talented than I) to reach a solution.

 

 

// joe brian ryan's version

//////////////////////////////////////////////////////////////

case 'MASTER_LIST_OPTIONS':

$lc_align = 'center';

$lc_text = ''; $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 . "'");

while ($products_options_name_values = tep_db_fetch_array($products_options_name)) { $products_options_array = array(); $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 = '" . $listing['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.options_values_price ASC, pov.products_options_values_name DESC");

 

while ($products_options_values = tep_db_fetch_array($products_options)) { $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => '');

if ($products_options_values['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') ';

}

}

$lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array);

}

break;

 

Millie

Share this post


Link to post
Share on other sites

Great one millie, I will have a bash at this new code and see what we can see, thx fro the help.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

weee that worked thx to all who worked on that and other to get this a little closer, I get an error on the click options though, and prices dont carry through like what millie mentioned:

 

This is the error on clicking options.

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 20' at line 1

 

select p.products_model,pd.products_name, p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master = '28' and p.products_status = '1' and pd.language_id = '1' order by limit 0, 20


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

I have a question. I am using the Master Products contribution... I love it! It's great.

 

Here's my question. I have multiple categories. For example, one is Brakes and the other is Suspension.

 

I have modified my cart so that I can add different attributes other than what Master Products uses. For 'Brakes' products I have rotor size, 1 or 2 piston calipers, etc. For 'Suspension' products I have fields such as the amount of drop (1", 1.5", 2", etc).

 

Here's my problem, when I view a Suspension product I get the fields in the Master Product listing for Brake products. ie. The rotor size field is shown and it is blank because I have not linked anything in the admin panel. How can I turn off these fields either by category or if no entries are found in the database fields for that product?

 

Thanks!

Colin

Share this post


Link to post
Share on other sites

First of all, thanks for this great contribution!

 

This may have been asked and I just overlooked it but is it possible for the slave products to have more than one master? How would you do this without adding all the slave attributes back?

 

Also did I see where there is another update with more features coming out soon for this contribution?

 

Thanks again!!!!!!!!!!

Share this post


Link to post
Share on other sites

Right almost there now, just 1 error left every time I click options in slave header I get a big sql error, couldnt I just disable this link I dont think I need it.

Also I have a table error anyone now how to sort this out also.

 

http://www.designedbyelwyn.co.uk/test

 

Thx in advance


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites
Right almost there now, just 1 error left every time I click options in slave header I get a big sql error, couldnt I just disable this link I dont think I need it.

Also I have a table error anyone now how to sort this out also.

 

http://www.designedbyelwyn.co.uk/test

 

Thx in advance

I overlooked the link. You're right you don't need it.

 

in master_listing.php change

 ? ?if (($column_list[$col] != 'MASTER_LIST_BUY_NOW') && ($column_list[$col] != 'MASTER_LIST_IMAGE' && ($column_list[$col] != 'MASTER_LIST_MULTIPLE' && ($column_list[$col] != 'MASTER_LIST_DESCRIPTION'))) ) {

to

 ? ?if (($column_list[$col] != 'MASTER_LIST_BUY_NOW') && ($column_list[$col] != 'MASTER_LIST_IMAGE') && ($column_list[$col] != 'MASTER_LIST_MULTIPLE') && ($column_list[$col] != 'MASTER_LIST_DESCRIPTION') && ($column_list[$col] != 'MASTER_LIST_OPTIONS')) {

Brian.

Edited by Johnson

Share this post


Link to post
Share on other sites

wahoo, thx very much Brian you are a star, you have sorted it out for me anyrd, I still have the table nesting issue but that is a master products issue with sts not you attributes addon.

 

But if you have any thoughts or suggestins, ley me know, Thx again.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

Well, I took the new, updated Attributes document, and gave it a whirl. Nothing happened at first of course, so I created an option of "Color" and added values to it. Next, I added all the colors to all the slaves of the one product in my store. :P

 

The result shows a new dropdown box for Color, but there are no dropdown options.

http://lucidity.homeip.net:64738/oscommerc...?products_id=30

 

What's wrong here? :)

 

...Dono

Share this post


Link to post
Share on other sites

Ok sorted that problem out with some old code brian sent me in these threads couple of posts back.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

I replaced the code in step3 with this old bit I got from Brian:

 

case 'MASTER_LIST_OPTIONS':

$lc_align = 'center';

$lc_text = '';

$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 . "'");

while ($products_options_name_values = tep_db_fetch_array($products_options_name)) { $products_options_array = array(); $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 = '" . $listing['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.options_values_price ASC, pov.products_options_values_name DESC");

 

while ($products_options_values = tep_db_fetch_array($products_options)) { $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => '');

if ($products_options_values['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') ';

}

}

$lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array);

}

break;

 

Now everything works fine. Hope this helps


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

Thanks! Due to your locating the general area of the problem, I spent some time comparing the two rather than just overwriting the code...

 

The solution to fix up the new code is rather simple. From the line of the latest code in contributions:

$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['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

You want to edit this part:

$products_options_name['products_options_id']

and add "_values" to the name, so that it is:

$products_options_name_values['products_options_id']

 

That's all that was wrong :rolleyes:

Enjoy!

Share this post


Link to post
Share on other sites

Great I am not a coder so this is a big help and I will have a bash at revising the code as explained.

All I have to do now is fix this contribution to work with sts.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

Donovan, This fix didnt work for me I get an sql error like this after modding the code as you mentioned.

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites/supaosc.com/public_html/1/customers/catalog/includes/functions/database.php on line 99

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites/supaosc.com/public_html/1/customers/catalog/includes/functions/database.php on line 99

 

So I have reverted back and all is fine again.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

thx for the mod! i've got it working how i want now. took a bit of time. baiscally each slave has it's own 'buy now' button taking it to it's own product page due to the way they have 'bulk orders' in place.

 

i've also rid the drop down selection box.

 

if ya wanna see it in action, here's the currently non-live site:

http://68.90.68.68/product_info.php?cPath=...roducts_id=2542

 

cya, and thx again!

-Who Dah?

Share this post


Link to post
Share on other sites

whodah, are you using an automatic thumbnailer? if so which one? because i cant seem to get one to work with my set up....

 

thanks

 

Trevor

Share this post


Link to post
Share on other sites

tmac2104: yes i am. i'm using this one:

http://www.oscommerce.com/community/contri...matic+thumbnail

 

i had a bit of trouble getting it to work on my site too. turned out to be a path issue. i was dealing w/ a site like:

http://www.domain.com/~abbey

 

and so the thumbnail path was looking for files like:

/~abbey/images/image.jpg

 

which of course did not exist. once i setup my config file to not use a virtual site (no /~abbey) and go striaght by ip (or straight by domain) it started working.

 

dunno if that tidbit is applicable to you or not, but that was the first thing that came to my mind. hth! :)

 

-Who Dah?

Share this post


Link to post
Share on other sites

Elwyn, I'm not sure what files are different on your store, it is hard to say. :(

 

To doublecheck my solution, I took the code from the original instructions for step #3 for the master_list.php file, and completely overwrote that section in my file. I then did a search for that one snippet of text, and replaced it with the updated piece as I indicated above. Once again, it works as it should. Besides all changes in coding style and a new option or two, that is the only real difference between the two sets of code.

 

I'm just glad it's working, between Master Products and the Attributes, this is perfect. I've added the sort back to the attributes so that the drop downs are sorted the way I want, otherwise they appear in whatever order they occurred in the database. To do this, I tacked on " ORDER BY pa.options_values_price ASC, pov.products_options_values_name ASC" to the end of the SQL command to have them sorted by increasing price and then alphabetically within that (similar to the old code).

 

...Donovan

Share this post


Link to post
Share on other sites

whodah...

 

by chance do you remember what variables you changed?(I believe it would be DIR_FS_CATALOG and DIR_WS_IMAGES) and what you changed them to poin to? I'm having so much trouble understanding parts of the code because they are in german...

 

thanks

 

trevor

Share this post


Link to post
Share on other sites

Not sure if this was mentioned, but is it possible for the shopping_cart.php page to display the master product image for the slave sale items? Currently my slaves are all hidden and the masters are listed but when a customer purchases a slave item the shopping_cart.php shows a x image. Any way to point this to it's master image?

Share this post


Link to post
Share on other sites

Donovan

 

Thx for the help, I have fixed it with a little poking about, I had changed the wrong bit of code, but I have now done it right as per you change thx.

 

Still cant figure why master products throws my product_info.php page all over the place, anyone help me on this please. link here.

 

http://www.supaosc.com/1/customers/catalog/product_info.php

 

Thx in advance if you know whats what.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×