Jump to content

j.kaspar

Members
  • Posts

    38
  • Joined

  • Last visited

Profile Information

  • Location
    Czech Republic
  • First Name
    Josef
  • Last Name
    Kašpárek

Recent Profile Visitors

389 profile views

j.kaspar's Achievements

Newbie

Newbie (1/14)

4

Reputation

  1. @Janett, thank you for your advices. It turned out, that my assumption, that the reset action doesn't need any further programing and that it works "out of box" was wrong. The solution is simple: if (Tools::isSubmit('submitReset'.$this->table_name)) { Tools::redirectAdmin($this->context->link->getAdminLink('AdminTag')); } ... in the InitContent() function of my controller
  2. @Janett, I must be doing something wrong. I created a new controller that extends ModuleAdminController, Module::GetContent() is redirecting to it, the content is being handled by the new controller and displayed on a new admin tab, but unfortunatelly, the behavior is 100% same. Everything works, but the filter reset button.
  3. I found an interesting article regarding the ObjectModel here https://belvg.com/blog/objectmodel-activerecord-in-prestashop.html and also how to create a controller https://belvg.com/blog/how-to-use-the-class-admincontroller-in-prestashop.html
  4. I don't necessarily need either of those (multishop, multilang), but would be nice to know what difference does it make if I would. Many thanks for your help
  5. @Janett, I see. Thank you. I have a basic idea how to create a new contoller, like where to place the file, that it is going to be a new class extending ModuleAdminController etc. But If you could recommend me any guide or give me some tips, I will be glad. Thanks!
  6. @Janett, it is on a module configuration page, controller=AdminModules
  7. Hi, I have problem with a HelperList filter reset. On a form with a list created via HelperList $helper = new HelperList(); $helper->identifier = 'id_product'; $helper->table_id = 'js-product-list'; $helper->title = 'ProductList'; $helper->table = $table_name; $helper->simple_header = false; $helper->shopLinkType = ''; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->imageType = 'jpg'; $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $helper->no_link = false; I use filters which work fine, but the button supposed to reset the filter just behaves the same way as the actual submit buton - submits the filters. On click, the page reloads and the submitReset*** parameter is being set correctly. From what I found out, the reset should be functional by itself, with no need to program anything else. Other "prestashop native" lists work fine and the only difference I spotted is the fact, that after clicking on the "working" reset button, the "network" console in the browser shows, that the page is being loaded twice - once with the submitReset*** parameter set and then redirected with HTTP code 302 and loaded second time with filtering parameters unset. The mine one loads only once. No redirection happens. Can someone please help me to find the cause?
  8. Hi, I am trying to create a new module in prestashop 1.6.1.23, I want to use a jquery in the back office, on a product detail tab. To create the tab, I use a hookDisplayAdminProductsExtra function. The jquery is loaded and seems to be working. However, if I try to use a simple thing, like hiding an element, nothing happens. Simple scenario: The hook function public function hookDisplayAdminProductsExtra() { return $this->display(__FILE__, '/views/templates/admin/j_product_tab.tpl'); } he template <div class="aaa" id="abc">test</div> The script window.onload = function() { $(".aaa").hide(); } The result is: in a product detail, there is an extra tab. On the tab, there is a div with a word "test" in it. But it remains visible. Performing a test by adding if (window.jQuery) { alert("OK"); } else { alert("not OK"); } brings the desired result => an alert with "OK", so the jquery itself works. But since the product detail page uses a lot of other scripts, I have a suspition, that the scripts from my module are being somehow "blocked", "overriden"... It seemed to me, that switching the product detail tabs reloads the content of all other tabs, so I tried to run the script only when the extra tab is active. So I used a workaround in the script: var a = document.getElementById('abc'); a.onmouseover = doHide; function doHide() { $(".aaa").hide(); } Using this workaround, if I access the product page, switch to the extra tab and move a mouse over the element, the script runs successfully and the element hides. But I need to perform a more complicated things in the script, that doesn't run even when using this workaround. So I need to find the root cause. Does someone have an experience with this particular area (product detail) and using jquery? Any help will be greatly appreciated. Thank you!
  9. It turns out, that the div is being hidden, when the class=form-group is_customer_param. It looks like this else if (isGuest) { $('.is_customer_param').hide(); ..... code in order-opc.js does this.
  10. Hi, I use one page checkout in 1.6.1.13. In delivery address (order without registration), there are two fields for phone number - phone and phone_mobile. The "phone" is hidden by default. The DIV looks like this: <div class="form-group is_customer_param" style="display: none;"> <label for="phone">Telefon <sup>**</sup></label> <input type="text" class="text form-control validate" name="phone" id="phone" data-validate="isPhoneNumber" value=""> </div> I struggle to find out, where the style="display: none;" comes from. It is not in template files (order-opc.tpl / order-opc-advanced.tpl...), nor the scipts (order-opc.js...). I believe it has to be some script, that adds it dynamically. I need to have the DIV visible by default. Can anyone help, please? Edit: Just want to add, that I use a default-bootstrap template.
  11. In the end, the solution was simple. The "main" @php location should look like this: (only the first line is important in this context) location @php { try_files $uri /index.php?controller=404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/lib/php7.0-fpm/web6.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } and then, the error pages doesn't contain the 404 error_page 400 /error/400.html; error_page 401 /error/401.html; error_page 403 /error/403.html; error_page 405 /error/405.html; error_page 500 /error/500.html; error_page 502 /error/502.html; error_page 503 /error/503.html; error_page 504 /error/504.html; recursive_error_pages on; location = /error/400.html { internal; } location = /error/401.html { internal; } location = /error/403.html { internal; } location = /error/405.html { internal; } location = /error/500.html { internal; } location = /error/502.html { internal; } location = /error/503.html { internal; } location = /error/504.html { internal; } this way, the dead loop is avoided. Every 404 ends up on the prestashop's /index.php?controller=404, and other error pages are pure html.
  12. It is very interesting. Actually I had a lot of problems with mailchimp module too and also uninstalled it. It was filling my error log quite a lot. But I cannot say, if it helped with the original issue, because meanwhile, I moved the shop to VPS with nginx, php7, lot of resources etc., and it is sooo much faster, that this issue stopped bothering me immediatelly after the migration.
  13. Scully, thank you. Actually I tried this method, because despite I don't precisely know what it does, I saw it in the original .htaccess. But this method ended up in error 500 because of "rewrite or internal redirection cycle while internally redirecting to "/index.php" while sending to client". That, i believe, is due to this directive: location @php { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/lib/php7.0-fpm/web3.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } do you have experience with it? Do you see a way out? Thank you
  14. I don´t need any module. The page is there in apache, it must be possible to call it in nginx....
  15. Hi, I want to move my PS 1.6 to server with nginx. I am currently tuning the vhost file, to replace all features in apache's .htaccess What I have problem with now, is redirection to error page (404). I want to use standard page, as is in default theme (404.tpl). I am not able to find a way how to actually call it. I know, that the page is a product of pagenotfoundcontroller.php and 404.tpl template, but have no idea how to call it. What will the URI look like. Could someone please advise? Thank you
×
×
  • Create New...