Jump to content
xt:Commerce Community Forum

Export für Toppreise.ch (Preissuchmaschine)


elDivino

Recommended Posts

Hi Zusammen,

Ich suche ein Modul für die generierung eines TXT oder CSV Files für die Preissuchmaschine toppreise.ch

Hat das jemand schon programmiert oder kann man das irgendwo kaufen?

Ich müsste folgenden Output haben

------------------

- Artikelnummer im Shop

- Hersteller

- Bezeichnung

- Artikelnummer des Herstellers

- Preis inkl. MwSt.

- Versandkosten für dieses Produkt UND / ODER Gewicht dieses Produktes (eine der beiden Angaben muss vorhanden sein)

------------------

Danke & Gruss

Thomas

Link to comment
Share on other sites

  • 2 years later...

Hi Zusammen,

Ich suche ein Modul für die generierung eines TXT oder CSV Files für die Preissuchmaschine toppreise.ch

Hat das jemand schon programmiert oder kann man das irgendwo kaufen?

Ich müsste folgenden Output haben

------------------

- Artikelnummer im Shop

- Hersteller

- Bezeichnung

- Artikelnummer des Herstellers

- Preis inkl. MwSt.

- Versandkosten für dieses Produkt UND / ODER Gewicht dieses Produktes (eine der beiden Angaben muss vorhanden sein)

------------------

Danke & Gruss

Thomas

Hallo Thomas

Genau das selbe suche ich auch.

Bist du eventuell bereits fündig geworden?

Wäre Dir für ein Feedback sehr dankbar.

Danke und Gruss aus Baar

Reto

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

das hier mal in einen editor kopieren und dann als toppreise.php in euren admin/includes/module/export ordner legen:

<?php

/* -----------------------------------------------------------------------------------------

$Id: toppreise.php 950 2005-05-14 16:45:21Z mz $

XT-Commerce - community made shopping

xt:Commerce Shopsoftware VEYTON 4.0

Copyright © 2005 XT-Commerce

-----------------------------------------------------------------------------------------

based on:

© 2000-2001 The Exchange Project (earlier name of osCommerce)

© 2002-2003 osCommerce(cod.php,v 1.28 2003/02/14); osCommerce, Open Source Online Shop E-Commerce Solutions

© 2003 nextcommerce (invoice.php,v 1.6 2003/08/24); nextcommerce.org

Released under the GNU General Public License

---------------------------------------------------------------------------------------*/

defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );

define('MODULE_TOPPREISE_TEXT_DESCRIPTION', 'Export - Toppreise.ch');

define('MODULE_TOPPREISE_TEXT_TITLE', 'Toppreise.ch - CSV');

define('MODULE_TOPPREISE_FILE_TITLE' , '<hr noshade>Dateiname');

define('MODULE_TOPPREISE_FILE_DESC' , 'Geben Sie einen Dateinamen ein, falls die Exportadatei am Server gespeichert werden soll.<br>(Verzeichnis export/)');

define('MODULE_TOPPREISE_STATUS_DESC','Modulstatus');

define('MODULE_TOPPREISE_STATUS_TITLE','Status');

define('MODULE_TOPPREISE_CURRENCY_TITLE','Währung');

define('MODULE_TOPPREISE_CURRENCY_DESC','Welche Währung soll exportiert werden?');

define('EXPORT_YES','Nur Herunterladen');

define('EXPORT_NO','Am Server Speichern');

define('CURRENCY','<hr noshade><b>Währung:</b>');

define('CURRENCY_DESC','Währung in der Exportdatei');

define('EXPORT','Bitte den Sicherungsprozess AUF KEINEN FALL unterbrechen. Dieser kann einige Minuten in Anspruch nehmen.');

define('EXPORT_TYPE','<hr noshade><b>Speicherart:</b>');

define('EXPORT_STATUS_TYPE','<hr noshade><b>Kundengruppe:</b>');

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 <i>Gast</i>):</b>');

define('CAMPAIGNS','<hr noshade><b>Kampagnen:</b>');

define('CAMPAIGNS_DESC','Mit Kampagne zur Nachverfolgung verbinden.');

define('DATE_FORMAT_EXPORT', '%d.%m.%Y'); // this is used for strftime()

// include needed functions

