Jump to content
Latest News: (loading..)
kymation

[Development] Products Specifications

Recommended Posts

Lots of problems here:

Line 275: Form starts. This shouldn't be here.

Line 623: Form starts again. Duplicates Line 275. This is the correct location.

Line 923: Form ends. Correct location.

Line 940: Closing } ends the file. Any code after this will not execute. My IDE throws a fatal error at this point.

Lines 943-947: Code outside a PHP block. This code will display and not run, even if the previous error is fixed.

Line 964: Form ends again. Duplicates Line 923. This shouldn't be here.

 

Lines 992-1000: Tell a friend form -- This is the way it should be, not duplicated or overlapping another form.

 

If you are using the Tabs setting for this page, the Include on Line 622 has another form start and stop in it. Any form in this page cannot include that line.

 

If you want two Add to cart buttons on your page, put each one in a separate form. Enclose just the minimum number of lines of HTML that you can without breaking the standard. That will keep those buttons away from the other forms on this page. That's 4 forms on one page, all of which have to be kept separate.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Jim,

I appreciate your input. I am not a coder, just a simple store owner. The suggestions you made are confusing to me. I ahve tried to make them but still end up with errors. Could you possibly mark up the code I posted so that I can understand what you mean?

Thanks


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

Jim,

I appreciate your input. I am not a coder, just a simple store owner. The suggestions you made are confusing to me. I ahve tried to make them but still end up with errors. Could you possibly mark up the code I posted so that I can understand what you mean?

Thanks

 

DOUBLE POST

Edited by lyonsperf

If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

Sorry, but I don't know everything. There are a lot of errors on that page, and many of them seem to have nothing to do with Products Specifications. You have several Contributions installed that I'm not familiar with, so I don't really know what the page should look like with those installed. I can see errors, but I have no idea how to correct them without doing a lot of research and debugging. Unfortunately I don't have time to do that right now.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Fix 2 works great !

 

There only still is something exceptional on my site. I have a manufacturer defined which I used to call 'other' but I have changed the name to '' so that it basically doesn't show.

I'm quite happy to adapt my code to take this funny data into account, but I found it strange that it as a products count, actually shows the count of the 'show all' option.

 

what do you think ? is this something easy for you to fix, or should I work my way around these funny data ?


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

Share this post


Link to post
Share on other sites

We need the count for the "all" option -- it's used in the code. I thought it looked strange to not display it. I suppose we could add an option to not show that value. Is this really what you want, or am I reading this wrong?

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

additional request: have the price range take into account tax settings,

i.e; if you show prices with tax, have the filter work on prices tax inclusive

 

buggy situation:

I get a debug array in the breadcrumb when I activate the filter from the box on the left on the default index page when no categories have been selected. On my site the box on the left shows that there are 2 products, but clicking shows the start of the full product list. It is unclear which 2 products are intended, as upon click it lists everything. Strange behaviour.

I PM'ed the link to the test site.


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

Share this post


Link to post
Share on other sites
We need the count for the "all" option -- it's used in the code. I thought it looked strange to not display it. I suppose we could add an option to not show that value. Is this really what you want, or am I reading this wrong?

 

Regards

Jim

 

suppose for 9 products in total, with 1 brand A, 2 brand B and 6 non-branded (empty string as manufacturers_name) it shows

[X] Show All (9)
[  ] (9)
[  ] Brand A (1)
[  ] Brand B (2)

 

while it should be

[X] Show All (9)
[  ] (6) <--------------------
[  ] Brand A (1)
[  ] Brand B (2)


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

Share this post


Link to post
Share on other sites
additional request: have the price range take into account tax settings,

i.e; if you show prices with tax, have the filter work on prices tax inclusive

I'm calling that a bug, since it should happen by default. Added to the bugs list.

 

buggy situation:

I get a debug array in the breadcrumb when I activate the filter from the box on the left on the default index page when no categories have been selected. On my site the box on the left shows that there are 2 products, but clicking shows the start of the full product list. It is unclear which 2 products are intended, as upon click it lists everything. Strange behaviour.

I PM'ed the link to the test site.

Ouch! Leaving debug code in is bad enough, but that's definitely not working right. I'll take a look. Another bug for the list.

 

Thanks for the bug reports.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
suppose for 9 products in total, with 1 brand A, 2 brand B and 6 non-branded (empty string as manufacturers_name) it shows

<code snipped>

That's because your manufacturer has no name, so it looks like the Show All setting. This could be tricky. I'll take a look.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
Is it possible to add an option to use an image instead of text for a specification. For example, the color blue would have a color swatch, red would have red swatch and so on?

Yes.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi Jim,

 

You did a great job!!

 

