Page: | 1 |
Topic:

no displey <PRICE_VAT></PRICE_VAT> to generate xml feed

freebee
See profile of: freebee
2012-01-17 22:08:00
Votes: 0
Vote answer in plus Vote answer in minus
Hi, i have a problem with generate xml feed. I have empty tag <PRICE_VAT></PRICE_VAT>. I used script:
$txt .= "<SHOPITEM>"."\n";
$txt .= "<PRODUCT>$sName</PRODUCT>"."\n";
$txt .= "<DESCRIPTION>$sDescriptionShort</DESCRIPTION>"."\n";
$txt .= "<URL>$myFinalURL</URL>"."\n";
$txt .= "<IMGURL>$myFinalURLIMG</IMGURL>"."\n";
$txt .= "<PRICE_VAT>$mPrice</PRICE_VAT>"."\n";
$txt .= "<ITEM_TYPE>new</ITEM_TYPE>"."\n";
$txt .= "<AVAILABILITY>0</AVAILABILITY>"."\n";
$txt .= "</SHOPITEM>"."\n";
}
$i++;

Thanks fot advice

David

  » Quick.Cart v4.x

-------------------------------------------------------
DAvid
treewood
OpenSolution
See profile of: treewood
2012-01-18 18:21:09
Votes: 0
Vote answer in plus Vote answer in minus
freebee - give more information ... what is that plugin that export data to xml etc?
freebee
See profile of: freebee
2012-01-18 22:10:48
Votes: 0
Vote answer in plus Vote answer in minus
Hi, i dont use any plugin - i generate it by only php skript:


<?php
$myURL         
=     "http://eshop.eko-light.cz/"// je treba zmenit na Vasi adresu
$file          =     file("./db/cz_products.php");
$fileIMG       =     file("./db/cz_products_files.php");
$myURLIMG        =      "".$myURL."files/";

function 
change2Latin$sContent ){
  return 
str_replace(
    Array( 
'¶''±''¼''¿''ê''³''ó''æ''ñ''¦''¡''¬''¯''Ê''£''Ó''Æ''Ñ''á''è''ï''é''ì''í''ò''ø''±''»''ú''ù''ý''¾''Á''È''Ï''É''Ì''Í''Ò''Ø''©''«''Ú''Ù''Ý''®''ä''µ''å''à''Ä''¡''Å''À''ö''ü''ß''Ö''Ü' ),
    Array( 
's''a''z''z''e''l''o''c''n''S''A''Z''Z''E''L''O''C''N''a''c''d''e''e''i''n''r''s''t''u''u''y''z''A''C''D''E''E''I''N''R''S''T''U''U''Y''Z''a''l''l''r''A''L''L''R''o''u''S''O''U' ),
    
$sContent
  
);
// end function change2Latin

function change2Url$sContent ){
  return 
strtolowerchange2Latinstr_replace
    Array( 
' ''&raquo;''/''$''\'', '"', '~', '\\', '?', '#', '%', '+', '^', '*', '>', '<', '@', '|', '"', '%', ':', '&', ',', '=', '--', '--', '[', ']', '&#955;', '´', ' ' ),
    
Array( '-''',        '-''-''',   '',  '-''-',  '-''-''-''-''-''-''-''-''-''-''-',      '-''-''',  '-''-''-',  '-''('')''''-''' ),
    
trim$sContent )
  ) ) );
// end function change2Url

function trimTags($input$validTags '')
{
    
$regex '#\s*<(/?\w+)\s+(?:on\w+\s*=\s*(["\'\s])?.+?
\(\
1?.+?\1?\);?\1?|style=["\'].+?["\'])\s*>#is';
    return 
preg_replace($regex'<${1}>',strip_tags($input$validTags));


$txt "<?xml version=\"1.0\" encoding=\"utf-8\"?>"."\n";
$txt .= "<shop>"."\n";

$i=0;
foreach(
$fileIMG as $dataIMG) {
    
$temp                  explode("$",$dataIMG);
    
$ImgID[i]              = $temp[1];
    
$ImgName[$ImgID[i]]    = $temp[2];
    
$i++;
}

$i=0;
foreach(
$file as $data) {
   list(
$iPosition$sName$sPrice$sAvailable$iProduct$iStatus$sDescriptionShort) = explode("$",$data);
    if (
$i>0) {        
        
//kompletace adresy, pri vyuziti mod-rewrite
        //staci odstranit ty dve zavorky o radek nize
        //$myFinalURL        =    $myURL.$iPosition.",".change2Url( $sName ).".html";
        //adresa, bez modu
       
$myFinalURL        =    $myURL."?".$iPosition.",".change2Url$sName );
        
$myFinalURLIMG     =    $myURLIMG.$ImgName[$iPosition];
       

        
//uprava popisu        
        
$sDescriptionShort str_replace("|n|"" "$sDescriptionShort);
        
$sDescriptionShort trimTags($sDescriptionShort);
          
$txt .=    "<SHOPITEM>"."\n";    
                
$txt .=    "<PRODUCT>$sName</PRODUCT>"."\n";
                
$txt .=    "<DESCRIPTION>$sDescriptionShort</DESCRIPTION>"."\n";
                
$txt .=    "<URL>$myFinalURL</URL>"."\n";
                
$txt .=    "<IMGURL>$myFinalURLIMG</IMGURL>"."\n";
                
$txt .=    "<PRICE_VAT>$sPrice</PRICE_VAT>"."\n";
                
$txt .=    "<ITEM_TYPE>new</ITEM_TYPE>"."\n";
                
$txt .=    "<AVAILABILITY>0</AVAILABILITY>"."\n";
          
$txt .=    "</SHOPITEM>"."\n";
    }
    
$i++;       
};

$txt .=    "</shop>"."\n";

//vypis hodnot
echo $txt;
?>


Thanks
DAvid

-------------------------------------------------------
DAvid
freebee
See profile of: freebee
2012-01-22 11:18:02
Votes: 0
Vote answer in plus Vote answer in minus
problem is solved..i used: $aData[sPrice] and work correctly

-------------------------------------------------------
DAvid
Page: | 1 |
 


If You want to do this operation, please log in first ».
If You don't have an account please register ».
Valid XHTML 1.0! Valid CSS! version: 2.2.0-alfa | powered by Quick.Forum