📄 checkout_process.inc.php
字号:
FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "' and p.products_id=pa.products_id and pad.products_attributes_id=pa.products_attributes_id "; $download_check_query = tep_db_query($download_check_query_raw); if (tep_db_num_rows($download_check_query) > 0) { $downloadable_product = true; } } // end of downloadable product check if ( !$downloadable_product ) { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $stock_values = tep_db_fetch_array($stock_query); $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } }// Eversun mod end for stock does not decrement when using paypal*/ $sql_data_array = array('orders_id' => (int)$this->orders_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']); tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); $order_products_id = tep_db_insert_id(); if(is_callable(array($order_total_modules, 'update_credit_account'))) { global $insert_id; $insert_id = $this->orders_id; $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM }//------insert customer choosen option to order-------- $attributes_exist = '0'; if (isset($order->products[$i]['attributes'])) { $attributes_exist = '1'; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { $attributes_query = "select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad on pa.products_attributes_id=pad.products_attributes_id where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and poptt.products_options_text_id = popt.products_options_id and poptt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"; $attributes = tep_db_query($attributes_query); } else { $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and poptt.products_options_text_id = popt.products_options_id and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and poptt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); } $attributes_values = tep_db_fetch_array($attributes); $sql_data_array = array('orders_id' => (int)$this->orders_id, 'orders_products_id' => $order_products_id, 'products_options_id' => $order->products[$i]['attributes'][$j]['option_id'], 'products_options' => $attributes_values['products_options_name'], 'products_options_values_id' => $order->products[$i]['attributes'][$j]['value_id'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); } }//------insert customer choosen option eof ---- $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; $total_cost += $total_products_price; }$order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM// store the session info for notification update - gsb $sql_data_array = array('sendto' => $sendto, 'billto' => $billto, 'firstname' => $order->billing['firstname'], 'lastname' => $order->billing['lastname'], 'payment' => $payment, 'payment_title' => $this->codeTitle, 'payment_amount' => $this->grossPaymentAmount($this->currency()), 'payment_currency' => $this->currency(), 'payment_currency_val' => $currencies->get_value($this->currency()), 'language' => $language, 'language_id' => $languages_id, 'currency' => $currency, 'currency_value' => $currencies->get_value($currency), 'content_type' => $order->content_type, 'txn_signature' => $this->setTransactionID()); global $affiliate_ref, $affiliate_clickthroughs_id, $affiliate_clientdate, $affiliate_clientbrowser, $affiliate_clientip; if (tep_session_is_registered('affiliate_ref') && tep_not_null($affiliate_ref)) { $sql_data_array['affiliate_id'] = $affiliate_ref; $sql_data_array['affiliate_clickthroughs_id'] = $affiliate_clickthroughs_id; $sql_data_array['affiliate_date'] = $affiliate_clientdate; $sql_data_array['affiliate_browser'] = $affiliate_clientbrowser; $sql_data_array['affiliate_ipaddress'] = $affiliate_clientip; } if($session_exists) { tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'"); $PayPal_osC->txn_signature = $this->digest; } else { $sql_data_array['orders_id'] = (int)$this->orders_id; tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array); $PayPal_osC = new PayPal_osC($this->orders_id,$this->digest); tep_session_register('PayPal_osC'); } if(is_callable(array($order_total_modules, 'apply_credit'))) $order_total_modules->apply_credit(); require(DIR_WS_INCLUDES . 'modules/payment/paypal/catalog/checkout_splash.inc.php');?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -