#1 (permalink)  
Alt 16.10.2005, 16:36
Benutzerbild von datapoint  
Registriert seit: 28.07.2005
Beiträge: 5
Standard

Hallo miteinander. Hab mal ein Modul probiert, in dem man die Hersteller gegen Kategorien austauschen kann. Das geht in den Zeilen von 113 bis 120.
In der Zeile 191 den bei froogle angemeldeten Dateinamen einf?gen.
Hat jemand einen Plan, wie nach dem Austausch der Hersteller noch die Tabelle sortiert werden kann? Es w?re doch nicht schlecht, die Kategorien bei froogle etwas sortiert zu bekommen. Bei mir funktioniert das Hochladen zu froogle ohne Probleme und Fehlermeldungen, nur musste ich die Installation im Admin 2x machen. Gr?nde unbekannt.

<?php
/* -----------------------------------------------------------------------------------------
$Id: eigene.php,v 1.1 2004/03/01 08:03:06 fanta2k Exp $

XT-Commerce - community made shopping
http://www.xt-commerce.com

Copyright &copy; 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
&copy; 2000-2001 The Exchange Project (earlier name of osCommerce)
&copy; 2002-2003 osCommerce(cod.php,v 1.28 2003/02/14); www.oscommerce.com
&copy; 2003 nextcommerce (invoice.php,v 1.6 2003/08/24); www.nextcommerce.org

Released under the GNU General Public License
---------------------------------------------------------------------------------------*/


define('MODULE_EIGENE_TEXT_DESCRIPTION', 'Export - eigene.de (TAB getr.)
Format:
product_url;name;description;image_url;category;pr ice');
define('MODULE_EIGENE_TEXT_TITLE', 'eigene.de - txt');
define('MODULE_EIGENE_FILE_TITLE' , '<hr noshade>Dateiname');
define('MODULE_EIGENE_FILE_DESC' , 'Geben Sie einen Dateinamen ein, falls die Exportadatei am Server gespeichert werden soll.
(Verzeichnis export/)');
define('MODULE_EIGENE_STATUS_DESC','Modulstatus');
define('MODULE_EIGENE_STATUS_TITLE','Status');
define('MODULE_EIGENE_CURRENCY_TITLE','W?hrung');
define('MODULE_EIGENE_CURRENCY_DESC','Welche W?hrung soll exportiert werden?');
define('EXPORT_YES','Nur Herunterladen');
define('EXPORT_NO','Am Server Speichern');
define('CURRENCY','<hr noshade>W?hrung:');
define('CURRENCY_DESC','W?hrung in der Exportdatei');
define('EXPORT','Bitte den Sicherungsprozess AUF KEINEN FALL unterbrechen. Dieser kann einige Zeit dauern.');
define('EXPORT_TYPE','<hr noshade>Speicherart:');
define('EXPORT_STATUS_TYPE','<hr noshade>Kundengruppe:');
define('EXPORT_STATUS','Bitte w?hlen Sie die Kundengruppe, die Basis f?r den Exportierten Preis bildet. (Falls Sie keine Kundengruppenpreise haben, w?hlen Sie Gast):[/b]');

// include needed functions


class eigene {
var $code, $title, $description, $enabled;


function eigene() {
global $order;

$this->code = 'eigene';
$this->title = MODULE_EIGENE_TEXT_TITLE;
$this->description = MODULE_EIGENE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_EIGENE_SORT_ORDER;
$this->enabled = ((MODULE_EIGENE_STATUS == 'True') ? true : false);

}


function process($file) {

@xtc_set_time_limit(0);
$schema =
product_url ."\t".
name ."\t".
description ."\t".
image_url ."\t".
category ."\t".
price . "\n";

$export_query =xtc_db_query("SELECT
p.products_id,
pd.products_name,
pd.products_description,
p.products_model,
p.products_shippingtime,
p.products_image,
p.products_price,
p.products_status,
p.products_discount_allowed,
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
" . TABLE_PRODUCTS . " p LEFT JOIN
" . TABLE_MANUFACTURERS . " m
ON p.manufacturers_id = m.manufacturers_id LEFT JOIN
" . TABLE_PRODUCTS_DESCRIPTION . " pd
ON p.products_id = pd.products_id AND
pd.language_id = '".$_SESSION['languages_id']."' LEFT JOIN
" . TABLE_SPECIALS . " s
ON p.products_id = s.products_id
WHERE
p.products_status = 1
ORDER BY
p.products_date_added DESC,
pd.products_name");


while ($products = xtc_db_fetch_array($export_query)) {


$products_price = xtc_get_products_price_export($products['products_id'],1,true,$_POST['status'],1,$_POST['currencies'],true);

// remove trash
$products_description = strip_tags($products['products_description']);
$products_description = substr($products_description, 0, 197) . '..';
$products_description = str_replace(";",", ",$products_description);
$products_description = str_replace("'",", ",$products_description);
$products_description = str_replace("\n"," ",$products_description);
$products_description = str_replace("\r"," ",$products_description);
$products_description = str_replace("\t"," ",$products_description);
$products_description = str_replace("\v"," ",$products_description);
$products_description = str_replace("&quot,"," \"",$products_description);
$products_description = str_replace("&qout,"," \"",$products_description);

//Austausch der Firmennamen in Kategorieen
$products['manufacturers_name'] = str_replace("Hersteller1","Kategorie1",$products['manufacturers_name']);
$products['manufacturers_name'] = str_replace("Hersteller2","Kategorie1",$products['manufacturers_name']);
$products['manufacturers_name'] = str_replace("Hersteller3","Kategorie1",$products['manufacturers_name']);
$products['manufacturers_name'] = str_replace("Hersteller4","Kategorie3",$products['manufacturers_name']);
$products['manufacturers_name'] = str_replace("Hersteller5","Kategorie3",$products['manufacturers_name']);
$products['manufacturers_name'] = str_replace("Hersteller6","Kategorie4",$products['manufacturers_name']);

//create content ERstellen der Tabelle in Reihenfolge
$schema .= HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'product_info.php?products_id=' . $products['products_id'] . "\t" .
$products['products_name'] ."\t".
$products_description ."\t".
HTTP_CATALOG_SERVER . DIR_WS_CATALOG_ORIGINAL_IMAGES .$products['products_image']."\t".
$products['manufacturers_name'] ."\t".
$products_price ."\n";

}
// create File
$fp = fopen(DIR_FS_DOCUMENT_ROOT.'export/' . $file, "w+");
fputs($fp, $schema);
fclose($fp);


switch ($_POST['export']) {
case 'yes':
// send File to Browser
$extension = substr($file, -3);
$fp = fopen(DIR_FS_DOCUMENT_ROOT.'export/' . $file,"rb");
$buffer = fread($fp, filesize(DIR_FS_DOCUMENT_ROOT.'export/' . $file));
fclose($fp);
header('Content-type: application/x-octet-stream');
header('Content-disposition: attachment; filename=' . $file);
echo $buffer;
exit;

break;
}

}

function display() {

$customers_statuses_array = xtc_get_customers_statuses();

// build Currency Select
$curr='';
$currencies=xtc_db_query("SELECT code FROM ".TABLE_CURRENCIES);
while ($currencies_data=xtc_db_fetch_array($currencie s)) {
$curr.=xtc_draw_radio_field('currencies', $currencies_data['code'],true).$currencies_data['code'].'
';
}

return array('text' => EXPORT_STATUS_TYPE.'
'.
EXPORT_STATUS.'
'.
xtc_draw_pull_down_menu('status',$customers_status es_array, '1').'
'.
CURRENCY.'
'.
CURRENCY_DESC.'
'.
$curr.
EXPORT_TYPE.'
'.
EXPORT.'
'.
xtc_draw_radio_field('export', 'no',false).EXPORT_NO.'
'.
xtc_draw_radio_field('export', 'yes',true).EXPORT_YES.'
'.
'
' . xtc_image_submit('button_export.gif', IMAGE_UPDATE) .

'<a href="' . xtc_href_link(FILENAME_MODULE_EXPORT, 'set=' . $_GET['set'] . '&module=eigene') . '">' .
xtc_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');


}

function check() {
if (!isset($this->_check)) {
$check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_EIGENE_STATUS'");
$this->_check = xtc_db_num_rows($check_query);
}
return $this->_check;
}

function install() {
xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_EIGENE_FILE', 'dateiname_fuer_froogle.txt', '6', '1', '', now())");
xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_EIGENE_STATUS', 'True', '6', '1', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");
}

function remove() {
xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
return array('MODULE_EIGENE_STATUS','MODULE_EIGENE_FILE') ;
}

}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
austausch, froogle, hersteller, kategorie

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus



Alle Zeitangaben in WEZ +1. Es ist jetzt 18:45 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand