Jump to content

europablue

Members
  • Posts

    15
  • Joined

  • Last visited

Profile Information

  • Activity
    User/Merchant

europablue's Achievements

Newbie

Newbie (1/14)

4

Reputation

1

Community Answers

  1. I'm having trouble saving suppliers for a product. While editing/creating a product, I check a supplier, save/save & stay and the changes are saved to ps_product_supplier but this is not reflected in the product form. I am then able to add more suppliers (they are saved to ps_product_supplier), but since none are reflected in the form, I cannot remove or see the suppliers associated with a product. This is in Prestashop version 1.6.1.5, Multistore, Advanced Stock Management Any ideas? Thanks, - Joel
  2. Agreed. Copying a product, i.e. "Duplicate" a product has been broken for a long time. It leads to many problems & of course a lot of wasted time. Having multiple shops & more than one language installed makes things even worse. A products gets copied across _all_ shops, and _all_ languages - while of course not working properly to begin with. Besides fixing the broken functionality, we need an intermediary step where we choose what shops we want the duplicated product to appear in.
  3. Yes! All the account creation related errors I mentioned have been fixed by https://github.com/Shudrum/PrestaShop/commit/c243c8af08e94a1fd27f063e6ea2a30bd89c65f9
  4. I have now tested this with a fresh install of 1.6.1.3 on PHP 7.0.1 and no multistore this time. Same error. This appears to be where the problem occurs, where "field" = "lastname" and "$this->$field" is empty and does not validate. $message = $this->validateField($field, $this->$field); On both installations, if I set the Registration process type to "Standard (account creation with address creation)" I get the foll error: Country cannot be loaded with address->id_country Country is invalid Also, Without the patches at: https://github.com/PrestaShop/PrestaShop/pull/4503/files https://github.com/PrestaShop/PrestaShop/pull/4630/files The site crashes out with: PHP Fatal error: Uncaught Error: Access to undeclared static property: Validate::$data in /home/admin/web/domain.com/public_html/prestashop/classes/ObjectModel.php:1149 Stack trace: #0 /home/admin/web/domain.com/public_html/prestashop/controllers/front/AuthController.php(437): ObjectModelCore->validateController() #1 /home/admin/web/domain.com/public_html/prestashop/controllers/front/AuthController.php(256): AuthControllerCore->processSubmitAccount() #2 /home/admin/web/domain.com/public_html/prestashop/classes/controller/Controller.php(178): AuthControllerCore->postProcess() #3 /home/admin/web/domain.com/public_html/prestashop/classes/Dispatcher.php(367): ControllerCore->run() #4 /home/admin/web/domain.com/public_html/prestashop/index.php(28): DispatcherCore->dispatch() #5 {main} thrown in /home/admin/web/domain.com/public_html/prestashop/classes/ObjectModel.php on line 1149, referer: http://domain.com/prestashop/login?back=my-account
  5. This error only occurs during customer account creation from the front office. Employee & customer creation is fine from the backoffice is fine.
  6. Hi, I've just installed version 1.6.1.3 on a new server and while I've succeeded in working through a few issues, this one is a little beyond me (so far). It occurs when I try to create a new customer account. I enter the email on page 1, then First Name, Last Name, email & password on page 2, click "Register" and get the following. I am running on PHP 7.0.1, with changes as listed at: https://github.com/PrestaShop/PrestaShop/pull/4503/files https://github.com/PrestaShop/PrestaShop/pull/4630/files Any thoughts? All assistance is much appreciated. - Joel [PrestaShopException]Property Customer->lastname is empty at line 909 in file classes/ObjectModel.php 904. } 905. 906. $message = $this->validateField($field, $this->$field); 907. if ($message !== true) { 908. if ($die) { 909. throw new PrestaShopException($message); 910. } 911. return $error_return ? $message : false; 912. } 913. } 914. ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php]241. * @return array All object fields 242. * @throws PrestaShopException 243. */ 244. public function getFields() 245. { 246. $this->validateFields(); 247. $fields = $this->formatFields(self::FORMAT_COMMON); 248. 249. // For retro compatibility 250. if (Shop::isTableAssociated($this->def['table'])) { 251. $fields = array_merge($fields, $this->getFieldsShop()); ObjectModelCore->getFields - [line 487 - classes/ObjectModel.php]482. 483. // Database insertion 484. 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 database 492. $this->id = Db::getInstance()->Insert_ID(); ObjectModelCore->add - [line 229 - classes/Customer.php] - [2 Arguments]224. 225. /* Can't create a guest customer, if this feature is disabled */ 226. if ($this->is_guest && !Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) { 227. return false; 228. } 229. $success = parent::add($autodate, $null_values); 230. $this->updateGroup($this->groupBox); 231. return $success; 232. } 233. 234. public function update($nullValues = false) CustomerCore->add - [line 458 - controllers/front/AuthController.php]453. // New Guest customer 454. $customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0); 455. $customer->active = 1; 456. 457. if (!count($this->errors)) { 458. if ($customer->add()) { 459. if (!$customer->is_guest) { 460. if (!$this->sendConfirmationMail($customer)) { 461. $this->errors[] = Tools::displayError('The email cannot be sent.'); 462. } 463. } AuthControllerCore->processSubmitAccount - [line 256 - controllers/front/AuthController.php]251. if (Tools::isSubmit('SubmitCreate')) { 252. $this->processSubmitCreate(); 253. } 254. 255. if (Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) { 256. $this->processSubmitAccount(); 257. } 258. 259. if (Tools::isSubmit('SubmitLogin')) { 260. $this->processSubmitLogin(); 261. } AuthControllerCore->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 ajaxProcess 178. $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 controller 367. $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 SA 25. */ 26. 27. require(dirname(__FILE__).'/config/config.inc.php'); 28. Dispatcher::getInstance()->dispatch();
  7. Hi, Sorry for not updating this post. I did a lot of looking into this and found some serious issues. With regard to this matter, it seems Prestashop stores product quantities in 2 different tables! Yes, I know, it's a problem. When a product is duplicated it leaves out a table. I don't remember the details exactly, and I forgot to document it properly. I will do that later today (hopefully). In the mean time, this is the query that fixes it: UPDATE ps_stock_available, ps_stock SET ps_stock_available.depends_on_stock = 1, ps_stock_available.out_of_stock = 2, ps_stock_available.quantity = ps_stock.physical_quantity WHERE ps_stock_available.id_product = ps_stock.id_product Bear in mind I have multistore & advanced stock management enabled. Another issue is that form data isn't auto-trimmed, so trailing spaces are saved for crucial things like product reference, ISBN, etc. I fixed all this using PHP scripts as 3 tables need fixing, for example: $sql = "SELECT id_product, reference FROM ps_product ORDER BY id_product"; $result = mysqli_query($link, $sql); while ($row = mysqli_fetch_assoc($result)) { $id_product = $row['id_product']; $reference = mysqli_real_escape_string($link, trim($row['reference'])); $sql2 = "UPDATE ps_product SET reference = '$reference' WHERE id_product = $id_product"; $result2 = mysqli_query($link, $sql2); } $sql = "SELECT id_stock, reference FROM ps_stock ORDER BY id_stock"; $result = mysqli_query($link, $sql); while ($row = mysqli_fetch_assoc($result)) { $id_stock = $row['id_stock']; $reference = mysqli_real_escape_string($link, trim($row['reference'])); $sql2 = "UPDATE ps_stock SET reference = '$reference' WHERE id_stock = $id_stock"; $result2 = mysqli_query($link, $sql2); } $sql = "SELECT id_product_attribute, reference FROM ps_product_attribute ORDER BY id_product_attribute"; $result = mysqli_query($link, $sql); while ($row = mysqli_fetch_assoc($result)) { $id_product_attribute = $row['id_product_attribute']; $reference = mysqli_real_escape_string($link, trim($row['reference'])); $sql2 = "UPDATE ps_product_attribute SET reference = '$reference' WHERE id_product_attribute = $id_product_attribute"; $result2 = mysqli_query($link, $sql2); } I figured this out through several forum posts on various related issues: http://www.prestashop.com/forums/topic/1568[spam-filter]understanding-advanced-stock-management/page-2 http://www.prestashop.com/forums/topic/267979-prestashop-doesnt-update-stock-correctly/ http://www.prestashop.com/forums/topic/246543-change-products-qty-in-phpmyadmin-multistore/ http://www.prestashop.com/forums/topic/222884-1531-big-problem-with-product-quantity/ I hope this helps!
  8. I've discovered that for products that are created by duplicating an existing product (& then changing name & reference), product quantities are not displayed in the backoffice (catalog > products) or in the shop. I am able to change stock levels in the Stock Management area, and it shows correctly there, and I even get a warning about existing physical stock when I try to delete a product. There is no problem if I create a product from scratch (not by duplicating an existing product). Any ideas & assistance will be greatly appreciated! Thanks, - Joel
  9. OK, I figured it out. I had updated the product names in ONE SHOP AND ONE LANGUAGE ONLY (using multistore), and when I used adminer to check the database, I found the names for other shops & languages were unchanged. So, I wrote a php script to fix everything directly in the MySQL database. Another thing I fixed using a script is triming spaces at the start & end of product names, sometimes copied in when pasting. This also resulted in a hyphen at the start & end of link_rewrite, which also had to be fixed.
  10. Strange that there doesn't seem to be any other mention of this, still existing bug. I'm on 1.6.0.9 and this is a problem. Anyone have any ideas on how to refresh/synchronise the names?
  11. Hmmm, looks like this has to do with "profile permissions", because when I logged in as SuperAdmin, the error went away. I've adjusted some permissions, enabling as many as I was willing to and it's working OK now.
  12. Hi everyone, This is the error I've been getting when I click on "Details" for a product in Stock Coverage. This is for products that have multiple combinations set, and in a multi-store setting. Any help will be appreciated. - Joel [PrestaShopDatabaseException]Unknown column 'sa.id_product' in 'field list' SELECT SQL_CALC_FOUND_ROWS a.* , a.id_product_attribute as id, a.id_product, stock_view.reference, stock_view.ean13, stock_view.upc, stock_view.usable_quantity as stock FROM `ps_product_attribute` a INNER JOIN ( SELECT SUM(s.usable_quantity) as usable_quantity, s.id_product_attribute, s.reference, s.ean13, s.upc FROM ps_stock s WHERE s.id_product = 14 GROUP BY s.id_product_attribute ) stock_view ON (stock_view.id_product_attribute = a.id_product_attribute) WHERE 1 AND a.id_product = 14 AND a.id_product IN ( SELECT sa.id_product FROM `ps_product_attribute_shop` sa WHERE sa.id_shop IN (3, 2, 1, 5, 4) ) ORDER BY a.`id_product` ASC LIMIT 0,50 at line 635 in file classes/db/Db.php629. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);630. }631. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))632. {633. if ($sql)634. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');635. throw new PrestaShopDatabaseException($this->getMsgError());636. }637. }638. 639. /** DbCore->displayError - [line 325 - classes/db/Db.php] - [1 Arguments]319. if ($sql instanceof DbQuery)320. $sql = $sql->build();321. 322. $this->result = $this->_query($sql);323. if (_PS_DEBUG_SQL_)324. $this->displayError($sql);325. return $this->result;326. }327. 328. /**329. * Execute an INSERT query DbCore->query - [line 501 - classes/db/Db.php] - [1 Arguments]Argument [0] SELECT SQL_CALC_FOUND_ROWS a.* , a.id_product_attribute as id, a.id_product, stock_view.reference, stock_view.ean13, stock_view.upc, stock_view.usable_quantity as stock FROM `ps_product_attribute` a INNER JOIN ( SELECT SUM(s.usable_quantity) as usable_quantity, s.id_product_attribute, s.reference, s.ean13, s.upc FROM ps_stock s WHERE s.id_product = 14 GROUP BY s.id_product_attribute ) stock_view ON (stock_view.id_product_attribute = a.id_product_attribute) WHERE 1 AND a.id_product = 14 AND a.id_product IN ( SELECT sa.id_product FROM `ps_product_attribute_shop` sa WHERE sa.id_shop IN (3, 2, 1, 5, 4) ) ORDER BY a.`id_product` ASC LIMIT 0,50 DbCore->executeS - [line 2820 - classes/controller/AdminController.php] - [3 Arguments]2814. '.$having_clause.'2815. ORDER BY '.((str_replace('`', '', $order_by) == $this->identifier) ? 'a.' : '').$order_by.' '.pSQL($order_way).2816. ($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : '').2817. (($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : '');2818. 2819. $this->_list = Db::getInstance()->executeS($this->_listsql, true, false);2820. 2821. if ($this->_list === false)2822. {2823. $this->_list_error = Db::getInstance()->getMsgError();2824. break; AdminControllerCore->getList - [line 210 - controllers/admin/AdminStockCoverController.php] - [6 Arguments]204. * AdminController::getList() override205. * @see AdminController::getList()206. */207. public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)208. {209. parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);210. 211. if ($this->display == 'details')212. {213. $nb_items = count($this->_list);214. AdminStockCoverControllerCore->getList - [line 2016 - classes/controller/AdminController.php] - [1 Arguments]2010. */2011. public function renderList()2012. {2013. if (!($this->fields_list && is_array($this->fields_list)))2014. return false;2015. $this->getList($this->context->language->id);2016. 2017. // If list has 'active' field, we automatically create bulk action2018. if (isset($this->fields_list) && is_array($this->fields_list) && array_key_exists('active', $this->fields_list)2019. && !empty($this->fields_list['active']))2020. { AdminControllerCore->renderList - [line 153 - controllers/admin/AdminStockCoverController.php]147. GROUP BY s.id_product_attribute148. )149. stock_view ON (stock_view.id_product_attribute = a.id_product_attribute)';150. $this->_where = 'AND a.id_product = '.$id_product;151. $this->_groupBy = 'a.id_product_attribute';152. return parent::renderList();153. }154. }155. 156. /**157. * AdminController::renderList() override AdminStockCoverControllerCore->renderDetails - [line 1786 - classes/controller/AdminController.php]1780. $this->loadObject(true);1781. $this->content .= $this->renderView();1782. }1783. elseif ($this->display == 'details')1784. {1785. $this->content .= $this->renderDetails();1786. }1787. elseif (!$this->ajax)1788. {1789. $this->content .= $this->renderModulesList();1790. $this->content .= $this->renderKpis(); AdminControllerCore->initContent - [line 380 - controllers/admin/AdminStockCoverController.php]374. if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))375. {376. $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.');377. return false;378. }379. parent::initContent();380. }381. 382. public function initProcess()383. {384. if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) AdminStockCoverControllerCore->initContent - [line 180 - classes/controller/Controller.php]174. 175. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))176. $this->initHeader();177. 178. if ($this->viewAccess())179. $this->initContent();180. else181. $this->errors[] = Tools::displayError('Access denied.');182. 183. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className)))184. $this->initFooter(); ControllerCore->run - [line 373 - classes/Dispatcher.php]367. // Execute hook dispatcher368. if (isset($params_hook_action_dispatcher))369. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);370. 371. // Running controller372. $controller->run();373. }374. catch (PrestaShopException $e)375. {376. $e->displayMessage();377. } DispatcherCore->dispatch - [line 54 - admin/index.php]48. $_POST['controller'] = strtolower($_POST['tab']);49. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab']))50. $_REQUEST['controller'] = strtolower($_REQUEST['tab']);51. 52. // Prepare and trigger admin dispatcher53. Dispatcher::getInstance()->dispatch();
  13. Just ran into this issue myself. This appears to be a completely arbitrary decision by someone. Dimensions are integers while prices for shipping run up to 5 (!!!???) decimal places. Anyway, my solution is to round up all fractional dimensions to integers and (more or less) hope for the best. That will have to do until/if this is fixed at some point, or I find the time to fix it myself (while leaving the installation safe for upgrades).
  14. Hi Fabien, While it's great that work is being done to keep it from crashing, it's strange that no progress is being made on it's functionality. Referring to http://forge.prestashop.com/browse/PNM-4 Sorry to butt into this thread, but I think it's relevant. Thanks for your work putting all this together.
×
×
  • Create New...