-
Posts
1,103 -
Joined
-
Last visited
-
Days Won
87
the.rampage.rado last won the day on January 15
the.rampage.rado had the most liked content!
About the.rampage.rado
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
the.rampage.rado's Achievements
-
Help with importing combinations
the.rampage.rado replied to the.rampage.rado's question in Technical help
@datakick, I think chatgpt made a working code for me but can you confirm there is something wrong in this mechanism or it's just a bug with my csv file (let's say using Cyrillic and making the encoded ajax call very big for this operation with so many lines, etc). During debuggint it advised the following is not working: Key Changes: Handling of crossStepsVariables: It now checks if crossStepsVars exists in the AJAX request and decodes it correctly. If crossStepsVars is missing or invalid, it initializes crossStepsVariables with empty arrays for groups, attributes, and deletedProducts. Extensive Logging: Logs the raw and decoded crossStepsVars at the start. Logs the final crossStepsVariables after the import step. Fallback for Missing Data: Ensures that crossStepsVariables is never empty or invalid, preventing errors in subsequent processing. Improved Structure: Cleaned up logic for handling results and reserved additional POST size for large imports. (of course I removed the logging from the following functions after debugging) Working versions for me that import the large file: public function attributeImport($offset = false, $limit = false, &$crossStepsVariables = false, $validateOnly = false) { $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); // Initialize groups $groups = is_array($crossStepsVariables) && array_key_exists('groups', $crossStepsVariables) ? $crossStepsVariables['groups'] : []; foreach (AttributeGroup::getAttributesGroups($defaultLanguage) as $group) { $groups[$group['name']] = (int) $group['id_attribute_group']; } // Initialize attributes $attributes = is_array($crossStepsVariables) && array_key_exists('attributes', $crossStepsVariables) ? $crossStepsVariables['attributes'] : []; foreach (ProductAttribute::getAttributes($defaultLanguage) as $attribute) { $attributes[$attribute['attribute_group'].'_'.$attribute['name']] = (int) $attribute['id_attribute']; } // Initialize deleted products $deletedProducts = is_array($crossStepsVariables) && array_key_exists('deletedProducts', $crossStepsVariables) ? $crossStepsVariables['deletedProducts'] : []; $this->receiveTab(); $datasource = $this->openDataSource($offset); static::setLocale(); $regenerate = Tools::getValue('regenerate'); $shopIsFeatureActive = Shop::isFeatureActive(); $lineCount = 0; for ($currentLine = 0; ($line = $datasource->getRow()) && (!$limit || $currentLine < $limit); $currentLine++) { $lineCount++; if (empty($line) || !is_array($line) || count(array_filter($line)) == 0) { $this->warnings[] = $this->l('There is an empty row in the file that won\'t be imported.'); continue; } $info = static::getMaskedRow($line); $info = array_map('trim', $info); try { $this->attributeImportOne( $info, $defaultLanguage, $groups, // by ref $attributes, // by ref $regenerate, $shopIsFeatureActive, $validateOnly, $deletedProducts // by ref ); } catch (PrestaShopException $e) { $this->errors[] = $e->getMessage(); } } $datasource->close(); if ($crossStepsVariables !== false) { $crossStepsVariables['groups'] = is_array($groups) ? $groups : []; $crossStepsVariables['attributes'] = is_array($attributes) ? $attributes : []; $crossStepsVariables['deletedProducts'] = is_array($deletedProducts) ? $deletedProducts : []; } return $lineCount; } public function importByGroups($offset = false, $limit = false, &$results = null, $validateOnly = false, $moreStep = 0) { // Check if the CSV file exists if (Tools::getValue('filename')) { $entityType = $this->getSelectedEntity(); $shopIsFeatureActive = Shop::isFeatureActive(); // If I am a superadmin, truncate table (ONLY IF OFFSET == 0 or false and NOT FOR VALIDATION MODE!) if (!$offset && !$moreStep && !$validateOnly && (($shopIsFeatureActive && $this->context->employee->isSuperAdmin()) || !$shopIsFeatureActive) && Tools::getValue('truncate')) { $this->truncateTables($entityType); } $doneCount = 0; $crossStepsVariables = []; // Get crossStepsVariables from the previous AJAX call if ($crossStepsVars = Tools::getValue('crossStepsVars')) { $crossStepsVars = json_decode($crossStepsVars, true); if (!empty($crossStepsVars) && is_array($crossStepsVars)) { $crossStepsVariables = $crossStepsVars; } else { $crossStepsVariables = ['groups' => [], 'attributes' => [], 'deletedProducts' => []]; } } else { $crossStepsVariables = ['groups' => [], 'attributes' => [], 'deletedProducts' => []]; } // Process based on entity type if (static::hasEntityType($entityType)) { $doneCount += $this->importGroup(static::getEntityType($entityType), $offset, $limit, $crossStepsVariables, $validateOnly, $moreStep); } else { // Fallback to original implementation switch ($entityType) { case static::ENTITY_TYPE_CATEGORIES: $doneCount += $this->categoryImport($offset, $limit, $crossStepsVariables, $validateOnly); $this->clearSmartyCache(); break; case static::ENTITY_TYPE_PRODUCTS: if (!defined('PS_MASS_PRODUCT_CREATION')) { define('PS_MASS_PRODUCT_CREATION', true); } $moreStepLabels = [$this->l('Linking Accessories...')]; $doneCount += $this->productImport($offset, $limit, $crossStepsVariables, $validateOnly, $moreStep); $this->clearSmartyCache(); break; case static::ENTITY_TYPE_COMBINATIONS: $doneCount += $this->attributeImport($offset, $limit, $crossStepsVariables, $validateOnly); $this->clearSmartyCache(); break; // Add other cases if needed case static::ENTITY_TYPE_CUSTOMERS: $doneCount += $this->customerImport($offset, $limit, $validateOnly); break; case static::ENTITY_TYPE_ADDRESSES: $doneCount += $this->addressImport($offset, $limit, $validateOnly); break; case static::ENTITY_TYPE_MANUFACTURERS: $doneCount += $this->manufacturerImport($offset, $limit, $validateOnly); $this->clearSmartyCache(); break; case static::ENTITY_TYPE_SUPPLIERS: $doneCount += $this->supplierImport($offset, $limit, $validateOnly); $this->clearSmartyCache(); break; case static::ENTITY_TYPE_ALIAS: $doneCount += $this->aliasImport($offset, $limit, $validateOnly); break; case static::ENTITY_TYPE_STORE_CONTACTS: $doneCount += $this->storeContactImport($offset, $limit, $validateOnly); $this->clearSmartyCache(); break; case static::ENTITY_TYPE_SUPPLY_ORDERS: $doneCount += $this->supplyOrdersImport($offset, $limit, $validateOnly); break; case static::ENTITY_TYPE_SUPPLY_ORDER_DETAILS: $doneCount += $this->supplyOrdersDetailsImport($offset, $limit, $crossStepsVariables, $validateOnly); break; } } // Handle results and progress if ($results !== null) { $results['isFinished'] = ($doneCount < $limit); $results['doneCount'] = $offset + $doneCount; if ($offset === 0) { // Compute total count only once $datasource = $this->openDataSource(0); $results['totalCount'] = $datasource->getNumberOfRows() - Tools::getIntValue('skip'); $datasource->close(); } if (!isset($moreStepLabels)) { $moreStepLabels = []; } if (!$results['isFinished'] || (!$validateOnly && ($moreStep < count($moreStepLabels)))) { $nextPostSize = mb_strlen(json_encode($crossStepsVariables)); $results['crossStepsVariables'] = $crossStepsVariables; $results['nextPostSize'] = $nextPostSize + (1024 * 64); // Reserve additional size $results['postSizeLimit'] = Tools::getMaxUploadSize(); } if ($results['isFinished'] && !$validateOnly && ($moreStep < count($moreStepLabels))) { $results['oneMoreStep'] = $moreStep + 1; $results['moreStepLabel'] = $moreStepLabels[$moreStep]; } } // Final log for current step $logMessage = sprintf($this->l('%s import'), $entityType); if ($offset !== false && $limit !== false) { $logMessage .= ' ' . sprintf($this->l('(from %s to %s)'), $offset, $limit); } if (Tools::getValue('truncate')) { $logMessage .= ' ' . $this->l('with truncate'); } Logger::addLog($logMessage, 1, null, $entityType, null, true, (int) $this->context->employee->id); } else { $this->errors[] = $this->l('To proceed, please upload a file first.'); } } -
Help with importing combinations
the.rampage.rado replied to the.rampage.rado's question in Technical help
Quotes don't help - the values get imported with them in the store (when the import succeeds). I managed to import few combinations but only if the file is very small (under 20 rows or so). I see that large files are split in multiple parts that are imported by ajax but I can't figure out what is breaking. So I looked at my file and found a row where a product had only color but not size associated with it (no stock is available). An easy fix - python script will exclude those and give me a list to remove them from my store. But then when I try to import the file without those unproperly formatted lines I get this error: And once again - if I make the file very small (~20 lines) it imports, but if I have 2k lines - this error appears... -
Help with importing combinations
the.rampage.rado replied to the.rampage.rado's question in Technical help
@312erik123 thanks, now I'll try your hint with the quotes. Regarding the position - the default demo csv gives only 0 and 1 for all positions, so I don't understand it at all. First I was thinking it was the position inside the drop down (speaking for Size attribute), later I saw on PS' forum that it is the order in which the attribute groups are shown in FO, which does not make any sense (first color, then Size, or vise versa). Then there was an opinion that they can be removed altogether and rely only on the positions inside the attribute group. Will make a shorter file and try this too. On one installation a file with ~2k rows throws this error on the 25th row, on another it does on ~1600th row. So not quite sure what is going on. Logger says only: -
I'm trying to make a python file that matches two files with information and generates me a CSV to import in my site. The output is as follows: But it can not be imported because of the following error: Errors occurred: Property ProductAttribute->name is empty I'm trying the following settings for Combinations import: Does anybody have some ideas? Also - what is the purpose of position value in Attribute and Value columns? I believe they should not increase per same product reference (according to the demo csv).
-
Cannot regenarate any images in TB 1.6
the.rampage.rado replied to movieseals's question in Technical help
Will this solve the issue with non regeneration of thumbnails? -
Cannot regenarate any images in TB 1.6
the.rampage.rado replied to movieseals's question in Technical help
Here is my configuration that works for Warehouse theme. Your theme should be similar (sizes are dependent on your theme so no need to change them as they should be left as the theme configured them when you updated to 1.6, only fix the entities). But I can't remember if this will fix your issue - the entities are used to show the already generated images I think in front office. Nevertheless it should be configured so go ahead and test, hopefully datakick can join with master suggestion for this issue. -
Cannot regenarate any images in TB 1.6
the.rampage.rado replied to movieseals's question in Technical help
Don't use any PS plugins related to images on TB 1.6. This section was totally rewritten and the plugins are 99.9% not compatible. In order to debug the issue - first check if there are any overrides remaining related to images when you remove the modules. Are there any errors, do you see any popup messages when regenerating? Do you have your Image Entities column configured (this is needed so the system know where to show what). -
Can't access to backofice in a new installation
the.rampage.rado replied to danwarrior's question in Technical help
I'm not sure how you can check the error then as you don't have BO access. 😞 EDIT: Are you sure your install works correctly (have all files uploaded, etc)? -
Can't access to backofice in a new installation
the.rampage.rado replied to danwarrior's question in Technical help
I just tested it on edge version and it works. What does the error say? -
Can't access to backofice in a new installation
the.rampage.rado replied to danwarrior's question in Technical help
Try this script. After you login and change your admin pass DON'T forget to remove this script from the site as everybody can use it to access your BO. -
I'm moving this topic to the correct forum section. Regarding the module - you can display the snippets anywhere you like in your theme. Take a look here how to add the appropriate code: https://store.thirtybees.com/shop-modules/premium-modules/faq-snippets There is even a way to display them in different places if you use multistore and want to do so - please, check my topic here.
-
Why are you still using PayPal? Their fees are outrageous. Look for a vPOS module from your bank or if not available get something like dedicated vPOS company with module for PS1.6. My fees are 1.3%, PayPal's is 3%... crazy... If you want to use it as 'a reputation enhancer' be sure that some well known vPOS provider will do the same for far less money.
-
Thank you! You have a PM. EDIT: Thank you for the quick fix! 10/10!
-
Hello again @Daresh, Just purchased the module, can you describe me how I can display it in a tab as your customer above?
-
TB Migration from 1.4 to 1.6 - Serious Help Needed
the.rampage.rado replied to Madhosh's topic in English
In the module settings you have to pick Custom target. Then when you open the file update part of the module you will be greeted by this menu where you can see all official releases: