Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Development] Products Specifications


kymation

Recommended Posts

I've uploaded Version 0.9rc1 to the official repository. The usual warning on delay due to size applies. Until the official upload is approved, you can also find it here. Yes, this is a release candidate. Finally.

 

Features added:

1. Filter Counts shown after the filter. Option can be turned off in Admin.

2. Filters that would return no result can be disabled or not displayed. Also an option in Admin.

3. Tabbed display on the Product Info page. Also optional in Admin.

4. Alternate Product Info page (product_information.php). Not an Admin option, but you can change the define in your filenames.php. This was designed to look more like the osCommerce 3.0 page. I think it looks good with the Tabbed display. Hopefully it will give you some ideas.

 

There are still some requested features that have not been added. See the bugs.txt in the distribution or here for details. These will have to wait until after Version 1.0 is released. I still plan to add them, but the current version will be useful to a lot of people as it is.

 

All of the known bugs have now been fixed, including the elusive Range filter bug. Note on Range filters: Products that fall on the boundary will show up in two filters. For example, if you have filters set as 8-16 and as 16-32, any product with a value of 16 will show up in both ranges. This is likely what your customers would expect. This can be "fixed" so that products will only show under one range, but the fix will probably be slower. Let me know what you think of this.

 

Thanks again to everyone who contributed, whether it was code, suggestions, testing, data, or just support. You have all made a difference to this little project.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hmm.. I've tested previous versions and this contribution does seem very promising. I'll soon be updating my main site to include this.. just a lot of products to add specs for unfortunately :(

 

Anyway.. we use a lot of special prices on our products and we would like to use a filter to manage the prices.. ie. £100 - £200, this obviously doesn't work with the products price field. Will the specials field be making an appearance any time soon? I know it's a different table so seems unlikely to happen soon but just thought I'd "log my interest".

 

Great work by the way, very grateful for everything you and others have done so far.

 

Scott

no outside links please

Link to comment
Share on other sites

Jim,

 

Congratulations with the first RC of this contribution. I will install it in our teststore to check for any conflicts with existing contributions. To be honest very little contributions will prefer above this one. So I don't expect that much problems. A big thank you so far!

 

Regrads,

Jerome

Edited by JvdP
Link to comment
Share on other sites

Anyway.. we use a lot of special prices on our products and we would like to use a filter to manage the prices.. ie. £100 - £200, this obviously doesn't work with the products price field. Will the specials field be making an appearance any time soon? I know it's a different table so seems unlikely to happen soon but just thought I'd "log my interest".<snipped>

This is #38 on the Features Wish List. Would you want this as a separate filter on the Specials price only or as a part of the Price filter? Combined with the Price would be easiest, but either way can be done. I could always do both and offer the option, but I'd prefer not to waste time if nobody wants to use an option.

 

As far as timing goes, I want to get this to Version 1.0 first, if at all possible. Once it's out there and people can use it, there will be plenty of time to add features like this.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have done the update and I am getting this error:

0 -

 

select count(p.products_id) as count from (products p) join (products_to_categories p2c) on (p.products_id = p2c.products_id) INNER JOIN products_specifications ps39 ON p.products_id = ps39.products_id where p.products_status = '1' and p2c.categories_id = '129' AND (ps39.specification between \'0 and 32\') AND ps39.specifications_id = '39' AND ps39.language_id = '1'

 

Could you point me in the right direction to sort this. Thanks

Link to comment
Share on other sites

Yes, I've found yet another way to break the Range filter. Don't use that for now; I'll have an update to fix tht problem shortly. Thanks for the bug report.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I've uploaded v. 0.9rc2 to the official location and my site. The usual warnings apply.

 

The only significant change is to catalog/includes/functions/products_specifications.php. That should fix the latest Range filter SQL error, and is cleaner code as well.

 

Please post here if you find any other problems, or have any other suggestions, complaints, or otherwise feel like talking about this Addon.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi integration with the products_price would probably be best, as in the "final_price" on oscommerce.. Number 38, that's alot! Obviously if nobody wants it I'm sure I can take it myself and have a look once I get round to integrating it.

 

Scott

no outside links please

Link to comment
Share on other sites

Good, that won't be hard to do. I may try to sneak it into the next Release Candidate if I think I can do it without breaking too much.

 

Don't let the numbers scare you. The list counts bugs as well as features. Sometimes it's hard to tell them apart. We're up to about 75, but there are only 10 features that haven't been implemented. The list is in the bugs.txt file in the distribution and also here. Feel free to tackle any of those you want, but announce it here first so nobody else is duplicating your work.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Sweet the filter works perfectly thanks guys just a quick one I am having real trubble with the tabs.

 

<?php

/*

$Id: products_specifications.php, v 0.9rc1 20090824 kymation Exp $

$Loc: catalog/includes/modules/ $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2009 osCommerce

 

Released under the GNU General Public License

*/

 

/*

* This file produces the product specification list on the Product Info page.

*

* $current_category_id and $_GET['products_id'] are required to determine which

* specifications to show.

*/

 

 

$specification_box_heading = array();

$specification_box_heading[] = array ('text' => SPECIFICATION_TITLE_PRODUCTS);

 

$specifications_query_raw = "select ps.specification,

sd.specification_name,

sd.specification_prefix,

sd.specification_suffix

from " . TABLE_PRODUCTS_SPECIFICATIONS . " ps,

" . TABLE_SPECIFICATION . " s,

" . TABLE_SPECIFICATION_DESCRIPTION . " sd,

" . TABLE_SPECIFICATION_GROUPS . " sg,

" . TABLE_SPECIFICATIONS_TO_CATEGORIES . " sg2c

where sg.show_products = 'True'

and s.show_products = 'True'

and s.specification_group_id = sg.specification_group_id

and sg.specification_group_id = sg2c.specification_group_id

and sd.specifications_id = s.specifications_id

and ps.specifications_id = sd.specifications_id

and sg2c.categories_id = '" . (int) $current_category_id . "'

and ps.products_id = '" . (int) $_GET['products_id'] . "'

and sd.language_id = '" . (int) $languages_id . "'

and ps.language_id = '" . (int) $languages_id . "'

order by s.specification_sort_order,

sd.specification_name

";

// print $specifications_query_raw . "<br>\n";

$specifications_query = tep_db_query ($specifications_query_raw);

 

$count_specificatons = tep_db_num_rows ($specifications_query);

if ($count_specificatons >= SPECIFICATIONS_MINIMUM_PRODUCTS || SPECIFICATIONS_BOX_FRAME_STYLE == 'Tabs') {

 

$specifications_box_contents = array();

$specification_text = '<ul class=specification_box>' . "\n";

while ($specifications = tep_db_fetch_array ($specifications_query) ) {

if ($specifications['specification'] != '') {

$specification_text .= '<tr><td class="main"><li>';

 

if (SPECIFICATIONS_SHOW_NAME_PRODUCTS == 'True') {

$specification_text .= $specifications['specification_name'] . ':<td class="main" width="73%">';

}

 

$specification_text .= $specifications['specification_prefix'] . ' ';

$specification_text .= $specifications['specification'] . '';

$specification_text .= $specifications['specification_suffix'] . '</td>';

$specification_text .= '<tr><td class="main">';

} // if ($specifications['specification']

} // while ($specifications

$specification_text .= '</tr></td>';

 

$specifications_box_contents[0] = array ('align' => 'left',

'params' => 'class="main" valign="middle"',

'text' => $specification_text

);

 

// Show the products description text

if (SPECIFICATIONS_BOX_FRAME_STYLE != 'Tabs') {

// echo '<p class="main">' . stripslashes ($product_info['products_description']) . '</p>';

 

?>

<table border="0" width="60%" align="center" cellspacing="0" cellpadding="0">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="maintop" valign="top">

<!-- products_specifications_box //-->

<?php

}

if (SPECIFICATIONS_SHOW_TITLE_PRODUCTS == 'True' && (SPECIFICATIONS_BOX_FRAME_STYLE == 'Plain' || SPECIFICATIONS_BOX_FRAME_STYLE == 'Simple') ) {

echo '<b><img src="images/icons/info.gif" height="13" width="13" Border="0" alt="Products Spec"> ' . $specification_box_heading[0]['text'] . '<hr></b>';

}

// Output the box in the selected style

switch (SPECIFICATIONS_BOX_FRAME_STYLE) {

case 'Tabs':

include_once (DIR_WS_MODULES . FILENAME_PRODUCTS_TABS);

break;

case 'Plain':

new borderlessBox ($specifications_box_contents);

break;

case 'Simple':

new productListingBox ($specifications_box_contents);

break;

case 'Stock':

default:

new contentBoxHeading ($specification_box_heading, false, false);

new contentBox ($specifications_box_contents);

break;

} // switch

?>

<!-- products_specifications_box_eof //--> </td>

</tr>

</table>

<?php

Untitled.gif

Link to comment
Share on other sites

I've uploaded 0.9rc3 to the official site and to my site. This adds a Final Price column option (the lower of the regular price and the sale price.) This is fairly self-contained and shouldn't affect anything else. I'm not going to be surprised when one of you proves me wrong.

 

I also fixed a few minor bugs, mostly cosmetic. The User's Manual has also been updated, but is still not complete.

 

I haven't been hearing any complaints of problems with the previous release, so I'm cautiously optimistic about a final release in a few days. If any of you know of a reason to doubt this, now would be a good time to post.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Sweet the filter works perfectly thanks guys just a quick one I am having real trubble with the tabs.

<image snipped>

Tabs are a bit tricky. Make certain that you have the stylesheet and the Javascript included, and that the stylesheet loads after the main stylesheet. Check that you have jquery-1.3.2.min.js loaded in the correct location; likewise the tabs image. If all else fails, replace your products_info.php with the one from the distribution and see if that works.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Looking at the list you linked, all of the have FIXED by them bar the one at the top? Are they all fixed or is that just there to confuse us? :P

You mean the bugs list? I see nothing under Known Bugs, 10 under Features Wish List, and the rest fixed. Oh, that's now 9 under Features since I just added one. The latest list is here and in the distribution.

 

As far as confusing you, isn't my code bad enough? :blink: :P

 

Regards

Jim

 

PS: Yes, #2 was un-fixed. The code was right the first time.

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Make certain that the whole tab section is in a table cell or div. Also, all of your HTML needs to be correct -- check validation on your page. An error in a table will mess the whole thing up.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Make certain that the whole tab section is in a table cell or div. Also, all of your HTML needs to be correct -- check validation on your page. An error in a table will mess the whole thing up.

 

Regards

Jim

The issue is I have a table in some of the descriptions and that seems to throw off the whole page. I do close them off properly but for some unknown reason it doesn't work.

Link to comment
Share on other sites

I finally finished the install on my heavily modded shop and must say it went well. The only quirks I see are that the product description is duplicated. The original description is on top and the spec box with the tabs repeats the description. How can I shut one of them off? Secondly, in the admin=>categories=>product listing page the specs box has overlapped my boxes for the meta name and meta description. This seems like a format issue on my part should be easy to fix.

Eventually I hope that step by step instructions are included for the newbie.

Thanks!

Matt

Link to comment
Share on other sites

I finally finished the install on my heavily modded shop and must say it went well. The only quirks I see are that the product description is duplicated. The original description is on top and the spec box with the tabs repeats the description. How can I shut one of them off? Secondly, in the admin=>categories=>product listing page the specs box has overlapped my boxes for the meta name and meta description. This seems like a format issue on my part should be easy to fix.

Eventually I hope that step by step instructions are included for the newbie.

Thanks!

Matt

The product description is moved out to the specifications module so it can be used in a tab. It will show twice if you forgot to remove it from product_info.php.

 

There are installation instructions in the User's Manual. If you think they are inadequate, please tell me how they can be improved.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hello Jim,

 

After receiving numerous notifications of all your hard work, i've just had the courage tonight to attempt the installation on a heavily modified shop.

The time, effort and dedication you put into this is greatly appreciated !

 

Thusfar I've only done the administration end to see if I could integrate it into the heavily modded categories.php file, I think it went fairly good ...

 

I also loaded up your categories.php file in the admin, for debugging.

Both in my customized file, as in the provided categories.php file, I cant get the multi-select (checkbox) values to save properly.

I use 2 languages. I selected the first checkbox for the first language and the second one for the second language. The N/A field added stayed untouched.

Upon save, all 3 checkboxes of the first languages were flagged, and the 2nd and 3rd (N/A) of the second language.

 

Also I found it strange that I could actually flag values that cause inconsistent data between the 2 languages.

 

From the bugs.txt file, looks like item 32 is not fixed yet.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Thanks for the bug report. I'll take a closer look at this one. It's not quite #32, since it does somewhat work the first time, and (I assume) still doesn't work if repeated. So I've added a new bug to the list.

 

Inconsistent data between two languages is deliberate -- you might not have the data for one of your languages, or that item may only apply to one language version of the product (Ratings for DVDs, perhaps?)

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks for the bug report. I'll take a closer look at this one. It's not quite #32, since it does somewhat work the first time, and (I assume) still doesn't work if repeated. So I've added a new bug to the list.

Ok, is see.

 

Inconsistent data between two languages is deliberate -- you might not have the data for one of your languages, or that item may only apply to one language version of the product (Ratings for DVDs, perhaps?)

I have to disagree with this. Language is not country. Language being purely a translation of the same semantic value in different languages, I can not think of any good reason why you would allow different results based on language used. Rated R, is exactly that in English, French, Dutch, Russian ... (i.e. being what has been put on the DVD 'version' in question being sold). I understand for DVDs it can be tricky as some countries might be more restrictive than others, but you can't substitute language for country to accomodate this exception.

 

Sorry to be a bit hung-up on this issue, but in a tri-lingual country, this does matter. Think about the french speaking canadians, which DVD rating scheme would apply ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

OK, that was a really bad example. Obviously I didn't think that through.

 

So, to turn the argument on its head, how would you enforce the same results in different languages? If this is desirable to do, how do we do it?

 

Regards

JIm

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

OK, that was a really bad example. Obviously I didn't think that through.

 

So, to turn the argument on its head, how would you enforce the same results in different languages? If this is desirable to do, how do we do it?

 

Regards

JIm

 

To be honest; I don't think that would be possible. Lets say we have a image filter. If this filter is used to filter colors for a product than a red square image might apply to red, rot, rood, rouge and rojo but it won't apply for all images if the name of the color is actually placed in the picture.

 

The only possibility I can think of is to introduce an universal language which applies to all languages when individual languages are left empty. Though, there is not any part of osCommerce, not even with alpha 3, designed this way. So why this contribution?

 

Or am I missing the point?

Link to comment
Share on other sites

if you want to have a name on the image, that can be done with the current design. Just create your images and upload the correct one for each language.

 

If you don't need the name, just the color, then you can use the same image for each language.

 

I don't see the need fo a "universal language." Not here, anyway. It would certainly be useful if you could get the entire world to agree on one language and get rid of all the rest. Good luck with getting that to happen.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

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...