'; $arVOps = Array('SET','WEIGHT','USED','RESTORED','NORETURN','DAMAGED','COPY','HOT','PRICE_ID','PERCENTGIVE','MINIMUM','LITERS'); foreach($arVOps as $VOp){ if($TDMCore->arSettings['OPTION_'.$VOp] OR defined('TDM_ADMIN_SIDE')){ if($arOpts[$VOp]>0){ $arOpts[$VOp.'_VIEW'] = TDMOptionView($VOp,$arOpts[$VOp]); $arOpts['VIEW'] .= $arOpts[$VOp.'_VIEW']; $arOpts['VIEW_INTAB'].=''.$arOpts[$VOp.'_VIEW'].''; } } } $arOpts['VIEW_INTAB'] .= ''; return $arOpts; } // function TDMOptionView($CODE,$VALUE,$NAME=''){ $CODE=str_replace('*','',$CODE); $arCodeOps = Array('SET','WEIGHT','USED','RESTORED','NORETURN','DAMAGED','COPY','HOT','PRICE_ID','PERCENTGIVE','MINIMUM','LITERS'); if(in_array($CODE,$arCodeOps)){ if($CODE=='USED'){if($NAME!=''){$Text=$NAME;}else{$Text=Lng('PRICE_OPTION_'.$CODE,1,false);}} elseif($CODE=='SET'){if($NAME!=''){$arSt=explode('(',$NAME); $Text=$VALUE.' ('.$arSt[1];}else{$Text=$VALUE.' '.Lng('Pcs',0,false);}} elseif($CODE=='WEIGHT'){ if($VALUE>100){$Text=round($VALUE/1000,2).Lng('Kg',1,false);}else{$Text=$VALUE.Lng('Gr',1,false);} } elseif($CODE=='PERCENTGIVE'){$Text=$VALUE.'%';} elseif($CODE=='MINIMUM'){$Text='min.'.$VALUE;} elseif($CODE=='LITERS'){$Text=$VALUE.Lng('L.',0,false);} if($NAME!=''){$Title=$NAME;}else{$Title=Lng('PRICE_OPTION_'.$CODE,1,0);} return '
'.$Text.'
'; } return false; } // function TDMPerocessAddToCart($arALLPRICES,$arPARTS){ if(isset($_POST['PHID']) AND strlen($_POST['PHID'])==32){ foreach($arALLPRICES as $PKEY=>$arPrcs){ foreach($arPrcs as $arPrice){ if($arPrice['PHID']==$_POST['PHID']){ global $TDMCore; $arPart = $arPARTS[$arPrice['BKEY'].$arPrice['AKEY']]; unset($arPrice['INFO']); unset($arPrice['EDIT_LINK']); if($arPrice['ALT_NAME']==''){$arPrice['NAME'] = $arPart['NAME'];}else{$arPrice['NAME']=$arPrice['ALT_NAME'];} unset($arPrice['ALT_NAME']); $arPrice['AID'] = $arPart['AID']; $arPrice['IMG_SRC'] = $arPart['IMG_SRC']; $arPrice['SRC_PRICE'] = $arPrice['SRC']; $arPrice['ADD_URL']=$_SERVER['REQUEST_URI']; $TDM_DETAIL_FURL = str_replace('BRAND',$arPrice['BKEY'],TDM_DETAIL_FURL); $TDM_DETAIL_FURL = str_replace('ARTICLE',$arPrice['AKEY'],$TDM_DETAIL_FURL); $arPrice['DETAIL_URL']='/'.TDM_ROOT_DIR.'/'.TDM_PRODUCT_FURL.$TDM_DETAIL_FURL; $arPrice['DATE_FORMATED']=date('j.n.y',intval($arPrice['DATE'])); //G:i $arPrice['CPID'] = substr(filter_var($arPrice['PHID'], FILTER_SANITIZE_NUMBER_INT),0,9); $arPrice['TYPE_NAME'] = $TDMCore->arPriceType[$arPrice['TYPE']]; if($arPrice['STOCK']!=''){$arPrice['SUPPLIER_STOCK']=$arPrice['SUPPLIER'].' ('.$arPrice['STOCK'].')';}else{$arPrice['SUPPLIER_STOCK']=$arPrice['SUPPLIER'];} foreach($arPrice['OPTIONS'] as $OpName=>$OpValue){ if($OpName!='VIEW' AND strpos($OpName,'_')<=0){ if($OpValue=='' OR $OpValue=='0'){unset($arPrice['OPTIONS'][$OpName]); continue;} $arPrice['OPTIONS_NAMES'][$OpName] = Lng('PRICE_OPTION_'.$OpName,1,0); continue; } unset($arPrice['OPTIONS'][$OpName]); } define('TDM_ADD_TO_CART',true); global $arCartPrice; $arCartPrice=$arPrice; return $arPrice['PHID']; } } } }elseif(isset($_POST['TDORDER']) AND strlen($_POST['TDORDER'])>3){ foreach($arPARTS as $PKEY=>$arPart){ if($_POST['TDORDER']==$PKEY){ global $TDMCore; $arPrice = Array(); $arPrice['BKEY'] = $arPart['BKEY']; $arPrice['AKEY'] = $arPart['AKEY']; $arPrice['PRICE'] = 0; $arPrice['CURRENCY'] = TDM_CUR; $arPrice['PRICE_CONVERTED'] = 0; $arPrice['CURRENCY_CONVERTED'] = TDM_CUR; $arPrice['NAME'] = $arPart['NAME']; $arPrice['ARTICLE'] = $arPart['ARTICLE']; $arPrice['BRAND'] = $arPart['BRAND']; $arPrice['AID'] = $arPart['AID']; $arPrice['IMG_SRC'] = $arPart['IMG_SRC']; $arPrice['ADD_URL']=$_SERVER['REQUEST_URI']; $TDM_DETAIL_FURL = str_replace('BRAND',$arPrice['BKEY'],TDM_DETAIL_FURL); $TDM_DETAIL_FURL = str_replace('ARTICLE',$arPrice['AKEY'],$TDM_DETAIL_FURL);