Jump to content

theodiablo

New Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by theodiablo

  1. I'm reviving this topic because I think both answers given before are wrong. Maybe they are outdated? From the Prestashop Dev Doc: Customize the PDF files templates All PDF generated by PrestaShop are using Smarty templates and TCPDF as PDF rendering engine. You will find all theses templates in the pdf folder, for each use case managed natively by the Core. You can alter the Core files OR override them by copying them on themes/<your-theme>/pdf folder. It’s not possible to override a PDF template in a module. You can see more info here on how to customize the PDF template here: https://devdocs.prestashop.com/1.7/modules/concepts/pdf/ So to sum up: You can override the template files by copying them in your theme /php folder You can't edit the templates from a module Hope it will help someone. Good luck! ;-)
  2. Well, kind of like this one, but with hability to disable modules when users denied the use of cookies. I don't see this feature in the module you shared. I think that due to the importance of it, this sort of modules would deserve to be built and maintained by the Prestashop team.
  3. Hi, I think as legislations are evolving at the moment, it is mandatory to have a Cookie Banner in all European websites to allow the users to opt-in or out for Cookies. At the moment, I could only see payed modules to solve this issue. I think Prestashop should give a solution for this, as it is a mandatory feature for all websites, not doing it is keeping Prestashop behind other platforms which are giving free solutions for this! I don't think it would be really complicated to implement a module to do this, and it would make life may easier for everyone using Prestashop! Thanks in advance to the Prestashop team for considering this :-)
  4. Hi! Thanks a lot for your amazing job and contributions to the Prestashop Community for many years now :-) I wanted to know if there were a way to prevent users to post several comments on the same product? From what I see, at the moment, there is no restriction.
  5. Hi there, I have been trying for some time now to display the product variation image on the backoffice Order Detail's page in the product line. For some reason, it prints an incorrect image and I can't make it show the correct one. I have been trying to edit the getProducts from the AdminOrderController.php file, but it keeps showing an image from another product and I can't say why! This is my code right now: protected function getProducts($order) { $products = $order->getProducts(); foreach ($products as &$product) { $productInstance = new Product($product['product_id']); $combinationImages = $productInstance->getCombinationImages((int) Configuration::get('PS_LANG_DEFAULT')); $name = 'product_mini_' . (int) $product['product_id'] . (isset($product['product_attribute_id']) ? '_' . (int) $product['product_attribute_id'] : '') . '.jpg'; $attributeImages = Image::getBestImageAttribute((int) Configuration::get('PS_SHOP_DEFAULT'), (int) Configuration::get('PS_LANG_DEFAULT'), $product['product_id'], $product['product_attribute_id']); if(!empty($attributeImages)){ $attributeImage = new Image($attributeImages['id_image']); $product['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $attributeImage->getExistingImgPath() . '.jpg', $name, 80, 'jpg'); } else // Previous code here } } Here are my variations defined with the correct image associated: And as you can see here, the image displayed in the product line isn't correct: Here it should display the green image and not the blue one. I have cleared cache and deleted the cached thumbnail images which I know could cause errors, but it is still happening and I can't understand why 😞 Does anyone have this error before? How could I display the correct variation image? Thanks.
  6. Hello, I just migrated my shop from Woocommerce to Prestashop and I had to make a partial refund to one of my customers who made his purchase using Stripe. From there, I see several things that don't look right. Maybe this is the expected behaviour, but it seems pretty odd to me. The updated product list does show that a product has been refunded, however, in the totals, nothing has changed. It still shows the old price. (as you can see in the image attached) The user paid using Stripe, and the refund wasn't processed. I use the stripe_official module, I thought it would take care of this aspect as well, like in Woocommerce, I am surprise it doesn't seems to do the job. Does any of you have an idea if this is normal? Any recommendation? Thanks in advance, Theo.
  7. I have found an answer in another post: The way I did, consider the image file is named my-image-name.jpg: Place the image in the /assets/img folder of your theme In your template, use this to display the : <img src="{$urls.img_url}my-image-name.jpg"> Tadaaa... problem solved!
  8. It has been more than three years this post is without answer. I would love to know how to do this too! Anyone has an idea? :-)
  9. Hi @patdec, Have you found another solution for this? I am quite interested too. I want to avoid editing the core template files as much as possible and I would like to use a module or my own template to override this. Any idea how we could do this? Thanks a lot!
  10. Hi! What theme are you using? Is it possible that the theme has those strings hardcoded directly in the template file without using the translation system? Have you cleared the cache? Sometimes it might also work to remove the /var/cache/prod and /var/cache/dev folders
  11. I found the answer to my problem... In the core email templates, there were: {% extends '@MailThemes/modern/components/layout.html.twig' %} {% extends '@MailThemes/modern/components/layout.html.twig' %} Changing this to my theme solved this issue... Thanks anyway :-)
  12. Hi, I am trying to develop a new email theme. To do so, I created a new module as suggested here: https://devdocs.prestashop.com/1.7/modules/concepts/mail-templates/add-a-theme-from-module/ So far, so good, I manage to have the new theme appearing in the "Email Theme" menu. The thing is that when I generate the emails, nothing changes and I keep seeing the previous emails of the "modern" template. Here is my folders structure: / mails /* The original Prestashop emails & templates */ | en | es | themes | | classic | | | ... | | modern | | | ... modules | my-module /* The module where I have created my new custom theme */ | | mails | | themes | | | my-theme /* The new email template */ | | | | core | | | | ... /* All template files & folders */ themes | my-theme /* My custom FO theme where I have set my-module as dependency */ | | mails (empty) When I generate the emails, they are generated in the "themes > my-theme > mails" folder, however there are generated with the original "modern" template. I tried several things, generate the emails with core theme, then with "my-theme" theme, then overriding templates, clearing cache... I tried everything but it still takes the old templates. Any idea what I might be doing wrong?
  13. Hi there! I am creating a very simple module to extend email templating functionalities. I am trying to understand how Controllers, Adapters, Core and so on are working together. I want to get the carrier used given an order ID. What would be the best way to do this? From Prestashop official documentation, classes and Adapters are going to be removed in future major versions: https://devdocs.prestashop.com/1.7/development/architecture/introduction/ So which would be the best way, in a hook to do that? I am trying to use the GetOrderForViewing in Core Domain, but I am not really sure how to use this... At the moment when I build the object, it only has the orderId, how should I run the query? Thanks in advance. If there is a documentation somewhere which explains this, sorry in advance, I couldn't find it
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More