Jump to content

Vixus

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Vixus

  1. Hi, I received a task to insert one more condition into filtering proces of this script. Since i am not coder i really need help on this. here is a piece of a bit larger script that i think is handling filtering proces: if($next_conds){ foreach($next_conds as $next_cond){ if($next_cond['type']=='SKIP' ){ if($compare_features){ foreach($compare_features as $compare_feature){ if(!empty($compare_features2) && $next_cond['feature2']){ foreach($compare_features2 as $compare_feature2){ if($next_cond['feature'] == $compare_feature['id_feature'] && $next_cond['feature2'] == $compare_feature2['id_feature']){ $json['js'] = array('type'=>'SKIP','pop_text'=>Pcconfig::translate($next_cond['pop_text'])); } } }else{ if($next_cond['feature'] == $compare_feature['id_feature']){ $json['js'] = array('type'=>'SKIP','pop_text'=>Pcconfig::translate($next_cond['pop_text'])); } } } } } if($next_cond['type']=='PREFER'){ foreach($a_products as $a_product){ $current_features = $a_product['features']; if($current_features){ foreach($current_features as $c_feature){ if($compare_features){ foreach($compare_features as $compare_feature){ if(!empty($compare_features2) && $next_cond['feature2']){ foreach($compare_features2 as $compare_feature2){ if($compare_feature['id_feature'] == $c_feature['id_feature'] && $next_cond['feature'] == $compare_feature['id_feature'] && $next_cond['feature2'] == $compare_feature2['id_feature']){ $product_quantity[$a_product['id_product']] = $next_cond['yes_value']; } } }else{ if($compare_feature['id_feature'] == $c_feature['id_feature'] && $next_cond['feature'] == $compare_feature['id_feature']){ $product_quantity[$a_product['id_product']] = $next_cond['yes_value']; } } } } } } } } if($next_cond['type']=='SUM'){ $watt = 0; foreach($selected as $selectkey => $selectp){ if($selectp>0){ $selectprod = new Product($selectp); $selectprod_features =$selectprod->getFeatures(); if($selectprod_features){ foreach($selectprod_features as $s_feature){ if($s_feature['id_feature'] == $next_cond['feature']){ $f_values = FeatureValue::getFeatureValueLang($s_feature['id_feature_value']); if($f_values){ foreach($f_values as $f_value){ if($f_value['id_lang'] == $cookie->id_lang){ $watt = $watt + $f_value['value']*$selected_quan[$selectkey]; } } } } } } } } $af_products = $a_products; $a_products = array(); foreach($af_products as $af_key => $af_product){ $current_features = $af_product['features']; if($current_features){ foreach($current_features as $c_feature){ if($c_feature['id_feature'] == $next_cond['feature'] && $c_feature['value'] < $watt){ unset($af_products[$af_key]); } } } } $a_products = my_array_unique($af_products); } } } Now part of filtering that is called "PREFER" has certain "yes_value" I must insert a code in case if this yes_value == 0 so that product wich meet this yes_value gets ignored. Anyone care to help me on this one? (Do i need to paste entire script or is this enough?) Thank you in advance! V
  2. Hi i need some help with formating content in dropdown selectbox. It consists of 2 parts, product and price. I would like to allign product to the left (set truncate) and to allign price to the right and to fill up the empty space with dots, so that it looks like this: |Product xyz.................100$| |Product abcdef.........1.100$| |Product Q......................20$| Can anyone help me how to create that?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.