SQLSTATE[42S02]: Base table or view not found: 1146 Table 'calzadosbienve2023.ps_cart_rule' doesn't exist
at line 151 in file classes/db/DbPDO.php
146. protected function _query($sql)
147. {
148. try {
149. return $this->link->query($sql);
150. } catch (\PDOException $exception) {
151. throw new PrestaShopException($exception->getMessage(), (int) $exception->getCode(), $exception);
152. }
153. }
154.
155. /**
156. * Returns the next row from the result set.
372. {
373. if ($sql instanceof DbQuery) {
374. $sql = $sql->build();
375. }
376.
377. $this->result = $this->_query($sql);
378.
379. if (!$this->result && $this->getNumberError() == 2006) {
380. $this->connect();
381. $this->result = $this->_query($sql);
382. }
605. // This method must be used only with queries which display results
606. if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)) {
607. throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
608. }
609.
610. $this->result = $this->query($sql);
611.
612. if (!$this->result) {
613. $result = false;
614. } else {
615. if (!$array) {
413. $sql_part2 .= ' AND highlight = 1 AND code NOT LIKE "' . pSQL(CartRule::BO_ORDER_CODE_PREFIX) . '%"';
414. }
415.
416. $sql = 'SELECT SQL_NO_CACHE ' . $sql_part1 . $sql_where . $sql_part2;
417.
418. $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql, true, false);
419.
420. if (empty($result)) {
421. return [];
422. }
423.
3016. (int) Context::getContext()->cookie->id_customer,
3017. true,
3018. true,
3019. false,
3020. $this,
3021. true
3022. );
3023.
3024. $result = false;
3025. if ($this->id) {
3026. $result = Db::getInstance()->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'cart_cart_rule WHERE id_cart = ' . (int) $this->id);
3400. $cache_id = (int) (is_object($default_country) ? $default_country->id : 0) . '-' . (int) $dontAutoSelectOptions;
3401. if (isset(static::$cacheDeliveryOption[$cache_id]) && $use_cache) {
3402. return static::$cacheDeliveryOption[$cache_id];
3403. }
3404.
3405. $delivery_option_list = $this->getDeliveryOptionList($default_country);
3406.
3407. // The delivery option was selected
3408. if (isset($this->delivery_option) && $this->delivery_option != '') {
3409. $delivery_option = json_decode($this->delivery_option, true);
3410. $validated = true;
3473. {
3474. if (isset(Context::getContext()->cookie->id_country)) {
3475. $default_country = new Country((int) Context::getContext()->cookie->id_country);
3476. }
3477. if (null === $delivery_option) {
3478. $delivery_option = $this->getDeliveryOption($default_country, false, false);
3479. }
3480.
3481. $_total_shipping = [
3482. 'with_tax' => 0,
3483. 'without_tax' => 0,
91. $computePrecision,
92. $id_carrier = null
93. ) {
94. if ($id_carrier === null) {
95. $this->shippingFees = new AmountImmutable(
96. $cart->getTotalShippingCost(null, true),
97. $cart->getTotalShippingCost(null, false)
98. );
99. } else {
100. $products = $cartRowCollection->getProducts();
101. $this->shippingFees = new AmountImmutable(
349. *
350. * @param int|null $computePrecision Not used since 1.7.7.0, kept for backward compatibility
351. */
352. public function calculateFees($computePrecision = null)
353. {
354. $this->fees->processCalculation($this->cart, $this->cartRows, $this->computePrecision, $this->id_carrier);
355. }
356.
357. /**
358. * @return CartRuleCollection
359. */
150. public function processCalculation($computePrecision = null)
151. {
152. // calculate product rows
153. $this->calculateRows();
154. // calculate fees
155. $this->calculateFees();
156. // calculate discounts
157. $this->calculateCartRules();
158. // store state
159. $this->isProcessed = true;
160.
2168. $calculator->calculateFees();
2169. $amount = $calculator->getFees()->getInitialWrappingFees();
2170.
2171. break;
2172. case Cart::BOTH:
2173. $calculator->processCalculation();
2174. $amount = $calculator->getTotal();
2175.
2176. break;
2177. case Cart::BOTH_WITHOUT_SHIPPING:
2178. $calculator->calculateRows();
328. $products = array_map([$this, 'presentProduct'], $rawProducts);
329. $products = $this->addCustomizedData($products, $cart);
330. $subtotals = [];
331.
332. $productsTotalExcludingTax = $cart->getOrderTotal(false, Cart::ONLY_PRODUCTS);
333. $total_excluding_tax = $cart->getOrderTotal(false);
334. $total_including_tax = $cart->getOrderTotal(true);
335. $total_discount = $cart->getDiscountSubtotalWithoutGifts($this->includeTaxes());
336. $totalCartAmount = $cart->getOrderTotal($this->includeTaxes(), Cart::ONLY_PRODUCTS);
337.
338. $subtotals['products'] = [
496. } else {
497. $cart = new Cart();
498. }
499.
500. $templateVars = [
501. 'cart' => $this->cart_presenter->present($cart),
502. 'currency' => $this->getTemplateVarCurrency(),
503. 'customer' => $this->getTemplateVarCustomer(),
504. 'country' => $this->objectPresenter->present($this->context->country),
505. 'language' => $this->objectPresenter->present($this->context->language),
506. 'page' => $this->getTemplateVarPage(),
564. /**
565. * Initializes common front page content: header, footer and side columns.
566. */
567. public function initContent()
568. {
569. $this->assignGeneralPurposeVariables();
570. $this->process();
571.
572. if (!isset($this->context->cart)) {
573. $this->context->cart = new Cart();
574. }
6. * date: 2023-08-20 16:04:24
7. * version: 1.0.0
8. */
9. public function initContent()
10. {
11. parent::initContent();
12.
13. $this->context->smarty->assign(array(
14. 'HOOK_HEADER_LEFT' => Hook::exec('displayHeaderLeft'),
15. 'HOOK_HEADER_CENTER' => Hook::exec('displayHeaderCenter'),
16. 'HOOK_HEADER_BOTTOM' => Hook::exec('displayHeaderBottom'),
33. *
34. * @see FrontController::initContent()
35. */
36. public function initContent()
37. {
38. parent::initContent();
39. $this->context->smarty->assign([
40. 'HOOK_HOME' => Hook::exec('displayHome'),
41. ]);
42. $this->setTemplate('index');
43. }
314. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
315. $this->initHeader();
316. }
317.
318. if ($this->viewAccess()) {
319. $this->initContent();
320. } else {
321. $this->errors[] = $this->trans('Access denied.', [], 'Admin.Notifications.Error');
322. }
323.
324. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
505.
506. // Execute hook dispatcher
507. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
508.
509. // Running controller
510. $controller->run();
511.
512. // Execute hook dispatcher after
513. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
514. } catch (PrestaShopException $e) {
515. $e->displayMessage();
23. * @copyright Since 2007 PrestaShop SA and Contributors
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();