Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Starting over with Product Sizes/Lengths?


peaceland

Recommended Posts

Posted

Sorry, I'm still a newbie with this osC stuff...

 

When we created our shopping cart, I was not made aware that we needed to put every size imaginable in UP FRONT, before doing anything else.

 

Now, I want to add additional sizes, and from what I gather, I need to erase all the work we have done and start over from scratch. with 300+ items. Because the new size would be added to the end of a list, and it will throw off all the sorting.

 

Is there a better way?

We also have lengths that may increase or decrease as well?

 

Also, how tough is it to use Addons? is there an Addon for this?

I looked at some of the Addons, and was a little wary when the description of the Addon contained typos.

Are all the Addons listed here verified to work by someone other than the author?

I can't afford to totally mess up my shopping cart.

I suppose I should back it all up before trying an addon.

 

Thank you!

Posted

I'm not sure I understand what you are asking but no matter what it is, there shouldn't be any reason to start over. In the worst case, you may need to upload a new set of images but that won't hurt anything. If you are wanting the ability to show more than one image per product, then you need to install one of the image contributions that adds that option. The Additional Images addon is probably the best one right now. There's no guarantee with any of the addons. Before trying one, you should check the support thread for it and see if there are a lot of problems with it. Plus, not uploads in the addon section are full packages so you need to be sure to grab the correct one. Always backup your files before making changes. It is very easy to make a mistake, or maybe the code won't work with your shop for some reason. But it can be very difficult to fix the mistake without a backup.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

I'm not sure I understand what you are asking but no matter what it is, there shouldn't be any reason to start over. In the worst case, you may need to upload a new set of images but that won't hurt anything. If you are wanting the ability to show more than one image per product, then you need to install one of the image contributions that adds that option. The Additional Images addon is probably the best one right now. There's no guarantee with any of the addons. Before trying one, you should check the support thread for it and see if there are a lot of problems with it. Plus, not uploads in the addon section are full packages so you need to be sure to grab the correct one. Always backup your files before making changes. It is very easy to make a mistake, or maybe the code won't work with your shop for some reason. But it can be very difficult to fix the mistake without a backup.

 

Our issue isn't really related to images, although I have other issues with the quality of the images, as well.

 

Our concern is that our product has a number of ring sizes, currently Size 6, 6.5, 9, 11, 13, and 17. We thought we could just add more ring sizes later and all would be well, as we got them into inventory.

 

However, I tried adding a new Size 4 this week, and now, because it was added at the end of the list of Values, now it comes up at the end of the list of sizes - after size 17 in drop down selection menus. I was advised, either delete all the Values and re-enter them (which would also require redoing all of the Product Attributes, as well, or try to find an Addon that would solve this problem. The same situation would apply if we decided to change lengths of our items, as well.

 

Another issue with the sizing in products is in order for Sizes to sort numerically, I have to put them as Size 07 for Size 7, otherwise Size 11 will come before it in the list.

 

Appreciate all your help.

Thank you!

Posted

As far as I can see there is no reason why your ring size problem can not be addressed within the data base - a case of downloading the products_attributes table and altering it to what you need.

 

It would even be possible to cut and paste the sizes for each ring if that would suit you - you would have to be sure that the IDs were correct

 

Doing this way you would not need the prefix 00 as the sort is on the products_attributes_id not the options_values_id - however it should be possible to alter the script so that the sort is done on the options_values_id and possibly to sort from right to left rather than left to right

My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Posted

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Posted

 

 

Might be an idea to point him towards it then 'cus I can't see it - looks like everything was discussed except how to index the attribute value rather than the attribute ID...

My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Posted

Might be an idea to point him towards it then 'cus I can't see it - looks like everything was discussed except how to index the attribute value rather than the attribute ID...

 

I'll try this Wed eve with our designer... thank you! Still not sure if this is what we are asking for...

Posted

Might be an idea to point him towards it then 'cus I can't see it - looks like everything was discussed except how to index the attribute value rather than the attribute ID...

Well one of the links in Sam's message was about applying a desired sort order to the query used in the select statement through which product options are displayed, ie in the example given, in product_info.php:

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id 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 pa.options_values_price, pa.products_attributes_id");

 

This adds an 'order by' statement to the query, in this particular case on options_values_price (which if bigger rings cost more should even work without change?) but if it works, not that I have tried it, then it seems it should work with order by pov.products_options_values_name? Presumably if you are selling rings with size options the option name is 'size' and the option_values_name holds the different sizes available?

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Posted

Our issue isn't really related to images, although I have other issues with the quality of the images, as well.

 

Our concern is that our product has a number of ring sizes, currently Size 6, 6.5, 9, 11, 13, and 17. We thought we could just add more ring sizes later and all would be well, as we got them into inventory.

 

However, I tried adding a new Size 4 this week, and now, because it was added at the end of the list of Values, now it comes up at the end of the list of sizes - after size 17 in drop down selection menus. I was advised, either delete all the Values and re-enter them (which would also require redoing all of the Product Attributes, as well, or try to find an Addon that would solve this problem. The same situation would apply if we decided to change lengths of our items, as well.

 

Another issue with the sizing in products is in order for Sizes to sort numerically, I have to put them as Size 07 for Size 7, otherwise Size 11 will come before it in the list.

 

Appreciate all your help.

Thank you!

Oh, you're talking about product attributes. First, if you don't have too many attributes, you should be using the Easy Populate contribution to manage them. That will save you hours of work and aggravation. The "too many" isn't a problem with that contribution but with the various spreadsheet programs since they can only deal with so many columns. If you have the latest version of Excel, that is not a problem. You may want to ask in the Easy Populate support thread for more details.

 

Next, if your attributes are showing up in the wrong dropdown, it just means you made a wrong selection in admin when you were adding them. All you need to do is edit those attributes in admin->Catalog->Product Attriubtes and move them to where they should be.

 

As for sorting, oscommerce doesn't have attribute sorting code built-in. There are several contributions meant for that though. I suggest the Attributes Sorter/Copier one since it allows you to add/edit the addtributes when you add/edit the product.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

Oh, you're talking about product attributes. First, if you don't have too many attributes, you should be using the Easy Populate contribution to manage them. That will save you hours of work and aggravation. The "too many" isn't a problem with that contribution but with the various spreadsheet programs since they can only deal with so many columns. If you have the latest version of Excel, that is not a problem. You may want to ask in the Easy Populate support thread for more details.

 

Next, if your attributes are showing up in the wrong dropdown, it just means you made a wrong selection in admin when you were adding them. All you need to do is edit those attributes in admin->Catalog->Product Attriubtes and move them to where they should be.

 

As for sorting, oscommerce doesn't have attribute sorting code built-in. There are several contributions meant for that though. I suggest the Attributes Sorter/Copier one since it allows you to add/edit the addtributes when you add/edit the product.

 

Will check out Easy Populate. The attributes are not in the wrong dropdown, they are just in the wrong order, because we added a smaller size after adding all the larger sizes. Will check out the Attributes Sorter/Copier - Thank you!

Posted

So far as the sorting problem for product attributes is concerned I still don't see why not to simply modify the query used in the select statement for the dropdown. All it requires is changing one line of code to add an 'order by' statement in that query, ie

 order by pov.products_options_values_name

 

to deal with the fact that products_options_values_name is a text field and numbers like 10,11 etc get sorted before numbers like 2, 3, 4 etc you can simply add a 0 in the order by statement, ie.

 order by (pov.products_options_values_name+0)

. This, behind the scenes, turns 2 into 20 and 11 into 110 etc and makes the sort order correct - and I have now tried it.

 

This would work for any attributes that can be sorted alphabetically or numerically. It would only fall down where you have sizes like XS, S, M, L, XL which obviously can't be sorted alphabetically. For that you would need to set up a sort order field if you didn't set them all up at the beginning in the right order (if you did then you could rely on the id field for the sorting).

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Posted

So far as the sorting problem for product attributes is concerned I still don't see why not to simply modify the query used in the select statement for the dropdown. All it requires is changing one line of code to add an 'order by' statement in that query, ie

Yes, that can be done and will work to a limited extent. There's a thread here somewhere from years ago discussing it and even a contribution, as I recall.

 

to deal with the fact that products_options_values_name is a text field and numbers like 10,11 etc get sorted before numbers like 2, 3, 4 etc you can simply add a 0 in the order by statement...

 

It would only fall down where you have sizes like XS, S, M, L, XL which obviously can't be sorted alphabetically.

If a shop has 10 product attributes, having to do things a certain way to get them to work is OK, I guess, but when products start getting into the hundreds, it becomes a nightmare to worry about having to add them in.

 

For that you would need to set up a sort order field if you didn't set them all up at the beginning in the right order (if you did then you could rely on the id field for the sorting).

So a shop owner adds values for ring sizes 1, 2 and 3. Then next month decides he want to sell half-sizes. Now he has to delete all of the attributes and re-enter them. :(

 

Installing Attributes Sorter, or one of the other ones, is the best solution for anyone working with attributes.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

No, there wouldn't be any need to delete and re-add anything to cater for later on adding half-sizes. The method works for any number of products and attributes so long as they are all capable of alpha-numeric sorting. It's only if they're not, and a different attribute like price can't be used, that a sort order field needs to be introduced. No doubt something like Easy Populate has other advantages as well, but the original question was only about alphanumeric sorting.

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Posted

As long as the shop owner never decides to expand the options it will work. Seems very short-sighted but it will work under certain conditions.

You mean, expand beyond those that can be sorted alpha numerically :) Of course, the greater the number and diversity of products you sell, or might sell in future, the more chance there is of that - even more so if you sell in different languages..

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Posted

So far as the sorting problem for product attributes is concerned I still don't see why not to simply modify the query used in the select statement for the dropdown. All it requires is changing one line of code to add an 'order by' statement in that query, ie

 order by pov.products_options_values_name

 

to deal with the fact that products_options_values_name is a text field and numbers like 10,11 etc get sorted before numbers like 2, 3, 4 etc you can simply add a 0 in the order by statement, ie.

 order by (pov.products_options_values_name+0)

. This, behind the scenes, turns 2 into 20 and 11 into 110 etc and makes the sort order correct - and I have now tried it.

 

This would work for any attributes that can be sorted alphabetically or numerically. It would only fall down where you have sizes like XS, S, M, L, XL which obviously can't be sorted alphabetically. For that you would need to set up a sort order field if you didn't set them all up at the beginning in the right order (if you did then you could rely on the id field for the sorting).

 

Actually, what I did was this:

 

order by (0+pov.products_options_values_name)

or order by (pov.products_options_values_0+name)

 

except I did it by hand by putting a zero in front of everything. I don't know if you can actually do that in osCommerce code (is this php, btw?)

I didn't do it in the code. I did it in the product area for the name of the products, so that the products would sort in correct order.

 

Can the code be written this way?

Posted

Actually, what I did was this:

 

order by (0+pov.products_options_values_name)

or order by (pov.products_options_values_0+name)

 

except I did it by hand by putting a zero in front of everything. I don't know if you can actually do that in osCommerce code (is this php, btw?)

I didn't do it in the code. I did it in the product area for the name of the products, so that the products would sort in correct order.

 

Can the code be written this way?

Yes, I saw you wrote that you had manually changed a size from '7' to '07' in your product options. This can work but it's not really want you want is it? I am sure you want a size 7 to be described as '7' and not a '07', plus you don't want to have to go through manually editing all your sizes, and also I don't think what you did solved your problem because you said you were still getting a '4' you added coming at the end of the sort.

 

What you did by editing the options is not the same thing that I have been talking about, which is editing the code in the product_info.php file. If you open that file up with a text editor you will see the php code for that page. In that code is an sql query which determines the contents for the drop down menu of options for a particular product. That query can be modified by the addition of an 'order by' statement, which can cause the items in the menu to appear in a specified sort order instead of the default, which I think is the id field. You can make the options sorted by price, and you can also make them sorted in alphabetical order either of which they wouldn't necessarily ordinarily do, without your having to edit or change your product options at all. When using an alphabetical sort the addition of a zero at the end will stop anything beginning with 1 from being considered as lower than anything beginning with 2 or above, when numbers which are being treated as text (it is an alphabetical sort) are sorted. The particular sql statement to be modified is given in the message linked in Spooks's message where he refers you to a post on modifying the sort order of product attributes. That post describes sorting on price, but the same technique can be used to sort alphabetically on the option values name, which is what you need to happen, and what I tried to explain to you. If you want to use this method, go back to Spook's message, follow the link he mentioned and read the post he referred you to find the whole query that you need to look for in product_info.

 

There are also addons which can offer more versatility than the method I described, which have also been mentioned. For installing those you will also have to make modifications to the code in various files.

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...