Jump to content

gytske

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Location
    Lithuania
  • Activity
    Web development agency

gytske's Achievements

Newbie

Newbie (1/14)

4

Reputation

1

Community Answers

  1. @tovirio I think I know what this is, `mysql` program can't read the file, because the (default) settings of mysql don't allow it (for security reasons). I think you have to specify the filepath/folder where mysql is able to read files. I can't recall the specific error, just google `load data infile permissions`
  2. This error is not a PrestaShop error, it's an error from MySQL. This means that you should be looking to fix the permission for the user inside MySQL/phpMyAdmin. As for the insert statement, you can split it into chunks (lets say 500 per statement), that's what I've written in the second option. Make a `for` cycle and use a conditional: `if ($i %500)`, then take the 500 rows and build one big INSERT query. 10000 : 500 = 20 big INSERT queries.
  3. Hello, this is a very common rookie mistake: you should never to any queries inside a loop. If you have N lines, then you will execute N statements. Your goal is to execute as little statements as possible. Your options for fixing this are: - Build one big INSERT statement (You can insert more that one row at once, google SQL BATCH INSERT). - Build batch INSERT statements, but in chunks: insert 100 rows in one statment, then build another statement for 100 rows, then so on. I wouldn't recommend inserting anything more than a 1000 rows at once. - Open SQL transaction mode. When you open SQL transacton mode, the queries will be much, much faster. I can't get into details right now why it's so fast, but it's very useful for batch operations. Transaction are not really supported by PrestaShop, but you could technically open it if you know your way around PS. - Since you're loading rows from a file, you may want to look at LOAD DATA INFILE SQL statement. It would be by far the fastest way to insert your. I can predict that it would probably take 1-2secsonds instead of 7mins. It works well when you have exact table values ready go inside your file rows. Cheers
  4. So, inspired by laravel installer and laravel commands, I made a similar CLI installer for PrestaShop: https://packagist.org/packages/gskema/prestashop-installer Now, I know that PrestaShop already has a CLI installer. This installer actually does the downloading and extracting of the files. Once done, you may continue the installation by calling install/index_cli.php or viewing your website in the browser. This tool should mainly interest the developers (hopefully ) Cheers
  5. I'd like to see that. Standards = cleaner code! Also, on a similar topic: https://github.com/airbnb/javascript This is unofficial, but widely accepted. JS is a little bit messy at the moment
  6. @innovacy Hi, which PHPDoc comments are you going to fix? I was recently thinking about contributing fixed PHPDocs too. For example proper PHPDoc as AdminControllerCore, protected $object would be very useful; /*@var ObjectModel */
  7. Your has a point. Most themes have extra modules to manage layout/sliders/etc. Some of them are better than other. I think the most advanced modules come from LeoThemes (although they're definitely not perfect yet). I have also bought some crappy themes (TemplateMela). I think this themes is definitely one of the better ones. I have actually considered buying it myself one time. If you don't have any other altearnatives, this definitely a good choice. You shouldn't forget that a lot of the pages are cached - they work faster in reality. Buying good themes is a really good investement to your shop. Dont be afraid to spend money on quality theme.
  8. Thank you so much! I was just about to start investigating how to make these errors go away by writing my own extensions, and I found this. The solution is actually quite simple
  9. Hello everyone, I've been working with PrestaShop quite a while now and I found some bugs in prestaShop core code. I am developing some modules, and these bugs are in my way. Now ofcourse I coudl just make an override (which I am doing right now) and continue, but I would like to contribute to GitHub and have these bugs fixed. My problem is that I'm kind of still a Git rookie, I forked PrestaShop:1.6 branch and made a pull request. Later I read the documentation and everywhere it says that all changes should be posted to development branch. However, I can't find it anywhere. Available branches are: 1.6 master release admin-modules So which, branch should I be forking? The documents seem outdated? Thank you https://github.com/PrestaShop/PrestaShop/blob/master/CONTRIBUTING.md
  10. Hello, basically my module uses hookDisplayAdminProductsExtra() Currently it is a functions that manages eveything within itself -> grabs data, prepares form, returns it. But now I have written an ObjectModel for the data that this module handles. What would the best way to "hook it up". I would like to keep most code for this tab somewhere in a controller, which can prepare the fields and save the. This contrller ofc would be linked with the model. What is the way to call the controller to return the form? Or is this agaisnt best practices?
  11. Hello, I need to initiate some default table rows on module instalation. Tabl is hooked up with ObjectModel. What I would like to know, is there any way to perform a bulk insert (I have a an array of values) ? Currently the code inserts rows one by one : foreach($defaultParams as $defParam){ $newParam = new MyParams(); $newParam->active = $defParam['active']; $newParam->name = $defParam['name']; $newParam->abbr = $defParam['abbr']; $newParam->dim = $defParam['dim']; foreach($this->getLangIDs() as $landId){ $newParam->title[$landId] = $defParam['title']; } if(!$newParam->save()){ $this->uninstallFromStep(6); return false; } }
  12. Hello, I currently have an extra tab in Edit Product page : hook displayAdminProductsExtra hook actionProductUpdate Tab works fine, except for the fact that it is loaded via Ajax. This is causing some complications for me.Basically I need a little extra JS in my tab (it has some input forms). Initially I was putting that JS inline together with HTML (I used <script>). This was because I need to pass some variable to JS in order it to work. My problem is that when a tab is retrieved via Ajax, JS code might not be evaluated, because it wansnt there on document load. It works on chrome but Im afraid that it wouldnt work on other browsers. Some other options I have considered : - add JS file via displayBackOfficeHeader, but I cant do that since I need to emmbed some variables in JS - preload tab if such function exists in PS - stick with the way it is now (code retrieved from ajax is auto evaluated by chrome?). The coe is very hard to find since its not in DOM nor in file. It is in some VM local chrome variable. Any tips?
  13. Figured it out by now, but thanks anyway
  14. I'm trying to make my module more seo friendly, the module places small content block in footer/header/etc. Its has link to the module page, but its not very 'friendly' 'fc=module&module=modulename&controller=function1' Is there any way to check if friendly url exists for this path from inside the module (and then assign it to smarty)?
×
×
  • Create New...