Jump to content
xt:Commerce Community Forum

Modul Freundschaftswerbung


Recommended Posts

Hallo zusammen,

ich habe das Modul Freundschaftswerbung in meinen Shop integriert, möchte nun aber anstelle von Gutscheinen Rabatt-Coupons als "Provision" verschicken.

Habe also einen Rabattcoupon erstellt und Ihn so angepasst wie ich Ihn gern hätte. Nun stehe ich aber vor dem Problem, dass ich nicht genau weiß wo ich was im Quellcode ändern muss, dass das System den von mir erstellten Coupon versendet anstelle von einem Gutschein.

Hier mal ein Auszug des Quellcodes welcher bisher einen Gutschein in Höhe von X automatisch versendet.

	if(MODULE_CUSTOMERS_ADVERTISING_STATUS == 'true') {
for ($m = 0, $k = sizeof($order->products); $m < $k; $m ++) {
$advertising_final_price += $order->products[$m]['final_price'];
}
if($advertising_final_price >= MODULE_CUSTOMERS_ADVERTISING_CHEAP) {
$guest_query = "SELECT * FROM ".TABLE_CUSTOMERS_ADVERTISING."
WHERE email_address_guest = '".$order->customer['email_address']."'
AND guest_ordered = '0'
AND gv_code_send = '0'";
$guest = xtc_db_fetch_array(xtc_db_query($guest_query));

if($guest['email_address_guest'] == $order->customer['email_address']) {
xtc_db_query("update " . TABLE_CUSTOMERS_ADVERTISING . "
set customers_id_guest = '" . $_SESSION['customer_id'] . "', guest_ordered = '1'
where email_address_guest = '" . $order->customer['email_address'] . "'");
// create gv-code
$id1 = create_coupon_code($guest['email_address_customers']);
$insert_query = xtc_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . MODULE_CUSTOMERS_ADVERTISING_AMOUNT . "', now())");
$insert_id = xtc_db_insert_id($insert_query);
$insert_query = xtc_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $guest['email_address_customers'] . "', now() )");

// assign language to template for caching
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = false;

// set dirs manual
$smarty->template_dir=DIR_FS_CATALOG.'templates';
$smarty->compile_dir=DIR_FS_CATALOG.'templates_c';
$smarty->config_dir=DIR_FS_CATALOG.'lang';

$smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
$smarty->assign('logo_path',HTTP_SERVER . DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/');

$smarty->assign('AMMOUNT', MODULE_CUSTOMERS_ADVERTISING_AMOUNT . " EUR");
$smarty->assign('GIFT_ID', $id1);
$smarty->assign('WEBSITE', HTTP_SERVER . DIR_WS_CATALOG);

$link = HTTP_SERVER . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='.$id1;

$smarty->assign('GIFT_LINK',$link);

$html_mail=$smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/'.$_SESSION['language'].'/send_gift.html');
$txt_mail=$smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/'.$_SESSION['language'].'/send_gift.txt');

xtc_php_mail(EMAIL_BILLING_ADDRESS,EMAIL_BILLING_NAME, $guest['email_address_customers'] , $mail['firstname_customers'] . ' ' . $mail['lastname_customers'] , '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', 'Freunde werben Freunde - Ihr Gutschein', $html_mail , $txt_mail);

xtc_db_query("update " . TABLE_CUSTOMERS_ADVERTISING . "
set gv_code_send = '1' where email_address_guest = '" . $order->customer['email_address'] . "'");
}
} else {
xtc_db_query("update " . TABLE_CUSTOMERS_ADVERTISING . "
set customers_id_guest = '" . $_SESSION['customer_id'] . "', guest_ordered = '1'
where email_address_guest = '" . $order->customer['email_address'] . "'");
}
}[/HTML]

wie gesagt. Im Prinzip möchte ich erreichen ,dass das System keinen Gutschein generiert und verschickt, sondern den von Mir im Coupon-Admin hinterlegten rabatt-Coupon.

Hat jemand da eine Idee?

MfG

Björn Mühle

Link to comment
Share on other sites

Archived

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

×
  • Create New...