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

freebee

Avatar: freebee

2012-01-17 22:08

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)

Avatar: treewood

2012-01-18 18:21

freebee - give more information ... what is that plugin that export data to xml etc?

freebee

Avatar: freebee

2012-01-18 22:10

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

Avatar: freebee

2012-01-22 11:18

problem is solved..i used: $aData[sPrice] and work correctly

DAvid

Back to top
about us | contact