Jump to content
xt:Commerce Community Forum

PHP Fehler mei Module -> Zusammenfassung


Recommended Posts

Hallo

bekomme immer wenn ich im Adminbereich auf Module -> Zusammenfassung klicke folgenden Fehler


code = 'ot_coupon'; $this->header = MODULE_ORDER_TOTAL_COUPON_HEADER; $thi>title = MODULE_ORDER_TOTAL_COUPON_TITLE; $this->description = MODULE_ORDER_TOTAL_COUPON_DESCRIPTION; $this->user_prompt = ''; $this->enabled = MODULE_ORDER_TOTAL_COUPON_STATUS; $this->sort_order = MODULE_ORDER_TOTAL_COUPON_SORT_ORDER; $this->include_shipping = MODULE_ORDER_TOTAL_COUPON_INC_SHIPPING; $this->include_tax = MODULE_ORDER_TOTAL_COUPON_INC_TAX; $this->calculate_tax = MODULE_ORDER_TOTAL_COUPON_CALC_TAX; $this->tax_class = MODULE_ORDER_TOTAL_COUPON_TAX_CLASS; $this->credit_class = true; $this->ouut = array (); } function process() { global $order, $xtPrice; $order_total = $this->get_order_total(); $od_amount = $this->calculate_credit($order_total); $tod_amount = 0.0; //Fred $this->deduction = $od_amount; if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'! $tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax); } if ($od_amount > 0) { $order->info['total'] = $order->info['total'] - $od_amount; $order->info['deductn'] = $od_amount; $this->output[] = array ('title' => $this->title.':'.$this->coupon_code.':', 'text' => '-'.$xtPrice->xtcFormat($od_amount, true).'', 'value' => $od_amount); //Fred added hyphen } } function selection_test() { return false; } function pre_confirmation_check($order_total) { return $this->calculate_credit($order_total); } function use_credit_amount() { return $output_string; } function credit_selection() { /* $selection_string = ''; $selection_ring .= '' . "\n"; $selection_string .= ' '; $selection_string .= ' '; $selection_string .= ' '; $selection_string .= ' '; $selection_string .= '' . "\n"; */ return false; } function clect_posts() { global $xtPrice; if ($_POST['gv_redeem_code']) { // get some info from the coupon table $coupon_query = xtc_db_query("select coupon_id, coupon_amount, coupon_type, coupon_minimum_order,uses_per_coupon, uses_per_user, restrict_to_products,restrict_to_categories from ".TABLE_COUPONS." where coupon_code='".$_POST['gv_redeem_code']."' and coupon_active='Y'"); $coupon_result = xtc_db_fetch_array($coupon_query); // SS ? if ($coupon_result['coupon_type'] != 'G') { if (xtc_db_num_rows($couponuery) == 0) { xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_NO_INVALID_REDEEM_COUPON), 'SSL')); } $date_query = xtc_db_query("select coupon_start_date from ".TABLE_COUPONS." where coupon_start_date <= now() and coupon_code='".$_POST['gv_redeem_code']."'"); if (xtc_db_num_rows($date_query) == 0) { xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_INVALID_STARTDATE_COUPON), 'SSL')); } $date_query = xtc_db_query("seleccoupon_expire_date from ".TABLE_COUPONS." where coupon_expire_date >= now() and coupon_code='".$_POST['gv_redeem_code']."'"); if (xtc_db_num_rows($date_query) == 0) { xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_INVALID_FINISDATE_COUPON), 'SSL')); } $coupon_count = xtc_db_query("select coupon_id from ".TABLE_COUPON_REDEEM_TRACK." where coupon_id = '".$coupon_result['coupon_id']."'"); $coupon_count_customer = xtc_db_query("select coupon_id from ".TABLE_COUPON_REEM_TRACK." where coupon_id = '".$coupon_result['coupon_id']."' and customer_id = '".$_SESSION['customer_id']."'"); if (xtc_db_num_rows($coupon_count) >= $coupon_result['uses_per_coupon'] && $coupon_result['uses_per_coupon'] > 0) { xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_INVALID_USES_COUPON.$coupon_result['uses_per_coupon'].TIMES), 'SSL')); } if (xtc_db_num_rows($coupon_count_customer) >= $coupon_result['uses_per_user'] && $coupon_result['uses_per_user'] > 0) { xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_INVALID_USES_USER_COUPON.$coupon_result['uses_per_user'].TIMES), 'SSL')); } if ($coupon_result['coupon_type'] == 'S') { $coupon_amount = $order->info['shipping_cost']; } else { $coupon_amount = $xtPrice->xtcFormat($coupon_result['coupon_amount'], true).' '; } if ($coupon_result['coupon_type'] == 'P') $coupon_amount = $coupon_result['coupon_amount'].'% '; if ($coupon_result['coupon_minimum_order'] 0) $coupon_amount .= 'on orders greater than '.$coupon_result['coupon_minimum_order']; $_SESSION['cc_id'] = $coupon_result['coupon_id']; //Fred ADDED, set the global and session variable } if ($_POST['submit_redeem_coupon_x'] && !$_POST['gv_redeem_code']) xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_NO_REDEEM_CODE), 'SSL')); } } function calculate_credit($amount) { global $order; $od_amount = 0; if (isset ($_SESSION['cc_id'])) { $coupon_query = xtcb_query("select coupon_code from ".TABLE_COUPONS." where coupon_id = '".$_SESSION['cc_id']."'"); if (xtc_db_num_rows($coupon_query) != 0) { $coupon_result = xtc_db_fetch_array($coupon_query); $this->coupon_code = $coupon_result['coupon_code']; $coupon_get = xtc_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from ".TABLE_COUPONS." where coupon_code = '".$coupon_result['coupon_code']."'"); $get_result = xtc_db_fetch_array($coupon_get); $c_duct = $get_result['coupon_amount']; if ($get_result['coupon_type'] == 'S') $c_deduct = $order->info['shipping_cost']; if ($get_result['coupon_type']=='S' && $get_result['coupon_amount'] > 0 ) $c_deduct = $order->info['shipping_cost'] + $get_result['coupon_amount']; if ($get_result['coupon_minimum_order'] <= $this->get_order_total()) { if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) { for ($i = 0; $i < sizeof($order->products); $i ++) { if ($get_result['restrict_to_products']) { $pr_ids = split("[,]", $get_result['restrict_to_products']); for ($ii = 0; $p < count($pr_ids); $ii ++) { if ($pr_ids[$ii] == xtc_get_prid($order->products[$i]['id'])) { if ($get_result['coupon_type'] == 'P') { $od_amount = $amount * $get_result['coupon_amount'] / 100; $pr_c = $this->product_price($pr_ids[$ii]); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT! $pod_amount = round($pr_c*10)/10*$c_deduct/100; $od_amount = $od_amount + $pod_amount; } else { $od_amount = $c_deduct; } } } } else { $cat_ids = split("[,]", $get_result['restrict_to_categories']); for ($i = 0; $i < sizeof($order->products); $i ++) { $my_path = xtc_get_product_path(xtc_get_prid($order->products[$i]['id'])); $sub_cat_ids = split("[_]", $my_path); for ($iii = 0; $iii < count($sub_caids); $iii ++) { for ($ii = 0; $ii < count($cat_ids); $ii ++) { if ($sub_cat_ids[$iii] == $cat_ids[$ii]) { if ($get_result['coupon_type'] == 'P') { $pr_c = $this->product_price(xtc_get_prid($order->products[$i]['id'])); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT! $pod_amount = round($pr_c*10)/10*$c_deduct/100; $od_amount = $od_amount + $pod_amount; continue 3; // v5.13a Tanaka 2005-4-30: to prevent double counting of a product discount

Kann mir jemand sogaen woran das liegt?

Ich danke im voraus!

MFG

Leibnitz

Link to comment
Share on other sites

<div class='quotetop'>QUOTE(homer_s @ Jul 11 2006, 04:23 PM) Quoted post</div><div class='quotemain'>

Das keine Fehlermeldung sondern bisschen php code,

dein webserver scheint dieses nicht zu verarbeiten sondern nur auszugeben.

kann mehrer ursachen haben zb syntaxfehler, einstellungen webserver....

Link to comment
Share on other sites

Archived

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

×
  • Create New...