Jump to content



Photo
* * * * * 1 votes

[Development] Products Specifications


  • Please log in to reply
707 replies to this topic

#621   OSC-Sevilla

OSC-Sevilla
  • Members
  • 391 posts
  • Real Name:George
  • Gender:Male
  • Location:Sevilla, Spain

Posted 25 April 2012 - 12:14

html_output.php

HTML VALIDATION ERROR ON:

case ($link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'grey'):
$field .= '<optgroup class="no_results" label="';
$field .= tep_output_string ($link_data['text'] );
if (SPECIFICATIONS_FILTER_SHOW_COUNT == 'True' && $link_data['count'] != '') {
$field .= ' (' . $link_data['count'] . ')';
}
$field .= '"></optgroup>';
break;

CHNAGED TO:

case ($link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'grey'):
$field .= '<option disabled="disabled" class="no_results" >';
$field .= tep_output_string ($link_data['text'] );
if (SPECIFICATIONS_FILTER_SHOW_COUNT == 'True' && $link_data['count'] != '') {
$field .= ' (' . $link_data['count'] . ')';
}
$field .= '</option>';
break;

Edited by gfasal, 25 April 2012 - 12:16.

OSC 2.3.1
INSTALLED:Document Manager / Monthly Sales and Tax Returns / Batch Print Invoices / Ultimate HTML EMAILs / AJAX Attribute Manager / OSC PDF Catalog / Move Bookmarks / Sort Order / Easy Populate / Sales Reports / Low Stock Report / Admin: Model # on Category / Product Administration Screen / Mini images in admin / SLiCK reCaptcha / Google + / Beautiful Breadcrumbs / 2.3.1 - Banner Language Mod / ADD New Page / EASY MAP (google) v.3.0 / Who's Online Enhancement for 2.3.1 / Admin Notes / scrambled order number / remove_unused_images / Quantity Select / Unit Weight / Product Specifions (filter results) / AJAX Product Attributes/ Attribute Codes/ Date & Order No. to Invoice/ O.P.I. 2.0 / Attribute Images / Manual Order Editor / Attributes Clone / Order Editor / Create Order / Company VAT No. / Add customer/ CKEditor 2.3.1 / Page Manager / Default images via admin / Percentage Shipping Price / QTPro / Scroll to Top / PDF Invoice / Featured Products / Product Listing Enhancements / AutoBackups / Ultimate SEO URLS 5 Pro / Kiss Tags/ ..Custom Admin Mods /

#622   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,296 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 25 April 2012 - 17:30

optgroup is valid XHTML, and option is not a valid substitute for optgroup even if you add the disabled tag. I don't know what your validator is complaining about, but that's the wrong answer.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price in Cart Only/MAPP Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support
Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#623   OSC-Sevilla

OSC-Sevilla
  • Members
  • 391 posts
  • Real Name:George
  • Gender:Male
  • Location:Sevilla, Spain

Posted 25 April 2012 - 20:29

most of my pages i validate through http://validator.w3.org/

im not that offay with many, which one do you recommend?

I actually have the orgional code but for the time being have referenced it as another case.

also, re validation, xhtm transitional and html5 ui references (not sure), such as role="button" umongst others...

what validation measures do you undertake? what is your take on it, im wondering about best practises...?

some page of mine are 100% (no errors), others are not.


Thank you.

Edited by gfasal, 25 April 2012 - 20:34.

OSC 2.3.1
INSTALLED:Document Manager / Monthly Sales and Tax Returns / Batch Print Invoices / Ultimate HTML EMAILs / AJAX Attribute Manager / OSC PDF Catalog / Move Bookmarks / Sort Order / Easy Populate / Sales Reports / Low Stock Report / Admin: Model # on Category / Product Administration Screen / Mini images in admin / SLiCK reCaptcha / Google + / Beautiful Breadcrumbs / 2.3.1 - Banner Language Mod / ADD New Page / EASY MAP (google) v.3.0 / Who's Online Enhancement for 2.3.1 / Admin Notes / scrambled order number / remove_unused_images / Quantity Select / Unit Weight / Product Specifions (filter results) / AJAX Product Attributes/ Attribute Codes/ Date & Order No. to Invoice/ O.P.I. 2.0 / Attribute Images / Manual Order Editor / Attributes Clone / Order Editor / Create Order / Company VAT No. / Add customer/ CKEditor 2.3.1 / Page Manager / Default images via admin / Percentage Shipping Price / QTPro / Scroll to Top / PDF Invoice / Featured Products / Product Listing Enhancements / AutoBackups / Ultimate SEO URLS 5 Pro / Kiss Tags/ ..Custom Admin Mods /

