Jump to content


Corporate Sponsors


Latest News: (loading..)

sanam

Member Since 12 Oct 2004
Offline Last Active Jan 31 2012, 21:35
-----

Posts I've Made

In Topic: [Contribution] Products Specifications

26 January 2012, 20:44

Man your fast, thanks for the update.

It seems that most of my filters are same as my values so i have added a new option on "Specifications in Group" option page. It will added new button for copying values for selected specification as filters for that specification. Before adding all the existing filters for that specification will be deleted. It can be easily modified so only missing values are added, not attamped yet.

All modifications are in attached text file.Attached File  copy_values_to_filters.txt   6.66K   1 downloads

As usual i would wait for kymations approval or update. Thanks

In Topic: [Contribution] Products Specifications

26 January 2012, 19:23

Hello Kymation, thanks for updating this contirbution. Been away for while so was just catching up and found one issue. Its with the release 1_1_11.
1) I read somewhere in the forum that functions/products_specifications.php lines around 776

Quote

$link_array = tep_get_link_data( $columns_array['products_id'] );
$cPath_new = $link_array['cPath'];
$category_name = $link_array['categories_name'];

$parameters = 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'];
$product_link = tep_href_link( FILENAME_PRODUCT_INFO, $parameters, 'NONSSL', true, true, $category_name, $columns_array['products_name'] );

needs to be changed with

Quote

$cPath_new = tep_get_product_path( $columns_array['products_id'] );
$product_link = tep_href_link( FILENAME_PRODUCT_INFO, 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'] );

if this still holds true than it needs to be changed in the uploaded.

2) I am using "/" in my filters and its removed from querystring and someone had mentioned they where also having similar issue with different character and option was to use filter id. I did some changes to tep_clean_get__recursive and get it working.

Only works for PHP Version 5.2.0 or greater

/inlcudes/functions/products_specifications.php

change

if( !function_exists( 'tep_clean_get__recursive' ) ) {
	function tep_clean_get__recursive ($get_var) {
	  if (!is_array($get_var)) {
		return preg_replace("/[^ {}a-zA-Z0-9_.-]/i", "", urldecode($get_var));
	  }

	  // Add the preg_replace to every element.
	  return array_map ('tep_clean_get__recursive', $get_var);
	} // function tep_clean_get__recursive
  } // if( !function_exists


TO
if( !function_exists( 'tep_clean_get__recursive' ) ) {
	function tep_clean_get__recursive ($get_var) {
	if ( @phpversion() >= "5.2.0" ){ // filter_var only available from this distribution
	  if (!is_array($get_var)) {
	   // return preg_replace("/[^ {}a-zA-Z0-9_.-]/i", "", urldecode($get_var));
	   //FILTER_FLAG_STRIP_LOW = HTML-escape '"<>& and characters with ASCII value less than 32, optionally strip or encode other special characters
	   $get_var= filter_var($get_var, FILTER_SANITIZE_STRING);// remove any invalid or not allowd string, like <script> or <strong>
	   $get_var= filter_var($get_var, FILTER_SANITIZE_URL); //Remove all characters except letters, digits and $-_.+!*'(),{}|\\^~[]`<>#%";/?:@&=.
		$get_var= filter_var($get_var, FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_LOW);//Strips characters that has a numerical value <32
		$get_var= filter_var($get_var, FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_HIGH);//Strips characters that has a numerical value >127
	   return $get_var;
	  }
	 }else{
		 if (!is_array($get_var)) {
			return preg_replace("/[^ {}a-zA-Z0-9_.-]/i", "", urldecode($get_var));
		  }
	 }
	  // Add the preg_replace to every element.
	  return array_map ('tep_clean_get__recursive', $get_var);
	} // function tep_clean_get__recursive
  } // if( !function_exists

I have tested it and for the scope of this contribution it works, but if someone can test it and confirm if it works as stated.