Seite 1 von 1

Export Googlebase mit Herstellerangaben

Verfasst: 24.05.2011, 05:42
von wolfschw
Hallo

Im Adminbereich kann man sich eine Artikelfeed-Datei für Googlebase erstellen lassen.

Gibt es eine möglichkeit die Herstellerangaben von der Artikeldatenbank mit in die Artikelfeed-Datei einzubauen ?

Hier mal ein ausschnitt aus meiner export_googlebase.php

Code: Alles auswählen

 $output.=' <g:bild_url>' . $image_url . $products['products_image] . '</g:bild_url>'."\n"; 
$output.=' <g:id>' . $products['products_id] . '</g:id>'."\n"; 
$output.=' <g:preis>' . $price . '</g:preis>'."\n"; 
$output.=' <g:modellnummer>' . $products['products_model] . '</g:modellnummer>'."\n"; 
$output.=' <g:mpn>' . $products['products_model] . '</g:mpn>'."\n"; 
$output.=' <g:shipping_weight>' . $products['products_weight] . '</g:shipping_weight>'."\n"; 
$output.=' <g:zustand>neu</g:zustand>'."\n"; 
$output.=' <g:manufacturer>' . $products['manufacturers_id] . '</g:manufacturer>'."\n";


In Zeile 8 habe ich es schon versucht, Bringt aber nur die ID-Nummer aus der Hersteller-Datenbank.

Benötige aber den Namen des Herstellers und nicht die ID.

für eine Hilfe wäre ich dankbar

gruß

Wolfgang

Verfasst: 24.05.2011, 11:54
von r23
Hallo,

Code: Alles auswählen

   
   $manufacturerstable = $oostable['manufacturers];
    $query = "SELECT manufacturers_name
              FROM $manufacturerstable
              WHERE m.manufacturers_id = '" . (int)$products['manufacturers_id] . "'";
    $result = $dbconn->Execute($query);
    $manufacturers_name = $result->fields['manufacturers_name];

Die Abfrage ist jetzt nicht getestet - sollte aber funktionieren.

Code: Alles auswählen

   
   $manufacturerstable = $oostable['manufacturers];
    $query = "SELECT manufacturers_name
              FROM $manufacturerstable
              WHERE m.manufacturers_id = '" . (int)$products['manufacturers_id] . "'";
    $result = $dbconn->Execute($query);
    $manufacturers_name = $result->fields['manufacturers_name];

 $output.=' <g:bild_url>' . $image_url . $products['products_image] . '</g:bild_url>'."\n"; 
$output.=' <g:id>' . $products['products_id] . '</g:id>'."\n"; 
$output.=' <g:preis>' . $price . '</g:preis>'."\n"; 
$output.=' <g:modellnummer>' . $products['products_model] . '</g:modellnummer>'."\n"; 
$output.=' <g:mpn>' . $products['products_model] . '</g:mpn>'."\n"; 
$output.=' <g:shipping_weight>' . $products['products_weight] . '</g:shipping_weight>'."\n"; 
$output.=' <g:zustand>neu</g:zustand>'."\n"; 
$output.=' <g:manufacturer>' . $manufacturers_name . '</g:manufacturer>'."\n";


Hoffe, die Antwort hilft weiter

ralf

Verfasst: 24.05.2011, 20:47
von wolfschw
Hallo

es funktioniert leider nicht.

Hier ein auszug aus meiner XML

<title>Kaffeeanschluss braun</title>
<description>Der Kaffeeanschluss sitzt bei der S-Serie auf der Brüheinheit.</description>
<link>http://www.jura-ersatzteile-shop.de/ind ... cts_id=409</link>
<g:bild_url>http://www.jura-ersatzteile-shop.de/ima ... /62157.jpg</g:bild_url>
<g:bild_url>http://www.jura-ersatzteile-shop.de/ima ... /62157.jpg</g:bild_url>
<g:id>409</g:id> <g:preis>2.50</g:preis>
<g:modellnummer>62157</g:modellnummer>
<g:mpn>62157</g:mpn>
<g:shipping_weight>0.00</g:shipping_weight>
<g:zustand>neu</g:zustand>
<g:manufacturer/>
<g:brand>Jura Ersatzteile Shop</g:brand>
<g:product_type>Jura Ersatzteile > Impressa</g:product_type>
<g:zahlungsmethode>Bar</g:zahlungsmethode>
<g:zahlungsmethode>Scheck</g:zahlungsmethode>
<g:zahlungsrichtlinien>Lastschrift und Ueberweisung</g:zahlungsrichtlinien>

Die Zeile manufacturer bleibt leer

Habe die Zeilen so eingefügt

Code: Alles auswählen

 $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:bild_url>' . $image_url . $products['products_image] . '</g:bild_url>'."\n"; 
} 
$output.=' <g:bild_url>' . $image_url . $products['products_image] . '</g:bild_url>'."\n"; 
$output.=' <g:id>' . $products['products_id] . '</g:id>'."\n"; 
$output.=' <g:preis>' . $price . '</g:preis>'."\n"; 
$output.=' <g:modellnummer>' . $products['products_model] . '</g:modellnummer>'."\n"; 
$output.=' <g:mpn>' . $products['products_model] . '</g:mpn>'."\n"; 
$output.=' <g:shipping_weight>' . $products['products_weight] . '</g:shipping_weight>'."\n"; 
$output.=' <g:zustand>neu</g:zustand>'."\n"; 
$manufacturerstable = $oostable['manufacturers]; 
$query = "SELECT manufacturers_name 
FROM $manufacturerstable 
WHERE m.manufacturers_id = '" . (int)$products['manufacturers_id] . "'"; 
$result = $dbconn->Execute($query); 
$manufacturers_name = $result->fields['manufacturers_name]; 
$output.=' <g:manufacturer>' . $manufacturers_name . '</g:manufacturer>'."\n"; 
$output.=' <g:brand>Jura Ersatzteile Shop</g:brand>'."\n"; 
$output.=' <g:product_type>Jura Ersatzteile > Impressa</g:product_type>'."\n"; 
foreach($payment_accepted as $key=>$value){ 
$output.=' <g:zahlungsmethode>' . $value . '</g:zahlungsmethode>'."\n"; 
} 
$output.=' <g:zahlungsrichtlinien>Lastschrift und Ueberweisung</g:zahlungsrichtlinien>'."\n"; 
$output.=' <g:shipping> 
<g:country>DE</g:country> 
<g:service>Standardversand DPD</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

Verfasst: 24.05.2011, 23:53
von r23
[quote='wolfschw','index.php?page=Thread&postID=2201#post2201]

Code: Alles auswählen

<g:manufacturer/>
[/quote]

Die Zeile ist merkwürdig und passt nicht zum Quellcode...


[mysql]WHERE m.manufacturers_id = '" . (int)$products['manufacturers_id] . "'"; [/mysql]

sorry ... das m. ist falsch

Code: Alles auswählen

$manufacturerstable = $oostable['manufacturers]; 
$query = "SELECT manufacturers_name 
FROM $manufacturerstable 
WHERE manufacturers_id = '" . (int)$products['manufacturers_id] . "'"; 
$result = $dbconn->Execute($query); 
$manufacturers_name = $result->fields['manufacturers_name];

ich hoffe es stimmt jetzt... leider noch immer nicht geprüft

ralf

Verfasst: 25.05.2011, 06:20
von wolfschw
Hallo

Es geht leider immer noch nicht.

Die Zeile manufacturer bleibt leer.

gruß

Wolfgang

Verfasst: 25.05.2011, 15:13
von r23
Hallo,

kann man Fehler in der Datenbankabfrage ausschließen? D.h. was schreibt der Layer in seine Log-Datei?
~/oos_temp/logs/adodb_log.*

funktioniert der inhalt von $query
[mysql]SELECT manufacturers_name FROM die_shop_manufacturerstable WHERE manufacturers_id = 254[/mysql]

in PHPmyAdmin?

was kommt als Ergebnis? Irgendwas mit Sonderzeichen oder Umlauten? Muss es in UTF-8 konvertiert werden?
Oder ist in der Abfrage ein weitere Fehler? Wie muss die Abfrage dann richtig lauten?

Die Zeile kann leer sein, wenn kein Hersteller hinterlegt ist...

Beste Grüße

ralf

Verfasst: 25.05.2011, 17:48
von wolfschw
Hallo

~/oos_temp/logs/adodb_log.*
schreibt nix.

Die xml Datei mit der Zeile <g:manufacturer/> bleibt leer.

Ausschnitt aus der erstellten xml Datei

<g:shipping_weight>0.00</g:shipping_weight>
<g:condition>neu</g:condition>
<g:manufacturer/> <--- mehr kommt da nicht
<g:brand>Jura Ersatzteile Shop</g:brand>
<g:product_type>Jura Ersatzteile > Impressa</g:product_type>

Hersteller sind hinterlegt.

Was ist mit diesen Zeilen ?

Code: Alles auswählen

 $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) . "'";


Wenn ich Zeile 1 noch erweitere um manufacturers_id, und in der ausgabe manufacturers_id schreibe

Code: Alles auswählen

$output.=' <g:manufacturer>' . $manufacturers_id . '</g:manufacturer>'."\n";


bringt er mir den Hersteller Nummer, aber nicht den Namen.

gruß

Wolfgang

Verfasst: 25.05.2011, 18:15
von r23
Hallo,

[quote='wolfschw','index.php?page=Thread&postID=2205#post2205]
<g:shipping_weight>0.00</g:shipping_weight>
<g:condition>neu</g:condition>
<g:manufacturer/> <--- mehr kommt da nicht
[/quote]

Wenn das Script so aussieht

Code: Alles auswählen

$output.=' <g:manufacturer>' . $manufacturers_id . '</g:manufacturer>'."\n";


kann das Ergebnis nicht
<g:manufacturer/>

sein - sondern muss / sollte
<g:manufacturer></g:manufacturer>
sein - wenn $manufacturers_id leer ist.

<g:manufacturer/>
gibt es in dem Script nicht

Falsches Script? Falsche Stelle?

Nach der Datenbankfabrage sollte die manufacturers_id in dem array sein $products['manufacturers_id]

Wenn die ID von dem Hersteller bekannt ist, kann man die Datenbankabfrage erstellen, dass man den Namen erhält.

cu

ralf

Verfasst: 25.05.2011, 19:41
von wolfschw
ok

Ich gebs auf

Verfasst: 25.05.2011, 19:48
von r23
Hallo,

welche Datei wurde in welcher Zeile bearbeitet?

Gruß

ralf

Verfasst: 25.05.2011, 21:03
von wolfschw
Hallo

Dies ist meine export_googlebase.txt

und das kommt dabei raus artikel_feed.txt

gruß

Wolfgang