Jump to content


  • Content count

  • Joined

  • Last visited

Posts posted by Zappo

  1. Found the second issue too:

    This was actually kinda intended, as the "image functionality" was added because of multiple requests of people who'd seen the functionality on my running Crystal Copy website. I re-used some code from my own site for this, and there it's used as FONT, so doesn't get added when no Text is added/entered...

    I don't remember (yet) where I set up this "text-detection", so will get back to you about that...

    Ok, I was wrong about that one :blush:

    This IS however a copy/past mistake:

    in modules/option_types.php, line 141, REPLACE:

    $Image_Dropdown_ID = 'id_' . $product_info['products_id'] . '[' . $ProdOpt_ID . ']';


    $Image_Dropdown_ID = 'id[' . $ProdOpt_ID . ']';


    Strange that no-one seems to have mentioned this before (or did I miss something?)


    I'll put out a new release a.s.a.p.

    Thanks for the bug-report!

  2. Hello Zappo and everybody


    I can confirm the issue with error


    The error happens in "product options" for option types "file", "text" and "textarea" when editing the "product option" , ie changing the "value length" for "text", after pressing "update"

    When inserting a new "product option" everything goes fine

    When editing, you need to get the error pressing "update", then go back in the browser, press "cancel", then the change is taken


    It's the latest contribution version (v 2.1.2 of 2/10/09) installed on a virgin rc2a (contribution files copied over) running locally on xampp


    Second issue: On the same installation, when I use the "image" product option everything works fine, except that the chosen option is not getting added to the cart. Both images appear correctly on product info page and change when switching the option there, but nothing gets added to the cart

    THANK YOU for a reply I can work with!!!

    Somehow, everything works here @ my system, but I found the mistake (for the mysql_fetch_array() error)...


    The mistake I made: in products_attributes.php, line 137 REPLACE:





    Found the second issue too:

    This was actually kinda intended, as the "image functionality" was added because of multiple requests of people who'd seen the functionality on my running Crystal Copy website. I re-used some code from my own site for this, and there it's used as FONT, so doesn't get added when no Text is added/entered...

    I don't remember (yet) where I set up this "text-detection", so will get back to you about that...

  3. zappo,

    thanks for the suggestion.

    all i need now is to get some uploading progress bar integrated

    thanks again



    An Upload Progress bar WOULD be nice...

    Of course I thought of that too, but it looked like quite a task to integrate...

    This HAS to be done with AJAX, because you'd have to add an extra page between product_info and shopping_cart if you wanted to do it elsewise...

  4. ontent"> Product Name   Option Name   Option Value   Value Price   Prefix   Sort Order   Action  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 'Resource id #75' at line 1
    Resource id #75
    [TEP STOP]


    Any help is greatly appreciated!

    You probably missed something while installing...

    The error occurs if you get something from the database (tep_db_query), and don't "convert" it to an array (tep_db_fetch_array)

    So you're missing some lines of code, or merged things wrongly...

  5. I need to add a file upload to create_account.php and I tried using another contribution that actually allows admin to upload a pdf to a product. I changed it up a bit with bad results. The box is there on the edit customer page, but half the time I get a fatal error with "no file uploaded" and the other half the time, no file uploads or (obviously) has a visible filename in the box. All I want is to have the customer upload a file when they create an account. I really don't need all the ajax or sorting. Is there possibly another contribution or modified version of this one that I could use? I have tried google and searching contributions for "file upload" and I don't find much. Through the forum I have learned of this and some other contributions, but then again not exactly what I need (don't need 3 images, etc.). I'm a bit frustrated trying this through the typical osCommerce coding but would rather do that than add straight php or html. Any help would be much appreciated! Thanks! : )



    This shouldn't be too hard, and I'm willing to help, but we'll have to do this together.

    Don't install OptionTypes v2 (or any other contrib for that matter) to handle this. That won't do you any good, as what you want is entirely different from admin- or attribute- uploading...


    1 ) depending on what you want to do with the upload(?), we'll have to decide IF and WHERE to add database fields

    2 ) decide if you want an "on/off" feature(?). We'll have to add configuration-database fields, or a setting in configuration.php


    a ) we'll have to handle the upload as if it were a "customer detail" (like "customer name" or whatnot)

    b ) we're gonna re-use the upload script from Option Types v2 to do the actual upload handling


    To start you off, create an upload field in create_account.php, and see that is has a proper name.

    Let me know the name of your field, and the decisions on points 1 and 2, and we'll continue.

  6. I saw this mentioned earlier in the thread, but little mention since. I am looking for a way to track stock levels of products with multiple attributes. For instance, I have a shirt with a logo on it. The shirt comes in four colors, and there are 5 or 6 sizes. That makes about 20-25 "actual" products that need to have their stock tracked. I have done plenty of research and still cannot find a solution. Maybe someone else has experience with a site selling apparel or similar and has dealt with this issue? I apologize if this is not the correct thread for this, but i cannot find a mention of this anywhere else. Help Please!


    That's actually not as easy as it seems...

    I WAS developing a contribution to handle that kind of stuff (and a lot more) called Linked Products, but development has totally halted on that project. I only released a (buggy) Alpha version...

    I will probably pick it up sometime in the future, but that'll be a long time from now...


    I think the closest you'll get to such functionality, is with Quantaty Tracking Pro (QTPro)


    Good Luck!

  7. Zappo


    Thanks one more time. I have that working the way you intended but not exactly the way I hoped it would. With your sort method I have to input a number for each attribute corresponding with where I want it to appear in my dropdown list. If I add an attribute out of sequence then I have to redo the entire sort order to get it in the right place.


    All I really need is to have my drop down options (attributes) appear in alphabetical order regardless of the order in which I input them. I was once able to accomplish this in osCMax by putting an order by at the end of a query in a file (maybe product_info?). If you understand what I am asking and you have the time could you please point me to the file where I can accomplish this.





    Hi Norman,

    I think I know what you mean...

    The Sort order as it works in the last update, is A LOT more user-friendly using the Attribute Manager (when adding Options, you set the sort order per product, just by clicking "Up or Down"...


    To just sort the Option Values by Option Value Name, just do this (I can't test this right now, I just have the files):

    Open up product_info.php, and find (around line 169):

    order by pa.products_options_sort_order");

    Replace that by:

    order by pov.products_options_values_name");

    Then, open includes/modules/option_types.php, and find (2x)(around line 96 AND line 132):

    order by pa.products_options_sort_order");

    and replace that by:

    order by pov.products_options_values_name");


    That should order the Product's Attributes (Products Values) by name.

  8. Zappo

    Thanks for your work. Am trying to follow the instructions for upgrading from V2.1.1 but run into a problem which is probably mine not yours.


    $price_prefix = tep_db_prepare_input($_POST['price_prefix']);

    $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);


    The same thing happens on the next section of your instructions also.



    Hi Norman,

    That's my bad...

    See my previous Post

  9. hi zappo,


    thanks for the update and your replay on my questions

    i started updating to the new version but noticed one difference on the new code for the product_attributes.php

    for example in the old file i have: ($HTTP_GET_VARS['action'])

    but in the new update: ($_GET['action']), and this is repeated through every _GET statement.

    i stopped my update here because i wondered if this was deliberate change or some kind of typo

    let me knmow please



    Hi Valeri,


    I'm sorry about that! Maybe I should have mentioned something...


    $HTTP_POST_VARS actually is the old version of $_POST. (starting from PHP v4.1, and I can't imagine a Host having a lesser version than that)

    In the future $HTTP_POST_VARS can (or rather will) be totally replaced by $_POST and at that time will stop working, and that's why my code (as of now) will probably always use the $_POST and $_GET etc instead of the $HTTP_POST_VARS and $HTTP_GET_VARS etc (shorter code too!!!)

    This ensures that when my Host updates the PHP software, osCommerce won't stop working.

    see PHP SuperGlobals for more information on this...


    Now, what you can do:

    I'm not entirely sure both can be used next to each other without problems, but they probably can...

    To be sure however, I would either Replace all the $_POST's and $_GET's with $HTTP_POST_VARS and $HTTP_GET_VARS etc...


    (what I did) Replace ALL (with ALL I mean ALL osCommerce files, by search and replace in all folders) the $HTTP_POST_VARS with $_POST, $HTTP_GET_VARS with $_GET, $HTTP_SERVER_VARS with $_SERVER, $HTTP_POST_FILES with $_FILES, $HTTP_COOKIE_VARS with $_COOKIE, $HTTP_SESSION_VARS with $_SESSION, and $HTTP_ENV_VARS with $_ENV

    (This can of course also be done later, when absolutely needed)


    Hope this explains everything...

  10. 2) it would be very helpful if you can provide some code suggestion on:

    if upload option is available replace the checkout button with or add another button that will be UPLOAD AND CHECKOUT


    3) perhaps could be an option when creating the options in admin a particular option can be set as a default selected always. this is not very flexible way but it can be a good start and will resolve the problem

    2) in modules/option_types.php, a variable is counted up for every upload available on the page ($number_of_uploads)

    You can use that variable to add/change the button on the product_info.php page: (around line 250 is the in_cart button)

    if ($number_of_uploads >= 1) {




    3) If you download the new release I brought out yesterday, and read this post you already have a perfectly neat solution!!!

    You can set the sort order of the desired default option to the highest value, and you're good to go!

  11. I am still having this error if I try and update an attribute. If I cancel the update it does the change.

    Those errors are probably caused by classes/shopping_cart.php...

    Information is gathered there, (not correctly) and handled by the files that throw the errors...

    Did you re-check your includes/classes/shopping_cart.php file?

    Do you have any other contributions installed, and which ones?

  12. Ok everyone, I found some time and:

    Released: Option Types v2.1.2

    * Added Product Attribute Sorting (Sort Dropdowns)

    * Added option for "No Text Progress Bars"

    * Applied Fixes discussed in this forum thread

    The sorting of the dropdowns can also be used for the "Default Dropdown value". That'll be the attribute sorted as highest!


    I included a file in the download named: Update from v2.1.x.txt

    That's for the people who have installed Option Types v2.1.0 or v2.1.1 (with the Image Option Type), and want to add the new functionality. Just follow the instructions in that file when updating, so you won't have to copy over all of your files. (and change the Database manually)


    Please report any bugs you may encouter!

  13. It worked out very well , but attributes disappearing when quantity is updated in shopping cart.

    Hi Zoran,

    Are you still having this problem?

    I thought I solved this some time ago...

    Please check if you updated the file includes/classes/shopping_cart.php correctly (and with latest version 2.1.1)

    Again, let me know how it works out!

  14. I am having one issue:

    In admin If i want to change the attribute it allows it - when I click the update button I get this error:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /admin/includes/functions/database.php on line 99

    Is anyone still having this issue?!?

    I can't replicate the result, and need more info to investigate!

    - Change the attribute? What, where and how? (using Attribute Manager? Updating attribute, but changing what?, any other contribs installed?)

    Thanx for the reply!

  15. i have 3 questions:

    1) Is it possible to add a file upload progress bar or something similar to show the user file is uploading

    2) I am thinking of adding a separate button to say "add to card and upload a file" in addition to the "add to card" button. The problem is i would like this button to appear only when the products with upload option are selected. And not appear with other products.

    3) Is it possible to force select of one attribute option or make by default one attribute option always selected? Let say the product has a £0.00 price and the user has to be forced to select one attribute option or by default one of them is always selected.

    1) I actually have been looking into that, but it's not at all easy to make!!! (It's very possible, but also pretty complicated...)

    2) You could have a variable set @ uploads (variable will only exist if an upload is also shown), and then use that variable to display/hide the extra button... It's not very pretty, but should work like a charm... (can provide some code if needed)

    3) That question was asked before, and we do need such functionality... Still looking into that (and the sort-order for attributes)

  16. hello


    i have just installed oscommerce rc2a with the following contributions : seperate pricing per customer 4.2.2 and SPPC pricebreaks v2.

    after installing option type in admin everything worked ok.


    i also get produkt_info.php installed and working. but after choosing a tex or textarea atribute the shopping cart stays empty. <_<


    the problem lies in the fact that the attribute code in several php files are so much different from original ocs rc2a that i can not make anything out of it to replace it with the code from the option type v2contribution.


    has anyone installed all 3 contributions ??

    Hi Eric,

    I actually contributed a little to those contribs as well, and did merge them with the previous version of Option Types...

    Although the "old" Option Types contrib is very much the same, it's not identical.

    So it can be done (and I will do it again with Option Types v2, but not for a while I'm afraid)


    If you need some help with any particular code, just drop me a message.

  17. I also find this issue.


    after I select image and add to cart, it will not go to shopping_cart.php and still on product)info.php page, but shopping cart box have add this quanlity.


    any advice?


    best Regards,

    That should not happen...

    Did you set "Display Cart After Adding Product" to TRUE in "Configuration-->My Store"???

  18. I hate to post twice, but I also cannot seem to get AJAX to work with this option types. It will say CUSTOMER-INPUT in the attribute manager, but when I go to the product page it is simply a drop-down with the option of "CUSTOMER-INPUT".


    I'm thinking something is not installed correctly...

    The CUSTOMER-INPUT in AttribManager is correct. (What else do you want to show there? --> It's what the Customer will later Input in the field (Either text or a file)

    Seems like the Option Type doesn't get (or can't get) detected as a Text or Upload, and the standard dropdown is displayed instead (which will indeed show "CUSTOMER-INPUT" if that happens...

    Did you include option_types.php correctly (in product_info.php)? Are all the files in place (includes/modules/option_types.php)

    Check if you installed correctly...

  19. echo $messageStack->output('upload')


    don't work on product_info.php


    That's actually a "left over" from the previous Option Types contribution, and has absolutely no use at all...


    Everybody who feels like it, may remove the following useless lines from product_info.php: (Around line 85)

    	<td><?php echo $messageStack->output('upload'); ?></td>

    Thanks for posting, Sunrise!

  20. In the Administration is the first Option you can change "Use progress bar" - i switched it to "text area" because there seems to be a sence for them since the textarea is not endless - but you're right - there should be an 4th option "None"

    You're both right, of course!

    I don't really know why I didn't add that in the first place! (Think I was used to having the progress bar @ least with the TextArea, because that's how the "old" option types contribution works...)

    Anyway, I don't have time for full updates 'n stuff, but thought I'd try and help some people out who posted here...


    To add the option of using No Progress Bars @ all:

    in catalog/includes/modules/option_types.php,

    FIND: (Around line 42)
      if (OPTIONS_TYPE_PROGRESS != 'TextArea') {
    FIND: (Around line 57)
      if (OPTIONS_TYPE_PROGRESS != 'Text') {
      if (OPTIONS_TYPE_PROGRESS == 'TextArea' || OPTIONS_TYPE_PROGRESS == 'Both') {

    If you already ran the SQL file (already installed Option Types v2), Run the following SQL to add the "None" Option:

    # BOF - Zappo - Option Types v2 - Update Progress Bars Choices (add "None")
    UPDATE `configuration` SET set_function = 'tep_cfg_select_option(array(\'None\', \'Text\', \'TextArea\', \'Both\'),' WHERE `configuration_key` = 'OPTIONS_TYPE_PROGRESS';
    # EOF - Zappo - Option Types v2 - Update Progress Bars Choices (add "None")

    That's all folks!

    You now should have the added Progress Bar Configuration option of "None".

  21. i could see same in my installation

    did you manage to sort it out some how?

    OMG Guys!!!

    I made a typo in the instructions for the removal of Products Attributes from products_attributes.php!!!!


    In products_attributes.php FIND: (That's if you already made the changes)

    <!-- options and values//-->
    	<td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    //BOF - Zappo - Option Types v2 - AttribManager - Rearanged Product options and Option Values
    /*		  <tr>
    		<td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">
    //EOF - Zappo - Option Types v2 - AttribManager - Rearanged Product options and Option Values



    <!-- options and values//-->
    	<td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    //BOF - Zappo - Option Types v2 - AttribManager - Rearanged Product options and Option Values
    /*		  <tr>
    		<td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">*/
    //EOF - Zappo - Option Types v2 - AttribManager - Rearanged Product options and Option Values

    Took me quite a while to find/think of that Typo... (notice the missing */)

    It was your screenshots that gave the clue: You're also missing the "Options" part of products_attributes...

    Sorry for the mistake guys! :blush:

    (Didn't test b.t.w. but I suspect that'll do the trick)