Seite 1 von 1

export googlebase.php

Verfasst: 18.05.2012, 07:26
von wolfschw
Hallo

Ich benutze die Datei im Adminbereich export_googlbase.php
Habe mir die Datei auch entsprechend angepasst.
Mit einer Zeile in der Datei export_googlebase.php habe ich aber noch ein Problem

Code: Alles auswählen

 $output.=' <g:brand>' . $manufacturers['manufacturers_name] . '</g:brand>'."\n";


Bekomme den Herstellernamen nicht angezeigt

diese Zeile wird dann in der xml Datei leer ausgegeben

Code: Alles auswählen

 <g:brand></g:brand>


Über eine kleine Hilfe wäre ich danbar

gruß

Wolfgang

Verfasst: 21.05.2012, 23:54
von r23
Hallo,

mit der Produkt-Abfrage muss der Herstellername abgefragt werden.

Wie Sie die Datenbankabfrage aus?

Code: Alles auswählen

$productstable = $oostable['products];
$products_descriptiontable = $oostable['products_description];
$manufacturerstable = $oostable['manufacturers];
$specialstable = $oostable['specials];
 $query = "SELECT p.products_id, pd.products_name, pd.products_description, p.products_image,
                              p.products_model, p.products_price, p.products_tax_class_id,
                              IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,
                             p.products_date_added, m.manufacturers_name
                     FROM $productstable p LEFT JOIN
                               $specialstable s on p.products_id = s.products_id,
                               $products_descriptiontable pd,
                               $manufacturerstable m
                     WHERE p.products_status >= '1' AND
                           p.manufacturers_id = m.manufacturers_id AND
                           pd.products_languages_id = '" . intval($languages_id) . "' AND
                     ORDER BY pd.products_name, p.products_date_added DESC";
Grob - sehr grob - und nicht geprüft nur für die Richtung

Beste Grüeß

ralf

Verfasst: 22.05.2012, 21:53
von wolfschw
Hallo

Bekomme es mit dem Hersteller nicht hin.

Dies ist ein teil aus meiner google_export.php

Code: Alles auswählen

 $productstable = $oostable['products]; 
$products_descriptiontable = $oostable['products_description]; 
$sql = "SELECT p.products_id, p.products_model, p.products_image, p.products_price, p.products_weight, 
p.products_tax_class_id, p.products_quantity, pd.products_name, pd.products_description 
FROM $productstable p, 
$products_descriptiontable pd 
WHERE p.products_id = pd.products_id 
AND p.products_status >= '1' 
AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; 
$products_result = $dbconn->SelectLimit($sql, $limit_step, $limit); 
$count = $products_result->RecordCount(); 
if ($count > 0) { 
while ($products = $products_result->fields) { 
if ($specialprice = oos_get_products_special_price($products['products_id])){ 
$price = $specialprice; 
} else { 
$price = $products['products_price]; 
} 
if ( $price > 0) { 
$tax = (100+oos_get_tax_rate($products['products_tax_class_id]))/100; 
$price = number_format($price*$tax,2,".",""); 
$products_description = $products['products_description]; 
$products_description = strip_tags($products_description); 
$products_description = utf8_encode($products_description); 

$output.=' <item>'."\n"; 
$output.=' <title>' . xmlentities(utf8_encode(strip_tags($products['products_name]))) . '</title>'."\n"; 
$output.=' <description>' . xmlentities($products_description) . '</description>'."\n"; 
$output.=' <link>' . xmlentities($product_url . $products['products_id]) . '</link>'."\n"; 
if ($products['products_image] != '') { 
$output.=' <g:image_link>' . $image_url . $products['products_image] . '</g:image_link>'."\n"; 
} 
$output.=' <g:image_link>' . $image_url . $products['products_image] . '</g:image_link>'."\n"; 
$output.=' <g:id>' . $products['products_id] . '</g:id>'."\n"; 
$output.=' <g:price>' . $price . '</g:price>'."\n"; 
$output.=' <g:modellnummer>' . $products['products_model] . '</g:modellnummer>'."\n"; 
$output.=' <g:mpn>' . $products['products_model] . '</g:mpn>'."\n"; 
$output.=' <g:condition>neu</g:condition>'."\n"; 
$output.=' <g:availability>auf lager</g:availability>'."\n"; 
$output.=' <g:brand>' . $manufacturers['manufacturers_name] . '</g:brand>'."\n"; 
$output.=' <g:product_type>Jura Ersatzteile & Saeco Ersatzteile & Kaffeemaschinen & Kaffee</g:product_type>'."\n"; 
foreach($payment_accepted as $key=>$value){ 
$output.=' <g:zahlungsmethode>' . $value . '</g:zahlungsmethode>'."\n"; 
} 
$output.=' <g:shipping> 
<g:country>DE</g:country> 
<g:service>Standard</g:service> 
<g:price>4.20</g:price> 
</g:shipping>'."\n"; 
$output.=' <g:standort>'.xmlentities($location_address).'</g:standort>'."\n"; 
$output.=' </item>'."\n";


gruß

Wolfgang