Jump to content

MrGumby

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Location
    Czech republic
  • Activity
    User/Merchant

MrGumby's Achievements

Newbie

Newbie (1/14)

1

Reputation

1

Community Answers

  1. Hi, we are working with combinations and features extensively and I found myself solving the same problems again and again, so I decided to improve the BO combinations management a little bit. The improvements I focused on: + enable bulk actions with combinations including - bulk delete (done) - bulk duplicate with possibility of change certain values/attributes during copy (copy and change) - bulk edit (i.e. bulk price, image or weight edit) + moved edit form from top to bottom (!) so every time I want to save changes, I don't have to scroll all the way down from top over full list, which can be up to several hundreds of rows. This modification was the simplest, but most improving (done) + modify the list of combinations, so every attribute has own column and cols with no or zero values are not show so it saves some space and improves readability. (done) + integrate combinations generator directly into combination edit form, this needs a little changed habit with the generator, but it allows me to reuse one form for more actions (including bulk actions) + improve customer FO experience by dynamically hiding combinations that are not available for product (done) The preview of changes can be seen here During this work I have rewritten a great portion of AdminProductsController, admin-products.js and products.js as well as combinations.tpl, while combinations generator files will be no more needed. This is major change and as I will finish, I would need some good souls as a test monkeys Any volunteers can sign here and in any event, I will be happy for every your opinion about these changes. Cheers
  2. Hello vekia, you are right, that at many circumstances, concatenate translations together could result in confusing meaning, that's for sure. But there are moments, where it could save some time and storage space. After some research, i do not think, that using other translations from templates will ever be possible. On the other hand, in module class, one could call static methods of class Translate, to get AdminTranslation or PdfTranslation, but it is not very comfortable (i.e. one need to know admin controller, where this translation is used), but it could be somehow utilized. The problem is, I did not found method for front office translations, do you know, where it is?
  3. Hello fellow PrestaShoppers! I have one particularly usefull question: When one writes a module, can he use global translations? For example, there already exists translation like "(tax incl.)" in global PrestaShop translations, right? So why define new one in my module? It'll be waste of resources. But use (in smarty) {l s='(tax incl.)'} without defining mod='...' does not work. If there exists any way, how to use global translations in modules, it will be great!
  4. Hi, I have problem with product group (product pack) and combinations. Assume, you have two products with several combinations (attributes) and you want to create product group from the products, lets just say a product pack with better price. You can create product pack as new product and set that product as "product group" (hope I'm using the right sentence, I'm using czech language in backoffice), it is the 2nd choice at very beginning when creating new product: But product packs don't allow to assign combinations. Of course, you can upload several images, so your customers will see all possible variants and they will also see the products, from which the product packs is made up, so they can open detail of products, observe the combinations there and do the decision, but if they will buy the product pack, they are not forced to give you the information about what variant they choose. In other words, they will finish the order and you will receive it as order for product pack, where exist i.e. 10 possible combinations of one product, 10 possible combinations of second product and you don't know what the customer want. You can write into description something like "please, specify your chosen variant of products in comment during order process", but it is not comfortable to them, nor comfortable to you, and still you can't be sure, that they will provide you this info, so in the end in many cases, you will have to contact them and ask again. Do you know any solution to this problem? Any smart advice or module that can handle this? I know I can make new product not as product pack, but as ordinary physical product, give it name and price as for product pack and create combinations there, but it will be very laborious (assume 10 combinations for both products, you end with 100 combinations and who wants combine images of products and assign them to the right combination then).
  5. Hello, I have problem with blocktopmenu [top horizontal menu]. I rearanged my categories in catalog and from that time, top horizontal menu shows it wrongly. I tried: 1/ empty local cache 2/ empty server cache 3/ reconfigure the module 4/ reset the modul 5/ reinstall the module 6/ uninstall, get the module from latest prestashop 1.6.0.8 and install it manually still the same, I firstly suspect the cache, but I started to thing, that the problem will be with something else. Now I inspect the code of the module and try to understand how it works and where might be the problem. Everywhere else, the rearranged categories looks normal, problem is just with THM. I also do not see any thumbnails for categories. I saw here on the Forum, that some folks have them in their top horizontal menu, I also want it, is there any additional module for it? Cheers
  6. Hello, I use single, non-english language PS 1.6.0.6 and testing multi-language 1.6.0.8, both same problem with translations on Contact Form: In a select box "subject" options: ["webmaster","customer service"], it is fetched from DB table `contact` via function Contact::getContacts(), DB table `contact_lang` contains not translated values, it also contains non translated description displayed under select on onChange event. It appears to me, that this values are not translated during install, nor it is translated when add more languages. Rewrite this table by hand do the trick. On the other hand, the confirmation messages are translated OK for me.
  7. Hello fellow PrestaShopers, I have one shop, it runs PS 1.6, the site can be reached from the internet, but it not currently live shop yet. I run it on VPS, where was preconfigured Debian with ISPConfig. I quite dont like the configuration stuff, so I simply created one virtual host, installed PS and started playing with it. The thing is, occasionally, the site starts to slow down rapidly. The site is running for one month now, and I experienced it for the first time last week, when the site even crashed, I had to reboot server and then checked resource graphs. I saw strange disk operations there, now I experience it again and the performance graph looks like this: you can see massive CPU load at 18:00, then memory drop, at 4:00 AM, the netout peak is running backup, but the disk IO is really strange. I don't touch the page during this timespan, nor did anyone else I know, there is no automated script, than backup, so I suspect some malicious attack or some server bug. Can anybody with more experience in server configuration pointed me to the right direction?
  8. First solution: use javascript to load external script: function loadScript() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'http://my.remote.js'; document.body.appendChild(script); } or jQuery: $.getScript( "http://my.remote.js" ).done(function(script, textStatus ) { // callback [spam-filter]); there is only problem with asynchronous loading and caching remote file, but it can be (more or less) solved by not using shorthand $.getScript, but $.ajax: $.ajax({ url: 'http://my.remote.js', async: false, dataType: "script", cache: true, success: callback() }); but for me the jQuery do not worked, the script was loaded but callback was called after successful loading of the script, but before the remote script was executed. Because I downloaded remote file from google, I used their solution to this: I used plain JS function, inserted myCallback into global scope and then pass name of callback to the URL as GET parameter "callback": script.src = 'https://remote.google.js&' + 'callback=myCallback'; at the end of remote.google.js it calls window.myCallback() -- this way it works for me. //EDIT: still curious if there is any PS solution to bypass cache
  9. Try turn off javascript cache. Disable JS Smart Cache on admin tab Advanced Parameters >> Performance.
  10. Hello, I want add remote JS to page on hook. In module, I simply call $this->context->controller->addJS('//my.remote.js') and it worked on my development site, but as I uploaded it on production site, where is enabled smarty JS cache, it's not working, because Presta tries to encode it into cache from local file, which doesn't exists. I want preserve smarty JS cache, and I also want to keep JS on remote server, so the solution would be bypass the cache somehow, but if I write script tag into template .tpl, the script is also cached (it is so Smart, maybe little bit too much So, is there any way around?
  11. Hello, I have infobox in my form, which contains quite a lot of text. I want to format that text into paragraphs so basically I need to put two newlines `\n\n` between each paragraph. What is proper way of doing this, while use prestashop `l()` function? I think about two ways, but each one has its drawback. 1/ create each paragraph as single `l()` function and then insert these functions with `<br /><br />` tag between them. This way, the text is cutted into several chunks and this could make translation more difficult . 2/ write (somehow) newline into prestashop `l()` function, but write `\n`, into double quoted string, do not do any newline, and I can hardly think any better solution, so this is tricky. Also, is there any limit for length of string passed to `l()` function?
  12. Using PrestaShop 1.6.0.5 I want store information per supplier, per shop, so I decide create new column for it in `supplier_shop` table. Namely it is column `margin`. To be able to edit it from BO, I created override of AdminSupplierController and Supplier class. I can see values from DB when click edit, but when I click save, it throws error: Unknown column 'margin' in 'field list' UPDATE `ps_supplier` SET `id_supplier` = '2',`name` = 'name',`active` = '1',`date_add` = '2014-02-19 22:26:10',`date_upd` = '2014-04-01 22:00:18',`margin` = '50' WHERE `id_supplier` = 2 That is because it tries insert all data into `supplier` table, it did not create join with shop table counterpart, but it fetches data properly, so problem is only with insert statement. My overrides are like this: AdminSuppliersController.php class AdminSuppliersController extends AdminSuppliersControllerCore { // modify only this method public function renderForm() { ... // modify fields_form array $this->fields_form = array( 'legend' => array( 'title' => $this->l('Suppliers'), 'icon' => 'icon-truck' ), 'input' => array( array( 'type' => 'hidden', 'name' => 'id_address', ), ... // add this element to fields_form array( 'type' => 'text', 'label' => $this->l('Margin rate'), 'name' => 'margin', // experiment with add 'shop' => true did not help, but neither breaks anything 'shop' => true, 'col' => 2, 'hint' => $this->l('Basic margin for supplier, used to compute minimal price of items '), ... ) ), 'submit' => array( 'title' => $this->l('Save'), ) ); // call AdminController:: instead parent:: return AdminController::renderForm(); } } Supplier.php class Supplier extends SupplierCore { /** @var float supplier margin */ public $margin; public function __construct($id = null, $id_lang = null) { self::$definition['fields']['margin'] = array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isFloat'); parent::__construct($id, $id_lang); } } I searched for method that handles inserting in Supplier class, but I cannot get my head around it. If could someone lend helpful hand, It will be much appreciated.
  13. Using PrestaShop 1.6.0.5 I currently develop highly customized XML feed import. I need to store basic information about feed from each supplier. I would like to be able to see and edit feed data on supplier page in back office. Because it will occupy lots of fields, I would like to have it on separate tab. I mean side tab, as presented when editing product in BO. I inspect adminProductController and find properties and methods, that handles this behavior. I presume, that I need to copy this properties and methods to adminSupplietController override, but it surely will be more complex. I would probably need to create new templates and maybe rearrange the whole supplier controller. I tried find some topics about this, but without success. Did anybody have any experience with this or do you have any things and thoughts, that will point me to the right direction, i.e. link to helpful page, or just anything? Thanks in advance
  14. My brain betrayed me again. He and my eyes. I wrote wrong name of controllers folder inside module/override, and it gets me two days to find it! I should not bought this high DPI display. Anyway, now it is working. Sorry for wasting database.
  15. If anyone is courious, here is the whole module. It do not do anything usefull yet, just installs, override and basic configuration form...
×
×
  • Create New...