#624   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,296 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 25 April 2012 - 20:57

The W3 validator is good, but it sometimes finds errors that don't exist, and occasionally is flat wrong. I use it, but I don't rely on it. My first pass is validation in Eclipse, which checks PHP as well as HTML. It's not perfect either, but it catches gross errors. Another way to check is to use View Source in Firefox and look for the red tags.

I take a practical approach to validation: The code doesn't have to be perfect, it just has to work. If all the major browsers display it without problems, you have probably done well enough. Search engines only read a subset of HTML, so they are generally less of a problem.

I look mainly for tags out of order or not closed properly, or tags used where they are not allowed. Minor errors, like the use of & instead of &amp; are not that important.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price in Cart Only/MAPP Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support
Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#625   OSC-Sevilla

OSC-Sevilla
  • Members
  • 391 posts
  • Real Name:George
  • Gender:Male
  • Location:Sevilla, Spain

Posted 25 April 2012 - 21:50

Thanks, thats what i tend to do, but one get carried away picking at it!

many thanks
OSC 2.3.1
INSTALLED:Document Manager / Monthly Sales and Tax Returns / Batch Print Invoices / Ultimate HTML EMAILs / AJAX Attribute Manager / OSC PDF Catalog / Move Bookmarks / Sort Order / Easy Populate / Sales Reports / Low Stock Report / Admin: Model # on Category / Product Administration Screen / Mini images in admin / SLiCK reCaptcha / Google + / Beautiful Breadcrumbs / 2.3.1 - Banner Language Mod / ADD New Page / EASY MAP (google) v.3.0 / Who's Online Enhancement for 2.3.1 / Admin Notes / scrambled order number / remove_unused_images / Quantity Select / Unit Weight / Product Specifions (filter results) / AJAX Product Attributes/ Attribute Codes/ Date & Order No. to Invoice/ O.P.I. 2.0 / Attribute Images / Manual Order Editor / Attributes Clone / Order Editor / Create Order / Company VAT No. / Add customer/ CKEditor 2.3.1 / Page Manager / Default images via admin / Percentage Shipping Price / QTPro / Scroll to Top / PDF Invoice / Featured Products / Product Listing Enhancements / AutoBackups / Ultimate SEO URLS 5 Pro / Kiss Tags/ ..Custom Admin Mods /

#626   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,164 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 10 July 2012 - 14:10

Jim,

My site is getting slow, and I'm looking to see where I can speed things up with indexes, but also noticed quite a number of repetitive queries as I have a filter on manufacturer for all products on the site.

So I'm trying to optimize the filter box for exact queries.
Currently, a query is run to retrieve the products_id count for each possible filter value.
I would like to change this logic so that only a single query is used like
select filter, count(products_id) as count from ... where ... group by filter
and then the counts are taken from the returned array.

or maybe I could just return the different filter values, and execute the getFilterCount only for the ones that are in use.

BTW, the filtering on % discount is working on category pages (not yet on specials)
Don't just sit there - contribute to the responsive bootstrap community effort !
http://forums.oscomm...iew__getnewpost


Hava a nice day !
Carine Bruyndoncx


Seen anything good relevant on the net about responsive design for ecommerce ?
You might as well post it in my responsive liive shop review thread .

#627   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,296 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 10 July 2012 - 17:11

The SQL in Products Specifications was designed to be as efficient as possible for most stores. Of course that may not apply to your particular store, so feel free to experiment with whatever changes you feel might work. I suggest using the KISS Error Handler to benchmark the different versions. Please post what you find from this experiment.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price in Cart Only/MAPP Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support
Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#628   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,164 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 10 July 2012 - 18:59

OK, I'll post my findings. I have the KISS error handler installed, so I'm all set to go /wink.png' class='bbc_emoticon' alt=';)' />
Don't just sit there - contribute to the responsive bootstrap community effort !
http://forums.oscomm...iew__getnewpost


Hava a nice day !
Carine Bruyndoncx


Seen anything good relevant on the net about responsive design for ecommerce ?
You might as well post it in my responsive liive shop review thread .

#629   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,164 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 11 July 2012 - 23:29

