Jump to content

Error On Last Step Of Confirm


Recommended Posts

I have installed Prestashop 1.6.1.4.

The orders details doesn't show in the order page! and just shows total price!

At the first i thought it related to the some modules.

I turned error on in config and I saw a lot of error that I think it doesn't relate to the modules!

What's the problem and How can I fix it?

 

[PrestaShopDatabaseException]

Unknown column 'original_wholesale_price' in 'field list'
 

INSERT INTO `ps_order_detail` (`id_order`, `id_order_invoice`, `id_warehouse`, `id_shop`, `product_id`, `product_attribute_id`, `product_name`, `product_quantity`, `product_quantity_in_stock`, `product_quantity_return`, `product_quantity_refunded`, `product_quantity_reinjected`, `product_price`, `reduction_percent`, `reduction_amount`, `reduction_amount_tax_incl`, `reduction_amount_tax_excl`, `group_reduction`, `product_quantity_discount`, `product_ean13`, `product_upc`, `product_reference`, `product_supplier_reference`, `product_weight`, `tax_name`, `tax_rate`, `tax_computation_method`, `id_tax_rules_group`, `ecotax`, `ecotax_tax_rate`, `discount_quantity_applied`, `download_hash`, `download_nb`, `download_deadline`, `unit_price_tax_incl`, `unit_price_tax_excl`, `total_price_tax_incl`, `total_price_tax_excl`, `total_shipping_price_tax_excl`, `total_shipping_price_tax_incl`, `purchase_supplier_price`, `original_product_price`, `original_wholesale_price`) VALUES ('2', '0', '0', '1', '54', '140', 'سبد بافت استوانه زیباسازان - رنگ : قهوه ای', '1', '1', '0', '0', '0', '20000', '0', '0', '0', '0', '0', '0', '', '', '', '', '0', '', '0', '0', '0', '0', '0', '0', '', '0', '0000-00-00 00:00:00', '20000', '20000', '20000', '20000', '0', '0', '0', '20000', '0')
at line 791 in file classes/db/Db.php
786.         if ($webservice_call && $errno) {787.             $dbg = debug_backtrace();788.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);789.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {790.             if ($sql) {791.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');792.             }793. 794.             throw new PrestaShopDatabaseException($this->getMsgError());795.         }796.     }
  • DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments]
    420.                 $this->result = $this->_query($sql);421.             }422.         }423. 424.         if (_PS_DEBUG_SQL_) {425.             $this->displayError($sql);426.         }427. 428.         return $this->result;429.     }430. 
  • DbCore->query - [line 763 - classes/db/Db.php] - [1 Arguments]
    758.         if ($sql instanceof DbQuery) {759.             $sql = $sql->build();760.         }761. 762.         $this->result = false;763.         $result = $this->query($sql);764.         if ($use_cache && $this->is_cache_enabled) {765.             Cache::getInstance()->deleteQuery($sql);766.         }767. 768.         if (_PS_DEBUG_SQL_) {
  • DbCore->q - [line 514 - classes/db/Db.php] - [2 Arguments]
    509.         $sql = $insert_keyword.' INTO `'.$table.'` ('.$keys_stringified.') VALUES '.implode(', ', $values_stringified);510.         if ($type == Db::ON_DUPLICATE_KEY) {511.             $sql .= ' ON DUPLICATE KEY UPDATE '.substr($duplicate_key_stringified, 0, -1);512.         }513. 514.         return (bool)$this->q($sql, $use_cache);515.     }516. 517.     /**518.      * Executes an UPDATE query519.      *
  • DbCore->insert - [line 487 - classes/ObjectModel.php] - [3 Arguments]
    482. 483.         // Database insertion484.         if (Shop::checkIdShopDefault($this->def['table'])) {485.             $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list);486.         }487.         if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) {488.             return false;489.         }490. 491.         // Get object id in database492.         $this->id = Db::getInstance()->Insert_ID();
  • ObjectModelCore->add - [line 802 - classes/order/OrderDetail.php] - [2 Arguments]
    797.             }798.         }799. 800.         $this->original_wholesale_price = $this->getWholeSalePrice();801. 802.         return parent::add($autodate = true, $null_values = false);803.     }804. 805.     //return the product OR product attribute whole sale price806.     public function getWholeSalePrice()807.     {
  • OrderDetailCore->add - [line 445 - classes/ObjectModel.php] - [2 Arguments]
    440.      * @return bool Insertion result441.      * @throws PrestaShopException442.      */443.     public function save($null_values = false, $auto_date = true)444.     {445.         return (int)$this->id > 0 ? $this->update($null_values) : $this->add($auto_date, $null_values);446.     }447. 448.     /**449.      * Adds current object to the database450.      *
  • ObjectModelCore->save - [line 653 - classes/order/OrderDetail.php]
    648. 649.         // Set shop id650.         $this->id_shop = (int)$product['id_shop'];651. 652.         // Add new entry to the table653.         $this->save();654. 655.         if ($use_taxes) {656.             $this->saveTaxCalculator($order);657.         }658.         unset($this->tax_calculator);
  • OrderDetailCore->create - [line 678 - classes/order/OrderDetail.php] - [7 Arguments]
    673. 674.         $this->id_order = $order->id;675.         $this->outOfStock = false;676. 677.         foreach ($product_list as $product) {678.             $this->create($order, $cart, $product, $id_order_state, $id_order_invoice, $use_taxes, $id_warehouse);679.         }680. 681.         unset($this->vat_address);682.         unset($products);683.         unset($this->customer);
  • OrderDetailCore->createList - [line 364 - classes/PaymentModule.php] - [7 Arguments]
    359.                         PrestaShopLogger::addLog('PaymentModule::validateOrder - OrderDetail is about to be added', 1, null, 'Cart', (int)$id_cart, true);360.                     }361. 362.                     // Insert new Order detail list using cart for the current order363.                     $order_detail = new OrderDetail(null, null, $this->context);364.                     $order_detail->createList($order, $this->context->cart, $id_order_state, $order->product_list, 0, true, $package_list[$id_address][$id_package]['id_warehouse']);365.                     $order_detail_list[] = $order_detail;366. 367.                     if (self::DEBUG_MODE) {368.                         PrestaShopLogger::addLog('PaymentModule::validateOrder - OrderCarrier is about to be added', 1, null, 'Cart', (int)$id_cart, true);369.                     }
  • PaymentModuleCore->validateOrder - [line 59 - modules/cashondelivery/controllers/front/validation.php] - [9 Arguments]
    54. 55. 		if (Tools::getValue('confirm'))56. 		{57. 			$customer = new Customer((int)$this->context->cart->id_customer);58. 			$total = $this->context->cart->getOrderTotal(true, Cart::BOTH);59. 			$this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);60. 			Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->module->id.'&id_order='.(int)$this->module->currentOrder);61. 		}62. 	}63. 64. 	/**
  • CashondeliveryValidationModuleFrontController->postProcess - [line 178 - classes/controller/Controller.php]
    173.             if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {174.                 $this->setMedia();175.             }176. 177.             // postProcess handles ajaxProcess178.             $this->postProcess();179. 180.             if (!empty($this->redirect_after)) {181.                 $this->redirect();182.             }183. 
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
    362.             if (isset($params_hook_action_dispatcher)) {363.                 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);364.             }365. 366.             // Running controller367.             $controller->run();368.         } catch (PrestaShopException $e) {369.             $e->displayMessage();370.         }371.     }372. 
  • DispatcherCore->dispatch - [line 28 - index.php]
    23. *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)24. *  International Registered Trademark & Property of PrestaShop SA25. */26. 27. require(dirname(__FILE__).'/config/config.inc.php');28. Dispatcher::getInstance()->dispatch();
Edited by Rosha (see edit history)
Link to comment
Share on other sites

I added original_wholesale_price to the database. and it solved. but there is another problem:

[PrestaShopDatabaseException]

Duplicate entry '2-2' for key 'PRIMARY'

							INSERT INTO `ps_order_invoice_payment`
							SET
								`id_order_invoice` = 2,
								`id_order_payment` = 2,
								`id_order` = 4

How can i fix this one?!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...