Jump to content

marktomm90

Members
  • Posts

    6
  • Joined

  • Last visited

About marktomm90

  • Birthday 01/23/1990

Profile Information

  • Location
    Estonia
  • Activity
    Developer

marktomm90's Achievements

Newbie

Newbie (1/14)

2

Reputation

1

Community Answers

  1. @thepan: Thank You for Your suggestion, I had caching turned off, that didn't solve the problem. I found that there is another sql table named 'ps_product_attribute_shop' which, if I understand it the right way, also stores 'price impact' data (among other things) for a particular shop. After making the same changes to 'price' field there: mysql> UPDATE ps_product_attribute_shop SET price=11 WHERE id_shop = 1 AND id_product_attribute >= 1134; the corresponding values changed in the back office and in the front end.
  2. Hello! I have a shop with a lot of products which have a lot of combinations and prices for specific combinations vary (depending on the size, e.g. shoes with size 20-25 are 40EU, with 26-30 are 44EU). Changing every combination 'impact on price' one by one is a long boring task. So I wondered if there is a way to do it faster by modifying the corresponding SQL tables. I modified some 'impact on price' values for a specific product in back office (so I could later be sure I found the right place in SQL). I modified 'impact on price' value (tax. excl.) of two combinations with value '5' for a product with reference 490-01 and found relevant entries in 'ps_product_attribute' table. mysql> SELECT reference, price FROM ps_product_attribute WHERE reference='490-01' ; +-----------+-----------+ | reference | price | +-----------+-----------+ | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 5.000000 | | 490-01 | 5.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | +-----------+-----------+ After modifying the same product 'impact on price' values some more and seeing relevant changes in that table I was sure that I am in the right place. But the problem is that when I tried to change these values via SQL: UPDATE ps_product_attribute SET price=11 WHERE reference='490-01' AND id_product_attribute >= 1134; This made the table look like the following: mysql> SELECT reference, price FROM ps_product_attribute WHERE reference='490-01' ; +-----------+-----------+ | reference | price | +-----------+-----------+ | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 5.000000 | | 490-01 | 5.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 0.000000 | | 490-01 | 11.000000 | | 490-01 | 11.000000 | | 490-01 | 11.000000 | | 490-01 | 11.000000 | | 490-01 | 11.000000 | | 490-01 | 11.000000 | +-----------+-----------+ I basically changed the SQL the same way it would get changed if I modified 'impact on price' via back office, but it doesn't seem to work. After opening that product combination in back office I don't have these changes there (only those two '5.00' are there, which were modified in back office) and the front end also doesn't show the '11.00' impact on price for these specific combinations. Can anyone guide me what I am doing worng here? Thank You!
  3. The tables that modules create are irrelevant at the moment. I had a shop with lots of products set up. I made a clean install of prestashop on another server and I needed to move all products from the old shop, as well as their attributes and prices to the new one, so I exported the SQL database and imported it to the server with the clean install. Then I noticed that both shops now have the same hook positions for modules, which is what I don't need, so I manually replaced all the tables from the list above with the ones that are from the clean prestashop. Everything seems to be OK, but I wanted to make sure, so I asked this question to get expert advice, maybe I still missed something. Thank You in advance.
  4. Hello! Does anyone know exactly which tables in SQL store data about modules and their their positions in hooks. The relevant ones I managed to find are: ps_hook_module ps_hook_module_exceptions ps_module ps_module_access ps_module_country ps_module_currency ps_module_group ps_module_preference ps_module_shop Are there any else? Thank You!
  5. Hi, I have read prestashops' docs and searched the internet and couldn't find the answer. The prestashop tutorial on making a custom module shows how to change one value in module configuration menu. I am trying to make a <selection multiple="multiple"> type form to select multiple items from it and store them in a variable (DC_CATEGORIES) for later use. Unfortunately I am unable to accomplish this. Here is my code public function getContent() { $output = null; if (Tools::isSubmit('submit'.$this->name)) { $my_module_name = array(); $my_module_name = unserialize(base64_decode(Tools::getValue('DC_CATEGORIES'))); if (!$my_module_name || empty($my_module_name)) $output .= $this->displayError( $this->l('Invalid Configuration value'.$my_module_name) ); else { Configuration::updateValue('DC_CATEGORIES', base64_encode(serialize($my_module_name))); $output .= $this->displayConfirmation($this->l('Settings updated')); } } return $output.$this->displayForm(); } public function displayForm() { // Get default Language $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); $categoriesData = Category::getCategories( 0, true, false ); $categories = array(); foreach($categoriesData as $category) { array_push($categories, array( 'id_option' => $category['id_category'], 'name' => $category['name'] )); } // Init Fields form array $fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Settings') ), 'input' => array( array( 'type' => 'select', 'label' => $this->l('Set Categories'), 'name' => 'DC_CATEGORIES', 'multiple' => 'multiple', 'options' => array( 'query' => $categories, 'id' => 'id_option', 'name' => 'name' ) ) ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'button' ) ); $helper = new HelperForm(); // Module, token and currentIndex $helper->module = $this; $helper->name_controller = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; // Language $helper->default_form_language = $default_lang; $helper->allow_employee_form_lang = $default_lang; // Title and toolbar $helper->title = $this->displayName; $helper->show_toolbar = true; // false -> remove toolbar $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. $helper->submit_action = 'submit'.$this->name; $helper->toolbar_btn = array( 'save' => array( 'desc' => $this->l('Save'), 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name. '&token='.Tools::getAdminTokenLite('AdminModules'), ), 'back' => array( 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list') ) ); // Load current value $helper->fields_value['DC_CATEGORIES'] = Configuration::get('DC_CATEGORIES'); return $helper->generateForm($fields_form); } I tryed using base64_encode/decode because otherwise I would get the 'Error at offset' error (http://davidwalsh.name/php-serialize-unserialize-issues) Thanks in advance.
×
×
  • Create New...