Jump to content

Help me. Necessary to remove the numbers in features modules blocklayered


Recommended Posts

Creating features with numbers in start (front), then to sort the data as I want. Example 1015.Country 1013.Manufacturer.

 

In the derivation to the product's numbers were removed by adding this piece of code in

 

/ Classes / product.php

 

It

   {
    if (! array_key_exists ($ id_product. '-'. $ id_lang, self :: $ _frontFeaturesCache))
    {
	    self :: $ _frontFeaturesCache [$ id_product. '-'. $ id_lang] = Db :: getInstance (_PS_USE_SQL_SLAVE_) -> ExecuteS ('
	    SELECT name, value, pf.id_feature
	    FROM '. _DB_PREFIX_.' Feature_product pf
	    LEFT JOIN '. _DB_PREFIX_.' Feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '. (Int) $ id_lang.')
	    LEFT JOIN '. _DB_PREFIX_.' Feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '. (Int) $ id_lang.')
	    WHERE pf.id_product = '. (Int) $ id_product);
    }
    return self :: $ _frontFeaturesCache [$ id_product. '-'. $ id_lang];
   }

 

 

Me on it

 

public static function getFrontFeaturesStatic ($ id_lang, $ id_product)
   {
  if (! array_key_exists ($ id_product. '-'. $ id_lang, self :: $ _frontFeaturesCache))
  {
    self :: $ _frontFeaturesCache [$ id_product. '-'. $ id_lang] = Db :: getInstance (_PS_USE_SQL_SLAVE_) -> ExecuteS ('
    SELECT name, value, pf.id_feature
    FROM '. _DB_PREFIX_.' Feature_product pf
    LEFT JOIN '. _DB_PREFIX_.' Feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '. (Int) $ id_lang.')
    LEFT JOIN '. _DB_PREFIX_.' Feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '. (Int) $ id_lang.')
    WHERE pf.id_product = '. Intval ($ id_product).' ORDER BY `name` ASC ');
  }
    $ ResultsArray = array ();
			  foreach (self :: $ _frontFeaturesCache [$ id_product. '-'. $ id_lang] AS $ row)
			  {
				  $ Row ['name'] = preg_replace ('/ ^ [0-9] + \. /','', $ Row ['name']);
				  $ ResultsArray [] = $ row;
			  }
			  return $ resultsArray;
   }

 

And the features of the numbers invisible

 

And now the question, including filters (module blocklayered)

 

And the derivation of features, they are listed with numbers, how to get rid do not know, a week and all the tormented i dont know.

 

Help me.

Edited by gsv1982 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...