Jump to content

The50

Members
  • Posts

    18
  • Joined

  • Last visited

Profile Information

  • Location
    Lithuania
  • First Name
    Erikas
  • Last Name
    Tranauskas

Recent Profile Visitors

370 profile views

The50's Achievements

Newbie

Newbie (1/14)

1

Reputation

1

Community Answers

  1. Hello, I need to send specific variable back to product.tpl template file only after the function "add-to-cart", which as I understand refers to CartController.php controller. At the moment there is a whole page reload enabled after adding the product, so I would just need to somehow send some parameter to template. Which function should I use (if it's on Cart.php controller file) in which file? I tried adding the variable on initContent() function in CartController.php but the variable is still not available on product.tpl file. As I understand the problem here is that CartController.php doesn't render the product page, it only adds the product to the cart, but how can I find the redirect after add-to-cart action? I could pass some variables on that redirection and it should do the work.
  2. Hello, I have a problem with backend controller filters. The "Reset" button is missing, while the whole filter itself is working properly. The problem is that I can't reset the filter after I use it once. It looks like this: https://pasteboard.co/H5Cy8dJ.png How can I get the reset button?
  3. Hello, is it possible to make all the products available to see for a non "customer" group users? Or where I could put another group alongside "customer" so that a customer with my freshly created new group could see all the products (this particular customer would not have a group "customer").
  4. Hello, I have a problem with filter, I am using blocklayered module. After the product index it creates entries in table ps_layered_price with min and max price ranges. But the problem is that it takes the minimum price as a price without taxes. So for example if my product costs 7$, it's price without taxes is 5.90$. And if I filter my products by price with range from 5 to 10 dollars - it still shows this product with price of 7$ because it's non tax price is 5.90. Any ideas how to fix this?
  5. Yes, quality wouldn't be good, but I could make the whole image size a little bit smaller. So I guess there is no module or plugin ready for this functionality?
  6. Hello, I made an import of products into my site from another shop, including each product image. The problem is that each of the images is very small and after the import Prestashop creates thumbnails with size of 700x879 but the photo itself is the same small photo with big white corners around it. Is it possible to resize photos that they would be 700x879 size, but made bigger and resized to this very size? As example photos looks like this: https://pasteboard.co/GX5fESa.png I need it to be full sized, without white space. Any ideas?
  7. Hello, we are using the default Prestashop MainMenu module to get all the categories. The problem is that we need to collect all the manufacturers related to each category. Example: https://pasteboard.co/GSPOiud.png We should be able to see all the manufacturers which is related to each subcategory of "NAMAMS". Only way I can think at the moment is to get all the products from each sub-category, collect all the manufacturer ID's and store them in the main categories array. Is there any better way you could recommend?
  8. Hello, I have a problem. How can I call a contact-form function and have it on any custom CMS page I created? The page is created via backend and it uses cms.tpl template. Now I need to have contact-form.tpl inside it. I did an override of both CmsController.php and ContactFormController.php, but I don't know how can I call contact form from my CmsController.php. If you need more info - feel free to ask. I tried https://www.prestash...e-contact-page/ this tutorial, but the function from ContactFormController.php doesn't get called at all if I use only CMS custom page. Any ideas?
  9. Hello, I have a problem. How can I call a contact-form function and have it on any custom CMS page I created? The page is created via backend and it uses cms.tpl template. Now I need to have contact-form.tpl inside it. I did an override of both CmsController.php and ContactFormController.php, but I don't know how can I call contact form from my CmsController.php. If you need more info - feel free to ask. I tried https://www.prestashop.com/forums/topic/430454-tutorial-ps-16-adding-cms-content-to-the-contact-page/ this tutorial, but the function from ContactFormController.php doesn't get called at all if I use only CMS custom page. Any ideas?
  10. Sorry, already found the solution, just add the 'callback' parameter just like this: 'id_employee' => [ 'title' => $this->l('Creator'), 'type' => 'int', 'callback' => 'getEmployeeNameById', ], and put the name of the function which returns the result you want.
  11. Hey, Is it possible to apply a function to columns on field list helpers? As example I have my fields_list like this: $this->fields_list = [ 'id_employee' => [ 'title' => $this->l('Employee ID'), 'type' => 'int', ], ]; And now I want to apply a function which gets an employee name by it's ID.
  12. Hello, I made myself some extra data to add using the backend system using this tutorial. http://www.amauri.eng.br/en/blog/2016/03/developing-a-simple-module-with-crud-for-prestashop/ It creates new entries with some data in it, everything works fine in the backend. Now the problem is that I need the same CRUD system of the very same data in the frontend too. I guess that it's not possible to create it so easily using same Prestashop objects, they work only on backend, right? Just thought maybe someone could give me the heads up where should I start and how could I do it. I need to create everything from scratch I guess? First thing what I did is I made a module which collects this data from the database and puts it into the table. Now I need to add edit, delete and add functions to it.
  13. Hello, I need some help with creating a custom page. I follow some of the tutorials found in this forum, but I guess something has changed since 1.7 came out. My controller NewPageController.php: <?php class NewPageControllerCore extends FrontController { public $php_self = 'new-page.php'; public function setMedia() { parent::setMedia(); } public function displayContent() { parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'templates/new-page.tpl'); } } I access my site using following URL: http://localhost/prestashop_testing/en/index.php?controller=new-page Page name "new-page" is registered in SEO and URLs settings. Now I get the SmartyException, it says that the template name is missing. I see that self::$smarty->display() is deprecated already. Any ideas how can I call my template? EDIT: Found that other controllers now use initContent() function, everything works fine now. Now one more question, is it possible to have clean URLs? At the moment I access my page only via index.php?controller=new-page. Is it possible to make it /new-page only?
  14. Hello, I want to add my function onto the hook which is in my-account.tpl file. There is a hook named displayCustomerAccount. Now I need to add my function which adds extra fields inside that page. How can I attach it to the hook displayCustomerAccount? My function is in a module I created, but how can I attach my module onto that hook without editing displayCustomerAccount file? It's core file so I don't want to loose the ability to update my Prestashop.
  15. Yes I have a module and a function named hookActionCustomerLogoutBefore inside of it. I use die() inside that function but it doesn't work, logout still works as normal. Am I missing something? EDIT. oh yeah, I had to register the hook in my module. I thought that it's not necessary because the hook was already created.
×
×
  • Create New...