Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

attribute sorter challenge


sinmike

Recommended Posts

i got the attribute sorter and copy addon v5, tested it and everthing worked great.

after adding about 30 option names and about 630 option values i have the following problem:

 

1. in product attributes under option values the names and values are displayed nice in order under each other. when i go to categories to add a new product then in the option name table the values a mixed up.

 

2. when i add options in a new product and i click preview it takes about 30 sec. then i get the preview page and after that i can not do anything. the browser is not responding anymore.

 

hope someone can help me.

Link to comment
Share on other sites

Might get v5.1 that is on my site.

 

It is more current and has more features.

 

I would have to see what it is doing to know what the problem is. I have not run into a problem on this, but I have not added 630 option values either.

Link to comment
Share on other sites

Linda..

Your attributes mod is great .. thanks ;)

I have a problem though .. my only real need for it was to sort the options display in the admin so as I am adding or changing attributes for a product they are listed ASC or DESC .. but they are still appearing in the order in which they were entered in the product attributes page.

 

Did I miss something ?

 

Thanks

-caz

Link to comment
Share on other sites

Just to clarify ...

currently I see attributes listed as..

 black    

white    

red    

forest green    

baby blue    

navy    

baby pink  

natural    

royal blue    

salt n' pepper    

fuscia    

lollipop red  

... etc.

 

when they should be ..

baby blue 

baby pink

black

... etc.

 

I have tried modifying the 'order by' in admin

categories.php

 $options_query = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name ASC");

(added the ASC) .. but I guees it isn't the correct one because it doesn't change anything.

 

Any help much appreciated.

-caz

Link to comment
Share on other sites

I found the sort order column on the admin/product_attributes page ..

I have 10 options and over 600 attributes... do I really have to edit each one to put a sort order value for them to show up in my admin/categories.php page in ascending order ? :shock:

 

I am thinking there should be an easier way to accomplish this .. :?:

.. maybe I am barking up the wrong mod for my needs.

 

any advice much appreciated.

Link to comment
Share on other sites

This the code located beneath the section:

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

// BOF: WebMakers.com Added: Draw Attribute Tables

 

And change to:

 

    $options_query = tep_db_query("select products_options_id, products_options_name, products_options_sort_order TABLE_PRODUCTS_OPTIONS from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name");

   while ($options = tep_db_fetch_array($options_query)) {

     $values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "' " . " order by pov.products_options_values_name");

 

Be sure to backup first.

Link to comment
Share on other sites

hi linda,

 

i guess i found out what the problem was :idea: . different option names can not have same values.

 

for example:

 

option name: lenght

values: 10, 12, 14

 

option name: diameter

values: 8, 10, 12

 

this causes a double entry in the product_option_values and it looks like osc does not like that.

 

i changed all double values to something like this: 10.0 and everything works fine.

 

ok... it still takes long to load and save when adding a product.... but i guess that is normal if you have over 630 values :wink: .

 

regards,

 

mike

Link to comment
Share on other sites

I just discovered an issue with the code replacement posted previously for making the attributes admin/categories.php page in ascending order .

It displays correctly but doesn't put it in the database correctly.

ie: if my list were originally

sand

brown

black

white

red

 

it appeared as...

black

brown

red

sand

white

 

but anything that should have options red and sand now had black and white :shock:

 

thank goodness for backups .. and I still learned a bunch ;)

Link to comment
Share on other sites

This is what I do to get the attributes sorted which, when adding them to your cart, seems to get the proper attribute names. In catalog/includes/product_info.php, look for:

 

echo tep_draw_pull_down_menu( ... bunch of stuff ... )

 

Right ABOVE that line, add the following:

 

usort($products_options_array,

  create_function('$a, $b','return strcasecmp($a[text],$b[text]);'));

 

That should be one line (I split it here for readability).

Link to comment
Share on other sites

I will try that ;)

 

But what I'm really looking for is for the admin area.

I have the modified product_info.php which allows you to add the options as you are adding a product.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...