I think this one officially qualifies as a hack, a piece of code to optimize a particular part of the webshop leaving most of the code untouched ... with a 'WorksForMe' warning /wink.png' class='bbc_emoticon' alt=';)' />

I've a working version, not yet totally clean, but it does reduce the number of queries from 249 to 79 on a page with a few filters, and from 298 to 128 on another page (with more filters)
Now the actual gain is more difficult to measure. Overall the number of queries is a lot less, but there is now a more complex query for which I'd hope the result is faster than all the individual small queries.
I'm hitting the same database, thinking about how to test this now, or what kind of monitoring I can put in place to measure this with life visitor data ...

Here is the code if you want to try this yourself - note this is a development thread, if these instructions are not clear to you, you should probably not be trying this ...

the code change in products_filter box is

ADD
	    if ($specs_array['products_column_name'] == 'manufacturers_id' and $specs_array['filter_class'] == 'exact') {
		  $filters_select_array = $spec_object->CB_getManufacturerFilterCount ($filter_id, $specs_array['specifications_id']);
	    } else {
BEFORE
$previous_filter = 0;
	    $previous_filter_id = 0;

ADD
}
BEFORE
$box_text_vars = tep_get_filter_string ($specs_array['filter_display'], $filters_select_array, FILENAME_PRODUCTS_FILTERS, $var, $$var);

