Jump to content

LarsM

New Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by LarsM

  1. I had the same issue when trying to install/configure the "PrestaShop Marketing With Google" module: It prompted me to install ps_accounts, but it wouldn't (see attached screen-recording below). Then I downloaded the latest release of ps_mbo (make sure you get the right version for your current version of PrestaShop): https://github.com/PrestaShopCorp/ps_mbo And when I had installed ps_mbo, I could easily install ps_accounts.
  2. Good point. However, Ive already tried that: Using Notepad++ I have searched for terms such as "product_pricing_retail_price_tax_rules" but oddly enough there were no results. Maybe the select is auto-generated somehow?
  3. Thank you for the suggestion However, I would really like to learn how to do it myself So anyone who could point me in the right direction would be much appreciated
  4. I had the same issue in PrestaShop 8.1.1 and made this solution: In the file: /themes/XXXX/templates/_partials/head.tpl I changed this (lines 42-44): {if $page.canonical} <link rel="canonical" href="{$page.canonical}"> {/if} To this: {if $page.canonical} <link rel="canonical" href="{$page.canonical}"> {elseif $page.page_name == 'index'} <link rel="canonical" href="https://{$smarty.server.HTTP_HOST}/"> {/if} In additon to elisolution's answer above, this also checks whether we are actually on the home page (not just whether the canonical was set or not). I tested this solution a bit and as far as I can see, it works as expected. Otherwise, please let me know! Thanks PS: Remember to change "https" to "http" if your site isn't handling requests through the HTTPS protocol. You could fiddle with variables like $smarty.server.REQUEST_SCHEME or $smarty.server.HTTPS to check automatically, but it seemed like overkill to me, as I always use the HTTPS protocol on my websites these days.
  5. Does anyone know a way to automatically set the tax when creating a new product in PrestaShop 8.1.1? In Denmark, where I live, we have to pay a fixed rate of 25% VAT on everything. So, every time I create a new product, I have to remember to put the Danish 25% VAT (called "moms") for that product. That seems like an unnessecary manual step, when it should be possible to just set it automatically. Also, if I forget to add the 25% VAT, it will cost me 20% if someone buys the product. So... does anybody know a way to make PrestaShop set it automatically when creating new products? I found this old post: https://www.prestashop.com/forums/topic/159623-way-to-set-default-tax-rule-on-product-in-bo-scroll-down/?do=findComment&comment=2244166 That was actually a great solution for my needs (just overriding the template and setting "selected" one the desired tax-type in the <select>), HOWEVER as I have come to learn, they have changed the structure of PrestaShop since then, and that particular template is no longer there. So its no longer possible to do it as described in that post. Does anybody know how to do it with a similar solution (or perhaps how to make it set it in the SQL-query that creates the new product)? Thank you!
  6. Hi be_tnt I would really like to know if you found a solution for this? Thanks
  7. If anyone is looking for an updated answer, I have actually made a solution for PrestaShop 8.1.0, because I needed to develop a way to attach a PDF-file with Terms & Conditions to the order-confirmation-email. To do this, I simply made an override for the Mail.php-class and the magic was essentially done by these lines: if ($template == 'order_conf'){ $message->attach(Swift_Attachment::fromPath('TermsAndConditions.pdf')); } (where the PDF-file called "TermsAndConditions.pdf" must be placed in the root folder of the site) To make this solution, I created a file called Mail.php in the folder "\override\classes" of the PrestaShop-installation. In this file, I created a class that started with this line: class Mail extends MailCore { and then inside that class, I pasted the (entire) public static function called "send()", which I copied from \classes\Mail.php of the PrestaShop-installation. So, open the file \classes\Mail.php and copy the entire send()-function, which starts around line 132 and ends around line 669 - and then paste this function into the new extension class in "\override\classes\Mail.php", as mentioned above. And then insert these new lines: if ($template == 'order_conf'){ $message->attach(Swift_Attachment::fromPath('TermsAndConditions.pdf')); } right above these lines (found somewhere around line 505 in the new file, and line 604 in the original file, respectively): if (!empty($fileAttachment)) { // Multiple attachments? if (!is_array(current($fileAttachment))) { And then make sure that you have a PDF-file in the site's root-folder called TermsAndConditions.pdf If you want to know more about attaching files with Swift-mailer, you can find pretty good info here: https://swiftmailer.symfony.com/docs/messages.html#attaching-files Also, I would have liked to simply share my entire override-file to make it easier for you, but this forum-software wouldn't allow me to do so (maybe because of a faulty Cloudflare-implementation on prestashop.com). Someone should really look into this issue, as it prevents people from sharing solutions with each other. Not good for the open source community!!
  8. I know this is a rather old post, but in case anyone is looking for an updated answer; here is my solution... I made a solution for PrestaShop 8.1.0 I have overridden classes/Mail.php and essentially these are the lines that does the trick (where the PDF-file "TermsAndConditions.pdf" is located in the root of the site): if ($template == 'order_conf'){ $message->attach(Swift_Attachment::fromPath('TermsAndConditions.pdf')); } Basically it just says that if we are about to send an email-order-confirmation ($template == 'order_conf'), then attach the PDF-file "TermsAndConditions.pdf" (which must be placed in the root-folder of the site). To make it easy for you, I have attached my complete override-file, which should simply be uploaded to the folder: \override\classes of your PrestaShop-installation. So, in essence: 1) Upload a PDF-file called TermsAndConditions.pdf to the root-folder of your site, containing your terms and conditions. 2) Upload the attached override-file to the folder \override\classes of your PrestaShop-installation. Again, I developed this for PrestaShop 8.1.0 and I do not know whether it also works for other versions of PrestaShop. Edit: There was a server-error when I tried to upload the attached file, and then I tried pasting it into this answer and marking it as 'code', but it kept responding with an error. And then when I tried to post my answer, the Cloudflare-implementation of this forum suddenly told me that I was now blocked from the forum ... under normal circumstances I could see why I would be flagged as trying to do something illegal when trying to post code to at website, but this forum is about helping each other out by SHARING CODE!!! ...so the Cloudflare-implementation of this site is clearly a problem - and probably a major part of why there are seldomly any NEW solutions found here. Sad. Just sad.
×
×
  • Create New...