|
From: <os...@us...> - 2013-04-27 20:01:05
|
Revision: 4724
http://sourceforge.net/p/oscss/svn/4724
Author: oscim
Date: 2013-04-27 20:01:02 +0000 (Sat, 27 Apr 2013)
Log Message:
-----------
Fix service save in process
Modified Paths:
--------------
branches/2.1.1/catalog/admin/includes/modules/pages/orders.php
branches/2.1.1/catalog/common/classes/order.php
branches/2.1.1/catalog/includes/classes/checkout_process.php
Modified: branches/2.1.1/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- branches/2.1.1/catalog/admin/includes/modules/pages/orders.php 2013-04-27 15:10:11 UTC (rev 4723)
+++ branches/2.1.1/catalog/admin/includes/modules/pages/orders.php 2013-04-27 20:01:02 UTC (rev 4724)
@@ -841,13 +841,13 @@
'status'=>(int)$_GET['flag'] ,
);
- if( ($_GET['flag'] == '1') && ) {
- $myarray['date_start']=date('Y-m-d H:i:s');;
- $myarray['date_end']=date('Y-m-d', strtotime('+'.(int)$optionContract['povc_duration'].' '.(string)$optionContract['povc_unit']));
- $myarray['date_revival']=date('Y-m-d', strtotime('+'.(int)($optionContract['povc_duration']*0.2).' '.(string)$optionContract['povc_unit']));
+// if( ($_GET['flag'] == '1') && ) {
+// $myarray['date_start']=date('Y-m-d H:i:s');;
+// $myarray['date_end']=date('Y-m-d', strtotime('+'.(int)$optionContract['povc_duration'].' '.(string)$optionContract['povc_unit']));
+// $myarray['date_revival']=date('Y-m-d', strtotime('+'.(int)($optionContract['povc_duration']*0.2).' '.(string)$optionContract['povc_unit']));
+//
+// }
- }
-
if(substr($res->date_start,0,4) <'2000')
$myarray['date_start']=date('Y-m-d H:i:s') ;
Modified: branches/2.1.1/catalog/common/classes/order.php
===================================================================
--- branches/2.1.1/catalog/common/classes/order.php 2013-04-27 15:10:11 UTC (rev 4723)
+++ branches/2.1.1/catalog/common/classes/order.php 2013-04-27 20:01:02 UTC (rev 4724)
@@ -117,7 +117,7 @@
*/
function query($order_id) {
global $languages_id,$currencies;
-
+var_dump(__function__);
$order_id = tep_db_prepare_input($order_id);
$sql="select orders_id,orders_prefix,customers_id,customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified,ip_address, total_weight,orders_date_finished, class_payment, class_shipping ".((self::$mode)?" ,facture_id ,holding_origin_id ":'')." from " . self::$tables['ORDERS'] . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'";
@@ -228,14 +228,15 @@
'exchange_id' => $orders_products['products_exchanged_id'] );
$subindex = 0;
-// $attributes_query = tep_db_query("select products_options_id, products_options_values_id, products_options, products_options_values, options_values_price, price_prefix from " .self::$tables['ATTRIBUTES'] . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
- $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " .self::$tables['ATTRIBUTES'] . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+ $attributes_query = tep_db_query("select pa.products_options_id, pa.products_options_values_id, pa.products_options, pa.products_options_values, pa.options_values_price, pa.price_prefix, po.products_options_type as type from " .self::$tables['ATTRIBUTES'] . " pa LEFT JOIN ".TABLE_PRODUCTS_OPTIONS." po ON(pa.products_options_id = po.products_options_id) where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+// $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " .self::$tables['ATTRIBUTES'] . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
if (tep_db_num_rows($attributes_query)) {
while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->products[$index]['attributes'][$subindex] = array(
-// 'option_id' => $attributes['products_options_id'],
-// 'value_id' => $attributes['products_options_values_id'],
+ 'option_id' => $attributes['products_options_id'],
+ 'value_id' => $attributes['products_options_values_id'],
+ 'type' => $attributes['type'],
'option' => $attributes['products_options'],
'value' => $attributes['products_options_values'],
@@ -265,6 +266,8 @@
@brief Call Public specific Environement for Generate checkout page
*/
public function cart() {
+
+var_dump(__function__);
global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment,$tax_address,$coupon_sav, $shipping_mod, $shipping_modules;
$this->content_type = $cart->get_content_type();
@@ -394,7 +397,7 @@
$subindex = 0;
reset($prdct['attributes']);
while (list($option, $value) = each($prdct['attributes'])) {
- $attributes_query = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix,pa.options_values_weight from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$prdct['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
+ $attributes_query = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix,pa.options_values_weight, popt.products_options_type as type from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$prdct['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
$attributes = tep_db_fetch_array($attributes_query);
if(isset($prdct['attributes_values'][$option]) ) {
@@ -403,6 +406,7 @@
}
$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
'value' => $attributes['products_options_values_name'],
+ 'type' => $attributes['type'],
'option_id' => $option,
'value_id' => $value,
'prefix' => $attributes['price_prefix'],
Modified: branches/2.1.1/catalog/includes/classes/checkout_process.php
===================================================================
--- branches/2.1.1/catalog/includes/classes/checkout_process.php 2013-04-27 15:10:11 UTC (rev 4723)
+++ branches/2.1.1/catalog/includes/classes/checkout_process.php 2013-04-27 20:01:02 UTC (rev 4724)
@@ -62,7 +62,7 @@
/*
Selection Holding /orders
*/
- self::$mode=(tep_not_null($table)?false:true);
+ self::$mode=((strlen($table)>0)?false:true);
$table=((!self::$mode)? '_'.strtoupper($table) : '');
@@ -163,8 +163,8 @@
@brief Chargement dans le fin du process
This function call in pre-process and process
*/
- public function in_process_finish(){
- global $page, $checkout_process,$mode;
+ public function in_process_finish($order){
+ global $order, $page, $checkout_process,$mode;
// transport var for childs loop modules
$checkout_process = $this;
$mode=self::$mode;
@@ -174,7 +174,7 @@
foreach ($this->modules as $key=>$module) {
if (($module->enabled) and (method_exists($key, 'in_process_finish'))) {
$funct='in_process_finish';
- $result[$key]=$this->modules[$key]->$funct();
+ $result[$key]=$this->modules[$key]->$funct($order);
}
}
@@ -315,7 +315,7 @@
* @param $order object orders|null
*/
public function process_exe($order_totals,$order=''){
- global $customer_id, $currencies;
+ global $customer_id, $currencies,$order;
$ip = tep_get_ip_address();
$total_weight='';
@@ -421,18 +421,18 @@
// $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
-// exit;
+
/*
Force reload order for obtain rowid line
*/
- $page = Page::getInstance();
- $order = new order((int)self::$Id);
- $page->add_object('order',$order);
+// $page = Page::getInstance();
+// $order = new order((int)self::$Id);
+
/**
Before process module ACA
*/
- $this->in_process_finish();
+ $this->in_process_finish(self::$Id);
/**
Fin pre commande
@@ -539,11 +539,13 @@
$order_products_id = $res2->__get('insertId');
- $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$pre_order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+ $attributes_query = tep_db_query("select products_options_id, products_options_values_id, products_options, products_options_values, options_values_price, price_prefix from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$pre_order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
if (tep_db_num_rows($attributes_query)) {
while ($attributes = tep_db_fetch_array($attributes_query)) {
$sql_data_array1 = array('orders_id' => (int)$order_id,
'orders_products_id' => (int)$order_products_id,
+ 'products_options_id' => tep_db_input($attributes['products_options_id']),
+ 'products_options_values_id' => tep_db_input($attributes['products_options_values_id']),
'products_options' => tep_db_input($attributes['products_options']),
'products_options_values' => tep_db_input($attributes['products_options_values']),
'price_prefix' => tep_db_input($attributes['price_prefix']),
@@ -573,20 +575,15 @@
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$order['customers_id'] . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$order['customers_id'] . "'");
- /*
- Force reload order for obtain rowid line
- */
- $page = Page::getInstance();
- $order = new order((int)$order_id);
- $page->add_object('order',$order);
+
+
}
- /**
+ /**
Before process module ACA
- */
- $r = $this->in_process_finish();
-
+ */
+ $r = $this->in_process_finish();
$this->email_confirm_order($order_id);
@@ -815,6 +812,8 @@
private function insert_order_product_attribut($order_products_id,$attributes_values){
$sql_data_array = array('orders_id' => (int)$this->the_order_id,
'orders_products_id' => (int)$order_products_id,
+ 'products_options_id' => tep_db_input($attributes_values['products_options_id']),
+ 'products_options_values_id' => tep_db_input($attributes_values['products_options_values_id']),
'products_options' => tep_db_input($attributes_values['products_options_name']),
'products_options_values' => tep_db_input($attributes_values['products_options_values_name']),
'options_values_price' => tep_db_input($attributes_values['options_values_price']),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|