Latest News: (loading..)
kymation

[Development] Products Specifications

713 posts in this topic

Adding the missing function should have fixed the linking. If it didn't, there's still another bug in that area.

 

Sorry about the missing file. I've uploaded a new package with the file included.

 

In other news, PHP 5.3 is now out. One of the new features is a GOTO statement. Yes, I can now write code like I did in the days of Fortran 2. Joy!*

 

Regards

Jim

 

*No, I'm not actually going to do that. My code is bad enough as it is.

 

PHP 5.3... yes I noticed, took me four days to get everything working again. Sessions really kept me busy this time.

 

Any way, I think there is still a bug in the subcategory linking functionality. However, I am afraid some things are still not complete. Specifications are not displayed in the product preview and product info properly. Hopefully not a PHP 5.3 issue?

 

Sort order issue is fixed by the way!

 

I will wait for your next release (Filtering! Yes!) and continue testing.

 

Regards

Jerome

Share this post


Link to post
Share on other sites

yep like azer said.. catalog/includes/modules/product_specifications.php is missing in v 0.33

 

didnt continue the install after noticing that.

 

please update... ty

Share this post


Link to post
Share on other sites

One more update added. Includes the missing file, some updates to the Admin, and an updated file list in the Readme.txt.

 

I'm not going to update this again until I have some form of working Filters. Post bugs if you find them, of course, and I'll try to get them in the next update. Which I am working on. Honest.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Sorry,

there's a problem in products_specifications_0_3_4.

 

In Admin products_specifications.php, there's an error.

 

products_specifications_01.jpg

 

What Can I do??

 

THK

Share this post


Link to post
Share on other sites
Sorry,

there's a problem in products_specifications_0_3_4.

<snip>

What Can I do??

 

THK

Fix it, given the information in the error message. Or wait until this is a finished Contribution.

 

I now have settled on a way of handling filters (Third try.) I'll post the code as soon as I get enough bugs out that it actually works (For certain values of "works.")

 

Regards

Jim

Share this post


Link to post
Share on other sites

Filters. Filters! Filters!!!!!

Yes, there is now filter code. It hasn't been extensively tested, but at least some of it works. OK, I tested the Price column using the Range class. It mostly works. Note that some combinations of class and display will not work and never will, even through they can be selected. Multiselect requires either a Multiselect pulldown or check boxes. Reverse range will not work on any of the existing columns (Since none of them are ranges.) There are many many more. I need to do a table showing what will work. For now, use common sense.

 

This is the last of the major feature code. There are still some things that need to be coded, but the majority of the functionality is here now. Please test this out. Set it up the way you want to use it on your store. Try out new things. Break it if you can. This is where we fix the bugs. And add some features that I forgot/haven't had time to code/don't know about yet.

 

See the bugs.txt file for known bugs. There will be more. If you find some, please report them here so I can fix them. Code is also appreciated, as are suggestions for new features.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Great! Before testing I made a fresh installation. However when importing the SQL file I run into the following Error:

 

Error

SQL query:

 

CREATE TABLE IF NOT EXISTS `specifications_filters` (

 

`specifications_filters_id` int( 11 ) NOT NULL AUTO_INCREMENT ,

`specifications_id` int( 11 ) NOT NULL DEFAULT '0',

`language_id` int( 11 ) NOT NULL DEFAULT '1',

`filter` varchar( 128 ) DEFAULT '',

`filter_sort_order` int( 11 ) NOT NULL DEFAULT '0',

PRIMARY KEY ( `specifications_id` ) ,

KEY `specifications_id` ( `specifications_id` , `language_id` )

) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =1;

 

MySQL said:

 

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

 

Maybe this could use some attention right away, other test result will be posted later.

 

Regards,

Jerome

Share this post


Link to post
Share on other sites

It looks like

PRIMARY KEY ( `specifications_id` ) ,
should be
PRIMARY KEY ( `specifications_filters_id` ) ,

Share this post


Link to post
Share on other sites

That's right; the keys should be

  PRIMARY KEY (`specifications_filters_id`),
 KEY `language_id` (`language_id`),
 KEY `specifications_id` (`specifications_id`)

Only the first of many bugs, I'm afraid.

 

Regards

Jim

Share this post


Link to post
Share on other sites

And:

 

Error

SQL query:

 

(

 

NULL , 'Show Filters Box', 'SPECIFICATIONS_FILTERS_BOX', 'True', 'Show the Filters box in the side column', 1610, 55, '2009-06-26 18:24:00', '2009-06-26 12:07:30', NULL , 'tep_cfg_select_option(array(''True'', ''False''), '

);

 

MySQL said:

 

#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 'NULL, 'Show Filters Box', 'SPECIFICATIONS_FILTERS_BOX', 'True', 'Show the Filter' at line 1

 

The ";" should be "," at the end of rows 144, 145, 146 and 147 of the SQL file

 

Regards,

Jerome

Edited by JvdP

Share this post


Link to post
Share on other sites

And Line 154 should have a ; and doesn't. Thanks for the bug report.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Hi Jim,

 

Here is my first, apart from the SQL import issues, bugreport on version 0.4:

 

Fixed:

  • No sort order given when creating new specification
  • Link the subcategories to the specification group
  • Prefix not shown on the product info page
  • Specification displayed when empty
  • Categories with two or more linked specifications, only the first specification is listed
  • Active/inactive functionality admin/products_specification
  • Is it correct that the comparison row in table, when set, is always displayed. Even in unlinked categories

Not Fixed:

  • Product names are not listed in the product comparison page
  • Should Minimum Spec Category be functional? Comparison button is always displayed

New Bugs:

1. On admin product preview specifications not correctly displayed:

 

Spec Box Frame Style set to plain: only the word “Specifications:”

Spec Box Frame Style set to simple: only the word “Specifications:” with a narrow empty box

Spec Box Frame Style set to stock: only the word “Specifications:” in a grey banner and two image not found anchors

On catalog side: no problems found.

 

2. On catalog comparison page specification list is not right

 

Only the specification names are given with their suffix below this between (). The actual contents of the specification is not displayed. Nor is the productname (see as well under Not Fixed above).

 

3. Database error when selecting specifications in the “Filter Products” Box

 

When selecting a product filter the following error occurred:

1054 - Unknown column 'ps.specification' in 'where clause'

 

select count(p.products_id) as total from products_description pd, manufacturers m, products_to_categories p2c, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and p2c.products_id = p.products_id and pd.language_id = '1' and p.manufacturers_id = m.manufacturers_id and (ps.specification = 'on' and ps.specifications_id = '1') and (ps.specification = 'on' and ps.specifications_id = '1') and (ps.specification = 'on' and ps.specifications_id = '1') and (ps.specification = 'on' and ps.specifications_id = '1')

 

[TEP STOP]

 

On pull down menus this happens when selecting from the list the first time, with radiobuttons this happened when selecting from the list the second time.

 

4. Specification prefix and suffix are listed for every selection

 

I don’t think the prefix and suffix have to be listed for every selection possibility. I would rather have something like the prefix mentioned before the list and the suffix after it. Example:

 

Specification name:

Prefix

- Show all

- Selection 1

- Selection 2

- Selection 1

Suffix

Unfortunately I run into your first known bug. But the selection types seem to be displayed correctly. As well status of specifications, comparisons and filters are all working fine.

 

There is one thing I like to ask: Why is the hierarchy “specification group -> specification -> filter” chosen this way? I understand more specifications can be defined in one group. But why more filters in one specification? Shouldn’t this specification be filtered based on the actual contents of the specification itself in the various products? Instead of a predefined set of filters? I am sure you have thought about this already. Please, could you explain your idea behind this?

 

As always, I will continue playing around with this while looking forward to some future updates. Thanks so far!

 

Regards

Jerome

Share this post


Link to post
Share on other sites

Product names on the Comparison page: Drat, thought I had that fixed. Back on the list.

 

Minimum Spec Category: Completely forgot about this one. On the list.

 

1. Bug. I broke the preview by changing the database and never updated it. I need to make the module match the one on the Catalog side.

 

2. Bugs. Obviously I need to take a better look at this.

 

3. Bug, probably many. I decided that Range was the hardest to do, so I tested that. I've since found several more bugs in this area. Much more testing to do.

 

4. Not sure. Something like memory size should list every filter followed by MB or GB. Prefix might need to be there only once. Let me think about this one.

 

Filters are the most difficult part of the whole thing. Filters get compared to the data for the products to get a set of matching products. The filter can be applied to the products in many different ways. There can be any number of filters, from 2 to 200. Probably less than that, but however many the store owner wants. So we need to be able to add as many filters as are wanted, in many different formats (filter classes), with many different display options, and then compare to find the matching products.

 

For example, my test version of this is using the following price filters:

Price

  • Show All
  • $0.00 - $50.00
  • $50.00 - $100.00
  • $100.00 - $200.00
  • $200.00 - $500.00
  • $500.00+

Each line of that is a separate filter. This is set up as a Range, displayed as Links, and matched to the products_price column in the products table. Many many other settings are possible and must work.

 

This was hard for me to grasp, and the design went through several iterations before I found a way to make all of these options work. It's not all there yet, but it's getting close. I'm still open to considering a different design, but it had better be really good to force me to scrap all of this and do it again. I'm not that fond of pain.

 

Anybody who's seriously testing this is going to find bugs. I deliberately released it without testing everything. If I waited, I ran the risk of getting distracted (Ooh, shiny!) and never finishing. This has happened before. Maybe when I get this one working, I'll go dust off the remains of the Shopping List and finish it. And a couple more that I don't remember all that well. Don't hold your breath.

 

Regards

Jim

 

Memo to self: Don't rely on the spell checker to choose the correct word.

Edited by kymation

Share this post


Link to post
Share on other sites

Hi Jim,

 

Thanks for your explanation, I was thinking the other way around. However, I tried again by adding PEGI ratings to the games in the original osCommerce store and agree with your current design.

 

Specification group = PEGI

Specification1 = Label

Specification2 = Age

 

When I add these specifications to the products I would have to choose specfic content, like:

 

Violation, Discrimination, Drugs or Sex for "Label"

3+, 7+, 12+ or 16+ for "Age".

 

I understand, this is where you need Filters for.

 

Then I would choose (multiselectable) checkbox set would apply for "Label" and radiobuttons (or range!) for "Age". I assume this functionality is just a text input field temporarly.

 

Not having a list with possible content of the specifications here will lead to input errors for sure.

 

Regards,

Jerome

Edited by JvdP

Share this post


Link to post
Share on other sites

I agree with the need to restrict input to a specific list of values. That's on the list, but I haven't had the time to work on that yet. I'm more concerned with getting the Catalog side fixed before adding more Admin functionality.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Hi,

 

Now in product_info.php this error:

 

Warning: include_once(includes/modules/products_specifications.php) [function.include-once]: failed to open stream: No such file or directory in /product_info.php on line 125

 

Warning: include_once() [function.include]: Failed opening 'includes/modules/products_specifications.php' for inclusion (include_path='.:/usr/local/lib/php') in /product_info.php on line 125

 

Bye

Share this post


Link to post
Share on other sites
Warning: include_once(includes/modules/products_specifications.php) [function.include-once]: failed to open stream: No such file or directory in /product_info.php on line 125

 

Yep, this file is missing again, I didn't notice because I still had it from earlier upload.

Share this post


Link to post
Share on other sites

Sorry about that. I seem to be under some sort of missing-file curse. Uploaded 0.4.1 with the missing file.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Version 0.4.2 is now up. Most of the bugs previously noted have been fixed. See the list in the bugs.txt file for details.

 

Filters should now work, although I have seen some strange bugs under some circumstances. Still trying to get a handle on those. If you see a bug when using Filters, please state the Filter Class and Display type for your filters along with a description of the error.

 

Thanks again to everyone who has helped with testing and identifying bugs. This code wouldn't be nearly as far along without you.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Version 0.4.2 is looking good! Have a quick question: is it possible for products to be assigned with multiple specifications. For example, setting up a specification called colour and then assigning a product to have both blue and black in admin? That way if a customer chooses either Black or Blue from the colour filter, the same product is returned?

Share this post


Link to post
Share on other sites

That could be handled two ways. The colors could be already set up as attributes/options in the Admin. This would be the most likely for an existing store. The current code doesn't handle attributes, but it is on my list to be added.

 

The second possibility is to have a Specification that can handle multiple data (such as colors.) I hadn't thought of that one. I will add that to the list of data types that we can filter. Good suggestion. If you have any more of those, please post them here.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Not sure if this is a bug or how it is meant to work. Products with specs only show when filtering by them if they have a Manufacturer attached to them.

 

example:

 

If I setup a product with spec attached called "Black" and search for this on the front the product does not show up. If I add a Manufacturer to the product it does show up on the filters when searching for Black.

 

Some of my products dont have Manufacturers so I cant get them to show when filtering.

Share this post


Link to post
Share on other sites

My first response when reading that was "That can't happen...oh wait...." Granted, every product should have a manufacturer designated, even if it's just your store. However, osCommerce doesn't require a manufacturer to be set, so we shouldn't keep products from showing up here if the manufacturer isn't set. So yes, that's a bug in the SQL. I'll fix that. Thanks for reporting it.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Hi Jim,

This looks very great!

 

With your bugs.txt it will not be necessary to list all the fixed and not fixed issues. Maybe you could add the displayed information with catalog\comparison.php as well. It is still not giving a list of products with their specifications. I assume only the header is being displayed.

 

I didn't check the actual filtering yet, but only the functionality of the filtertypes:

 

Pulldown: default selection is the last entry. This selection cannot be selected, when changing the selection the filter is executed immediately. Maybe an empty row top could fix this.

 

Radiobuttons: default selection is the last entry. Changing the selection does not execute the filter. It is executed when selecting another radiobutton or another specification.

 

List of links: filter is not working; list of results shows no products.

 

Images: filter is not working; list of results shows no products.

 

Multi image: Error im Admin while saving the specification:

1265 - Data truncated for column 'filter_display' at row 1

 

update specifications set specification_group_id = '1', specification_sort_order = '0', show_comparison = 'True', show_products = 'True', show_filter = 'True', products_column_name = '', column_justify = 'left', filter_class = 'reverse', filter_show_all = 'True', filter_display = 'multiimage' where specifications_id = '2'

 

[TEP STOP]

Checkbox and multi-pulldown: works good, filter classes are a bit odd.

 

Text box: works great

 

Will check some filterresults later. Thanks so far!

Jerome

Share this post


Link to post
Share on other sites
Checkbox and multi-pulldown: works good, filter classes are a bit odd.

 

While filter class set to multiple selecting using checkboxes. Selecting more than one checkbox will only return products of the last selected checkbox.

Edited by JvdP

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