class toppreise {

var $code, $title, $description, $enabled;

function toppreise() {

global $order;

$this->code = 'toppreise';

$this->title = MODULE_TOPPREISE_TEXT_TITLE;

$this->description = MODULE_TOPPREISE_TEXT_DESCRIPTION;

$this->sort_order = MODULE_TOPPREISE_SORT_ORDER;

$this->enabled = ((MODULE_TOPPREISE_STATUS == 'True') ? true : false);

// $this->CAT=array();

// $this->PARENT=array();

}

function process($file) {

@xtc_set_time_limit(0);

require(DIR_FS_CATALOG.DIR_WS_CLASSES . 'xtcPrice.php');

$xtPrice = new xtcPrice($_POST['currencies'],$_POST['status']);

$schema = 'artikelid|hersteller|herstellernummer|bezeichnung|beschreibung_kurz|verfügbarkeit|deeplink|preis_val|product_ean|Gewicht'."\n";

$export_query =xtc_db_query("SELECT

p.products_id,

pd.products_name,

pd.products_description,pd.products_short_description,

p.products_model,p.products_ean,

p.products_image,

p.products_price,

p.products_status,

p.products_date_available,

p.products_shippingtime,

p.products_discount_allowed,

pd.products_meta_keywords,

p.products_tax_class_id,

p.products_date_added,

p.products_weight,

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 = $xtPrice->xtcGetPrice($products['products_id'],

$format=false,

1,

$products['products_tax_class_id'],

'');

// remove trash

$products_short_description = strip_tags($products['products_short_description']);

$products_short_description = str_replace("<br>"," ",$products_short_description);

$products_short_description = str_replace("<br />"," ",$products_short_description);

$products_short_description = str_replace("'",", ",$products_short_description);

$products_short_description = str_replace("\n"," ",$products_short_description);

$products_short_description = str_replace("\r"," ",$products_short_description);

$products_short_description = str_replace("\t"," ",$products_short_description);

$products_short_description = str_replace("\v"," ",$products_short_description);

$products_short_description = str_replace("&quot,"," \"",$products_short_description);

$products_short_description = str_replace("&qout,"," \"",$products_short_description);

$products_short_description = str_replace(chr(13)," ",$products_short_description);

$products_short_description = substr($products_short_description, 0, 255);

//create content

$schema .= $products['products_id'] ."|".

$products['manufacturers_name']."|".

$products['products_model'] . '|' .

$products['products_name']."|".

$products_short_description."|".

xtc_get_shipping_status_name($products['products_shippingtime']). '|' .

HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'product_info.php?'.$_POST['campaign'].xtc_product_link($products['products_id'], $products['products_name']) . "|" .

number_format($products_price,2,'.',''). "|" .

$products['products_ean'] ."|" .

$products['products_weight'] ."\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 buildCAT($catID)

{

if (isset($this->CAT[$catID]))

{

return $this->CAT[$catID];

} else {

$cat=array();

$tmpID=$catID;

while ($this->getParent($catID)!=0 || $catID!=0)

{

$cat_select=xtc_db_query("SELECT categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id='".$catID."' and language_id='".$_SESSION['languages_id']."'");

$cat_data=xtc_db_fetch_array($cat_select);

$catID=$this->getParent($catID);

$cat[]=$cat_data['categories_name'];

}

$catStr='';

for ($i=count($cat);$i>0;$i--)

{

$catStr.=$cat[$i-1].' > ';

}

$this->CAT[$tmpID]=$catStr;

return $this->CAT[$tmpID];

}

}

function getParent($catID)

{

if (isset($this->PARENT[$catID]))

{

return $this->PARENT[$catID];

} else {

$parent_query=xtc_db_query("SELECT parent_id FROM ".TABLE_CATEGORIES." WHERE categories_id='".$catID."'");

$parent_data=xtc_db_fetch_array($parent_query);

$this->PARENT[$catID]=$parent_data['parent_id'];

return $parent_data['parent_id'];

}

}

*/

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($currencies)) {

$curr.=xtc_draw_radio_field('currencies', $currencies_data['code'],true).$currencies_data['code'].'<br>';

}

$campaign_array = array(array('id' => '', 'text' => TEXT_NONE));

$campaign_query = xtc_db_query("select campaigns_name, campaigns_refID from ".TABLE_CAMPAIGNS." order by campaigns_id");

while ($campaign = xtc_db_fetch_array($campaign_query)) {

$campaign_array[] = array ('id' => 'refID='.$campaign['campaigns_refID'].'&', 'text' => $campaign['campaigns_name'],);

}

return array('text' => EXPORT_STATUS_TYPE.'<br>'.

EXPORT_STATUS.'<br>'.

xtc_draw_pull_down_menu('status',$customers_statuses_array, '1').'<br>'.

CURRENCY.'<br>'.

CURRENCY_DESC.'<br>'.

$curr.

CAMPAIGNS.'<br>'.

CAMPAIGNS_DESC.'<br>'.

xtc_draw_pull_down_menu('campaign',$campaign_array).'<br>'.

EXPORT_TYPE.'<br>'.

EXPORT.'<br>'.

xtc_draw_radio_field('export', 'no',false).EXPORT_NO.'<br>'.

xtc_draw_radio_field('export', 'yes',true).EXPORT_YES.'<br>'.

'<br>' . xtc_button(BUTTON_EXPORT) .

xtc_button_link(BUTTON_CANCEL, xtc_href_link(FILENAME_MODULE_EXPORT, 'set=' . $_GET['set'] . '&module=toppreise')));

}

function check() {

if (!isset($this->_check)) {

$check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_TOPPREISE_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_TOPPREISE_FILE', 'toppreise.csv', '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_TOPPREISE_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_TOPPREISE_STATUS','MODULE_TOPPREISE_FILE');

}

}

?>

funzt bereits in einigen .ch Shops die wir hosten.

Have fun :D

Link to comment
Share on other sites

  • 1 year later...

Hi Gemeinde,

ich bin momentan noch am Testen von xt-commerce, denke aber dass es was wäre. Nun war ich für meinen Test auch auf der Suche nach nem Export für Toppreise.ch.

das hier mal in einen editor kopieren und dann als toppreise.php in euren admin/includes/module/export ordner legen:

Ich habs gelesen, nur gibst bei xt-commerce 4 das nicht bei mir.

Nun ich weis leider nicht wohin ich das php - Script nun Installieren oder Kopieren soll. Kann mir jemand von Euch weiter Helfen ?

Danke viel mals und Grüsse

Chris

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...