I found one coding error in includes/functions/products_specifications.php on Line 17:

 

  function tep_clean_get__recursive ($get_var) {

should be:

 

  function tep_clean_get_recursive ($get_var) {

Took me days to discover this one. I wonder why nobody ran into this.

 

I Installed the new version in my test store with all the contributions.

 

During installation I found no code conflicts with the following contributions:

  • Article Manager v1.0 1.57.1
  • Contribution Tracker 1.7.15
  • Detailed Monthly Sales 1.1
  • FCKeditor for Product Descriptions 2.7
  • Google XML Sitemap SEO 1.1
  • Guestbook for osC(MS2) v1.0 2.0
  • Information Pages Unlimited v1.0 2.05
  • Newsletter & Subscribers 055
  • Optional Related Products 1.0 4.0
  • Order Editor 5.0.6.6
  • oscThumb 1.0.1
  • Purchase Without Account 2.1
  • QTpro v1.0 - Quantity Tracking Professional 4.51b
  • Secure your site with an IP trap 2.1
  • Ultimate SEO URLs 2.7
  • "Dynamenu" for osCommerce - Dynamic Fly-Out, Drop-Down, Tree Category Menu 1.1.2
  • Add a BACK button in the product_info 1.2
  • Add image background nav bars may2009
  • Add Order ID colum 1
  • admin - copy, move and delete multiple products 2.5c
  • Admin Categories Shows Manufacturer 1
  • Admin Panel Facelift Revision 1.0 1.0
  • Attribute Sets Plus 1.3.3b
  • AutoBackup Database in Admin 2.8
  • Bank Transfer Payment Option may2009
  • Breadcrumb for Admin 1b
  • Category Specials 2.1
  • Check Permissions 1.0 1.3
  • Credit Class & Gift Voucher 5.21
  • Custom Server Error Pages 1.1
  • Dutch TPGpost (for new checkout) 2.4
  • Enable & Disable Categories 1.6.6
  • European Bank Transfer 1.9.3
  • Featured Products 1.6.4
  • Graphical Borders 1.1
  • Holiday settings 1.0.1
  • iDEAL Easy - ABNAMRO 1.2
  • Image Manager 1.1
  • Left and Right Column Control 1.0
  • New Google Sitemap Generator 1.2
  • NL_Taalpakket_v2 3.3
  • Previous - Next - With detailed info 3.5
  • Product Listing in Columns 2.2.8
  • Protect your site via htaccess jul2008
  • Quicker Product Edit v1 2.1
  • Request Product Info V 1.0 1.1
  • RMA Returns system 2.6
  • Security Pro 1.0.2
  • SiteMonitor 1.7
  • U HTML Emails 2.1
  • Updated spiders.txt dec2008
  • Who's Online Enhancement 3.5.4
  • [TiM's] Safer Database Input Method mar2009

Note: Some contributions require a update to their newer versions.

 

I found conflicting code in two contributions but could easly fix them myself:

 

1. UltraPics - MS2 Image Addon Pack! 2.07.01

 

Merged code in product_info.php:

 

// Products Specifications
// BOF MaxiDVD: Modified For Ultimate Images Pack!
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_tab_1, pd.products_tab_2, pd.products_tab_3, pd.products_tab_4, pd.products_tab_5, pd.products_tab_6 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

2. Header Tags SEO V 3.0 3.1.4

 

Merged code in admin/categories.php:

 

// Products Specifications
/*** Begin Header Tags SEO ***/
		$description_query = tep_db_query ("select language_id,
												   products_name,
												   products_description,
												   products_head_title_tag,
												   products_head_desc_tag,
												   products_head_keywords_tag,
												   products_url,
												   products_tab_1,
												   products_tab_2,
												   products_tab_3,
												   products_tab_4,
												   products_tab_5,
												   products_tab_6
										  from " . TABLE_PRODUCTS_DESCRIPTION . "
										  where products_id = '" . (int) $products_id . "'
										");
		while ($description = tep_db_fetch_array ($description_query) ) {

If I find conflicts during actually testing the store I will report these later.

 

Regards Jerome

Share this post


Link to post
Share on other sites

No, the function name is correct. Your change will break the code in the three places that function is used. I copied the function from SecurityPro 1.0.2. I deliberately didn't change the name to avoid conflict with that contribution.

 

That's quite an impressive list of contributions. I'm surprised that you didn't find more conflicts. Of course the SQL statements are the most likely place to find overlapping code changes. I should add those two examples to the User Manual. Thanks for providing that code.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
No, the function name is correct. Your change will break the code in the three places that function is used. I copied the function from SecurityPro 1.0.2. I deliberately didn't change the name to avoid conflict with that contribution.

OK, that explains why nobody ran in to this one. I did not really break the code because the function was in two different places. I have SecurityPro 1.0.2 installed; indeed I found the function in includes/functions/security.php as well. Having them in both places gives a HTTP 500 error. Either one of the tep_clean_get__recursive($get_var) functions should be disabled to fix this problem.

 

So found a code conflict with a third contribution here!

 

Regards,

Jerome

Edited by JvdP

Share this post


Link to post
Share on other sites

Right, I should have mentioned that conflict. Added to the list.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

I've uploaded another release to the official site and to my site. This is probably the last RC release, unless someone comes up with a major show-stopper in the next couple of days.

 

I've fixed all of the errors, with one exception: The problem with matching a blank value (Manufacturer's name, or anything else really) is likely impossible, or at least a special case requiring a lot of extra code. Unless someone can come up with a good way of handling this, because I'm stumped. The problem is that MySQL thinks that a blank value matches everything. In older versions of MySQL, a blank/empty string was treated as a NULL. NULLs are special values, and we could get them to follow normal matching rules with a bit of extra work. Unfortunately this feature/bug no longer works. So for the foreseeable future, don't leave filter values blank. Put in N/A or Misc. or Unknown or your_store_name for the manufacturer, or some reasonable value for whatever field you are using.

 

Otherwise, all that remains is some cleanup. I'll post a new thread for support of the released version, and keep this one for ongoing development. I haven't forgotten that there are still things on the wish list. I still intend to keep working on this.

 

Thanks to everyone who has contributed to this effort. Your help has been extremely valuable. Without all of the interest this has generated, I would probably have given up long before this point. I hope that all of you get a great deal of benefit from this code.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Thanks Jim, I guess the ball is back in our court :)

 

I have perhaps a dumb question, but why do you have a function tep_get_products_tab_6 for each tab, when the logic is essentially the same in each ?

Why not have the tab passed as parameter and use one function ?


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

Share this post


Link to post
Share on other sites

That's a very good question. I wish I had a very good answer. Unfortunately, it appears that my brain was just not working that day. Good thing you didn't ask why I had a database field named products_tab_6 in the first place ... oops.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

I must say, it is the cleanest code I have ever seen on the osCommerce contribution section !

and so usefull, much needed too !!


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

Share this post


Link to post
Share on other sites
I must say, it is the cleanest code I have ever seen on the osCommerce contribution section !

and so usefull, much needed too !!

The first part is more a condemnation of osCommerce contributions than anything. This code needs a lot of cleanup before I would consider it properly done. Maybe later, if I have the time. Meanwhile, it is useful, and I agree that it was needed. So go put it to work, and may it bring you many more sales.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi Jim,

 

One of my contributions is Enable & Disable Categories. The counter of the filter options includes products in disabled categhories as well. When executing a filter these products are included in the search result. But when clicking on them a "no products found" message is displayed.

 

To solve this incompatability I tried the following code in catalog\includes\classes\specifications.php, starting on line 81:

	  // Start Enable & Disable Categories V1.6.6 (http://addons.oscommerce.com/info/326)
  $raw_query_from = " from (" . TABLE_PRODUCTS . " p)
						join (" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) 
						  on (p.products_id = p2c.products_id)
						left join (" . TABLE_SPECIALS . " s)
						  on (p.products_id = s.products_id)
						left join (" . TABLE_CATEGORIES . " c)
						  on (p2c.categories_id = c.categories_id)
					";
  $raw_query_where = " where p.products_status = '1' and c.categories_status = '1'";
  // End Enable & Disable Categories V1.6.6 (http://addons.oscommerce.com/info/326)

I tested this and all seems to be working fine. So I don't think it will be nescessary to change any other code. What do you think?

 

Regards,

Jerome

Share this post


Link to post
Share on other sites
Hi Jim,

 

One of my contributions is Enable & Disable Categories. The counter of the filter options includes products in disabled categhories as well. When executing a filter these products are included in the search result. But when clicking on them a "no products found" message is displayed.

 

To solve this incompatability I tried the following code in catalog\includes\classes\specifications.php, starting on line 81:

	  // Start Enable & Disable Categories V1.6.6 (http://addons.oscommerce.com/info/326)
  $raw_query_from = " from (" . TABLE_PRODUCTS . " p)
						join (" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) 
						  on (p.products_id = p2c.products_id)
						left join (" . TABLE_SPECIALS . " s)
						  on (p.products_id = s.products_id)
						left join (" . TABLE_CATEGORIES . " c)
						  on (p2c.categories_id = c.categories_id)
					";
  $raw_query_where = " where p.products_status = '1' and c.categories_status = '1'";
  // End Enable & Disable Categories V1.6.6 (http://addons.oscommerce.com/info/326)

I tested this and all seems to be working fine. So I don't think it will be nescessary to change any other code. What do you think?

 

Regards,

Jerome

I'll be testing this too.

 

It looks like the logical change to me too, but when I then think about it a little further, I wonder why there is a left join on the categories table when you do enforce an equi-join a little higher up with the products_to_categories table, which is logical to me, so wouldn't it als make more sense to have a join with categories.

 

Secondly, i was wondering if the join constructions would be subject to the mysql 4 - 5 differences and might need another set of brackets to work on all mysql versions.


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

Share this post


Link to post
Share on other sites
I'll be testing this too.

 

It looks like the logical change to me too, but when I then think about it a little further, I wonder why there is a left join on the categories table when you do enforce an equi-join a little higher up with the products_to_categories table, which is logical to me, so wouldn't it als make more sense to have a join with categories.

 

Secondly, i was wondering if the join constructions would be subject to the mysql 4 - 5 differences and might need another set of brackets to work on all mysql versions.

Worth testing a equi join, it might ne a little less "buggier". I have tested this on mysql 5. Don't know the differences with mysql 4. Thanks for your feedback!

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

×