In the specifications class file, add a new function, a trimmed down, modified getFilterCount function just for manufacturers
    public function CB_getManufacturerFilterCount($specification, $specifications_id) {
	  global $filters_select_array;
	  global $filter_index;
	  $raw_query_from = " from (" . TABLE_PRODUCTS . " p)
						    join (" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c)
							  on (p.products_id = p2c.products_id)
						    left join specials s on (p.products_id = s.products_id)  
					   ";

	  $raw_query_where = " where p.products_status = '1' ";

	  if ($this->current_category_id != 0) { // Restrict query to the appropriate category/categories
	    $subcategories_array = array();
	    tep_get_subcategories ($subcategories_array, $this->current_category_id);

	    if (SPECIFICATIONS_FILTER_SUBCATEGORIES == 'True' && count ($subcategories_array) > 0) {
		  $category_ids = $this->current_category_id . ',' . implode (',', $subcategories_array);
		  $raw_query_where .= '   ' . "and p2c.categories_id in (" . $category_ids . ") ";    
	    } else {
		  $raw_query_where .= " and p2c.categories_id = '" . $this->current_category_id . "' ";
	    }
	  } // if ($this->current_category_id

	  $applied_filters = $this->getAppliedFilters();
	  foreach ($applied_filters as $k => $v) {
	    if ($k == $specifications_id) {
		  continue;
	    }
	    $specs_array = $this->getSpecification($k);
	    $raw_query_addon_array = tep_get_filter_sql($specs_array['filter_class'], $specs_array['specifications_id'], $v, $specs_array['products_column_name'], $this->languages_id);
	    $raw_query_from .= $raw_query_addon_array['from'];
	    $raw_query_where .= $raw_query_addon_array['where'];
	  } // foreach($applied_filters

	  if ($specification == '0') { // show_all
	    $raw_query_start = "select 0 as filter, count(p.products_id) as count ";
	    $raw_query_group_by = '';
	  } else {
	    $raw_query_start = "select manufacturers_name as filter, count(p.products_id) as count ";
	    $raw_query_from .= "  join (" . TABLE_MANUFACTURERS . " m)
							  on (p.manufacturers_id = m.manufacturers_id)
							  ";
	    $raw_query_group_by = ' group by manufacturers_name';
	  }

	  $raw_query = $raw_query_start . $raw_query_from . $raw_query_where . $raw_query_group_by;
//print 'Raw Query: ' . $raw_query . '<br>';
	  $filter_count_query = tep_db_query ($raw_query);
	   while ($filter_count_result = tep_db_fetch_array ($filter_count_query)) {
		    $filters_select_array[$filter_index] = array ('id' => $filter_count_result['filter'],
															 'text' => htmlspecialchars($filter_count_result['filter']),
														    'count' => (string) $filter_count_result['count']
														   );
		    $filter_index++;
	  }
	  return $filters_select_array;      
    }


Don't just sit there - contribute to the responsive bootstrap community effort !
http://forums.oscomm...iew__getnewpost


Hava a nice day !
Carine Bruyndoncx


Seen anything good relevant on the net about responsive design for ecommerce ?
You might as well post it in my responsive liive shop review thread .

#630   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,164 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 13 July 2012 - 00:07

I've added caching of the products_filter box, and everything is looking to run quite smoothly now.
The caching is done only on the initial selection of a category.
Now I just need to add some admin code to refresh the cache.
Don't just sit there - contribute to the responsive bootstrap community effort !
http://forums.oscomm...iew__getnewpost


Hava a nice day !
Carine Bruyndoncx


Seen anything good relevant on the net about responsive design for ecommerce ?
You might as well post it in my responsive liive shop review thread .

#631   emcmoda

emcmoda
  • Members
  • 66 posts
  • Real Name:Michal

Posted 23 July 2012 - 13:29

Hi Jim how to make the fiter with size (ROZMIAR) and/or color (KOLOR) the same as
http://answear.com/jeansy-213-k.html

BR
Michal

Edited by emcmoda, 23 July 2012 - 13:30.


#632   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,296 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 23 July 2012 - 20:45

Set up Size and Color specifications for your products. Add the size and color to each product. Set up filters for those specifications that match the size and color information.

All of this is covered in the User's Manual. Read all of it.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price in Cart Only/MAPP Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support
Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#633   JSR

JSR
  • Members
  • 149 posts
  • Real Name:Chanel
  • Gender:Female
  • Location:Planet Earth

Posted 14 August 2012 - 17:53

Hi kymation,

I have a question about values as checkboxes. I added onClick for the checkboxes, but it only passes one value as link data at a time.
I know I probably need to edit the tep_draw_pull_down_menu funtcion in html_output.php but I get stuck trying.
How do I keep the selected value in the link data? I Hope you understand what I'm trying to do here...

#634   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,296 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 14 August 2012 - 17:56

The only way to handle checkboxes is to enclose them in a form and add a submit button. I suppose you could also use AJAX to submit each one in the background, but that would be a lot of extra work for very little benefit.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price in Cart Only/MAPP Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support
Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#635   JSR

JSR
  • Members
  • 149 posts
  • Real Name:Chanel
  • Gender:Female
  • Location:Planet Earth

Posted 16 August 2012 - 16:58

Thanks for the fast reply and insight!
I thought it would be possible to either store the previous selected value in a session or redirecting the page and saving the "get" variables after submission.
By searching the web I found several fora addressing this issue (saving selected checkboxes in php forms after submit).
But my knowledge of php is pretty limited, so guess I'll have to stick with the submit button for now. /wacko.png' class='bbc_emoticon' alt=':wacko:' />

#636   vampirehunter

vampirehunter
  • Members
  • 381 posts
  • Real Name:vampire

Posted 19 September 2012 - 12:01

is it possible to set up checkbox filters like on this website?

http://www.style369....ents=Colour{1}~[green]&noOfRefinements=1

so if you click on muliple specifications to keep narrowing down the products?

#637   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,164 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 19 September 2012 - 19:33

is it possible to set up checkbox filters like on this website?

http://www.style369....ents=Colour{1}~[green]&noOfRefinements=1

so if you click on muliple specifications to keep narrowing down the products?


yes you can
Don't just sit there - contribute to the responsive bootstrap community effort !
http://forums.oscomm...iew__getnewpost


Hava a nice day !
Carine Bruyndoncx


Seen anything good relevant on the net about responsive design for ecommerce ?
You might as well post it in my responsive liive shop review thread .

#638   ken0306

ken0306
  • Members
  • 236 posts
  • Real Name:Ken0306
  • Gender:Male
  • Location:Canada Vancouver

Posted 20 September 2012 - 20:46

Hi, under the current version, I only can see the category images under the product_filters.php right hand side uper corner, how can I change to category name?
thank you

#639   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,296 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 21 September 2012 - 00:24

The category images are part of stock osCommerce. They have nothing to do with the Products Specifications Addon.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price in Cart Only/MAPP Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support
Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#640   ken0306

ken0306
  • Members
  • 236 posts
  • Real Name:Ken0306
  • Gender:Male
  • Location:Canada Vancouver

Posted 21 September 2012 - 19:23

Yes, Jim, I understand that. I want to know if there is way to insert it. Because when people click on the filter, it will direct them to the products_filter.php page, not on the index.php page anymore. So I want to add the category title on the products_filter.php page, and it may looks consistent on the site.
Thank you
Ken