Popular Post sakgiok Posted October 21, 2018 Posted October 21, 2018 (edited) I needed a COD with fee module and since I couldn't find what I was looking for (for free), I decided to make one myself. Some features: Compatible with multiple currencies and multiple shops Ability to either integrate the COD fee with the Carrier's fee, or add a dummy product in the order to reflect the fee, with configurable tax. Many parameters to check for in order to apply the fee (cart total, delivery country, delivery zone, carrier, customer group, product categories, manufacturers, suppliers). Many ways to calculate the fee (fixed value, percentage of the cart value or a combination of the two). All parameters are defined in conditions, which each calculates a fee if is validated. You can choose to use the first one that was validated, or add all of the successful ones to define the fee. Ability to test a scenario to see if your condition will produce the desirable fee. Ability to store all the purchases done with this module, with a complete log of how the fee was calculated. Ability to check (or autocheck if configured) for an update. I intend to keep updating it, so please let me know if you have any problems or suggestions. You can find it in github as well if you want to contribute (sakgiok/codwfeeplus). Edit: v1.0.9 added real time cart summary update during checkout for Prestashop v1.7 Edit: v1.0.10 fixed a bug with carriers not listed when they were added by a module. Edit: v1.1.0 added a condition type field to be able to disable module when these conditions are met, plus a bug fix and some color redesign (Control+F5 to reload the page to see the new css). Edit: v1.1.1 Taxes are now displaying correctly in PS1.7 cart summary and in PS 1.6-1.7 invoice and added some helpful buttons in condition parameter editing. Edit: v1.1.2 Order State is available to be configured plus some bug fixing and visual fixes. Some sanity checks added to make sure all condition values are present in Prestashop. Edit v1.1.3 Fixed a serious bug in payment validation. Edit v1.1.4 Fixed some bugs reported here (cart summary in PS1.7, tax displaying, reordering with COD Product etc). Edit v1.1.5 Added compatibility for PS versions 1.6.0.6 and 1.6.1.24. Edit v1.1.6 Fixed a bug for some PS versions < 1.6.1.0 and added provision for PS version 1.7.6.0 Edit v1.1.7 Added "States" field in conditions to validate against the state of the delivery address. Edit v1.1.8 Fixed a bug that prevented the module to work when installed fresh. Download: codwfeeplus_1.1.8.zip GitHub Link: https://github.com/sakgiok/codwfeeplus Demo: https://ps17demo.sakgiok.gr/admin107ak3oho Username: [email protected] Password: demodemo Edited August 12, 2019 by sakgiok Added github link (see edit history) 16 17 Share this post Link to post Share on other sites More sharing options...
Eolia Posted October 21, 2018 Posted October 21, 2018 Thanks @sakgiok ! Good contribution and it's nice to read well written code;) 1 Share this post Link to post Share on other sites More sharing options...
Soyons Solidaire Posted October 27, 2018 Posted October 27, 2018 (edited) Bonjour, Merci pour cet excellent partage. Edited October 27, 2018 by Soyons zen (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
Soyons Solidaire Posted October 27, 2018 Posted October 27, 2018 (edited) At installation and uninstallation I had this error, I join capture Edited October 27, 2018 by Soyons zen (see edit history) Share this post Link to post Share on other sites More sharing options...
Soyons Solidaire Posted October 27, 2018 Posted October 27, 2018 I found I have a conflict with the module fs redirect ? Share this post Link to post Share on other sites More sharing options...
sakgiok Posted October 27, 2018 Posted October 27, 2018 There is definitely a problem here and I'm not sure it's a conflict. I'll try to reproduce the error calling these hooks and see what it is looking for. I suppose the fsredirect module is a paid one, so I can't have access to the source to exactly reproduce the error, correct? 1 Share this post Link to post Share on other sites More sharing options...
sakgiok Posted October 27, 2018 Posted October 27, 2018 Thanks @Soyons zen for the heads up and all your help. The issue should be fixed now. I updated the attached file to the new version 1.0.8. Share this post Link to post Share on other sites More sharing options...
Soyons Solidaire Posted October 27, 2018 Posted October 27, 2018 Thanks you for your responsiveness, it works properly now 1 Share this post Link to post Share on other sites More sharing options...
Giordx Posted October 31, 2018 Posted October 31, 2018 Thanks sakgiok, very useful module! 1 Share this post Link to post Share on other sites More sharing options...
e-piazza.biz Posted October 31, 2018 Posted October 31, 2018 (edited) nice one! thanks! in PS 1.7.4.3. it creates a product for COD, but altough it's offline , in the block NEW PRODUCTS it shows empty products as you can see in the attached screenshot. to fix it, i created new products in order to replace the 8 items shown byt the module NEW PRODUCTS which apparently reads IDs from table product_id any suggestions? thanks Edited October 31, 2018 by e-piazza.biz (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted October 31, 2018 Posted October 31, 2018 (edited) Unfortunately I can't reproduce the error. In my setup (of a new prestashop 1.7.4.3 installation) I can't display the product on the front office anywhere, even if I enable it. The only way to display it is to enable it and set the visibility field in the Options tab of the product, to anything else than "Nowhere". Even though, when enable it and set the visibility, the name of the product should be displayed, as seen below. Maybe, something else, another module or modification is displaying these entries to your new products page? Edited October 31, 2018 by sakgiok typo (see edit history) Share this post Link to post Share on other sites More sharing options...
e-piazza.biz Posted October 31, 2018 Posted October 31, 2018 1 hour ago, sakgiok said: Unfortunately I can't reproduce the error. In my setup (of a new prestashop 1.7.4.3 installation) I can't display the product on the front office anywhere, even if I enable it. The only way to display it is to enable it and set the visibility field in the Options tab of the product, to anything else than "Nowhere". Even though, when enable it and set the visibility, the name of the product should be displayed, as seen below. Maybe, something else, another module or modification is displaying these entries to your new products page? 1 hour ago, sakgiok said: Unfortunately I can't reproduce the error. In my setup (of a new prestashop 1.7.4.3 installation) I can't display the product on the front office anywhere, even if I enable it. The only way to display it is to enable it and set the visibility field in the Options tab of the product, to anything else than "Nowhere". Even though, when enable it and set the visibility, the name of the product should be displayed, as seen below. Maybe, something else, another module or modification is displaying these entries to your new products page? yep! i get it. maybe it's another module or the bizkick theme i am using. thanks anyway. i managed to overpass it creating 8 new products Share this post Link to post Share on other sites More sharing options...
odemoncher Posted November 1, 2018 Posted November 1, 2018 Thanks @sakgiok ! Good contribution and it's nice to read well written code;) 1 Share this post Link to post Share on other sites More sharing options...
KulMaster Posted November 2, 2018 Posted November 2, 2018 (edited) Hi. Your module looks really helpfull, only one small issue. Would it be possible to add the fee to the final price, when the costumer chooses the COD payment method? It would be nice if the final price would be recounted before the customer does the final confirmation. Or maybe you can point me where I should change the code? Thank you. Edited November 2, 2018 by KulMaster (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 2, 2018 Posted November 2, 2018 I'm assuming you're talking about ps 1.7, since in ps 1.6 it you'll have to select the cod payment method and you'll get to a different page with the updated total. For ps 1.7 it's not very simple. The way I see it, there should be additional javascript to handle the changes of the payment method and display these changes on the cart summary, along with a ajax function in the validation controller to get the data. I examined the code in the Order controller that updates the cart summary, but I couldn't find anything that triggers an update when a payment method is selected, so an approach like the one I described above must be planned carefully, not to break the core functionality of prestashop. Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 8, 2018 Posted November 8, 2018 @KulMaster, @yama I updated the module, adding the feature you requested, doing my best to use original theme tpls to display the cart summary (and the cart review just above the pay button, if enabled), so it should work on any theme. Please let me know if you encounter any problems. 3 Share this post Link to post Share on other sites More sharing options...
zplus2 Posted November 19, 2018 Posted November 19, 2018 Great module, it works with PS 1.7.4.3 perfectly. Thank you very much for free sharing. 1 Share this post Link to post Share on other sites More sharing options...
Eusebio100 Posted November 19, 2018 Posted November 19, 2018 (edited) This module is compatible with prestashop 1.6? Edited November 19, 2018 by Eusebio100 (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 19, 2018 Posted November 19, 2018 5 hours ago, Eusebio100 said: This module is compatible with prestashop 1.6? Yes it is. Share this post Link to post Share on other sites More sharing options...
Eusebio100 Posted November 20, 2018 Posted November 20, 2018 hace 8 horas, sakgiok dijo: Sí lo es. I will prove it, Thank. Share this post Link to post Share on other sites More sharing options...
zplus2 Posted November 21, 2018 Posted November 21, 2018 Hello @sakgiok, I successfully have installed your module and it works great with most of my carriers. But one of my carriers is not listed in Carriers List and I don´t know why. This carrier was not added manually by me but automatically by an external module of this shipping company. I can see the carrier in BO Shipping - Carriers the same as the others. So there are 4 carriers in BO Shipping but only 3 in your module. Do you have any idea why it is not in the Carriers List when I am trying to add a new condition? Please check the images I attached. Thank you for your help. Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 21, 2018 Posted November 21, 2018 Hi @zplus2 Check the new version I uploaded out, it should fix the problem (along with renaming manufacturers to brands for PS1.7) 1 Share this post Link to post Share on other sites More sharing options...
zplus2 Posted November 21, 2018 Posted November 21, 2018 9 minutes ago, sakgiok said: Hi @zplus2 Check the new version I uploaded out, it should fix the problem (along with renaming manufacturers to brands for PS1.7) Yes, thank you, it works really great now. I have tried it with different countries and different currencies and everything is OK. Many many thanks. 1 Share this post Link to post Share on other sites More sharing options...
KulMaster Posted November 23, 2018 Posted November 23, 2018 On 11/8/2018 at 10:43 PM, sakgiok said: @KulMaster, @yama I updated the module, adding the feature you requested, doing my best to use original theme tpls to display the cart summary (and the cart review just above the pay button, if enabled), so it should work on any theme. Please let me know if you encounter any problems. Thank you. I unfortunately have one more issue. The total price is now right but I also need the VAT counted from the total price (with CoD Fee included) to be shown. Right now the VAT is counted only from the product prices and delivery fee, CoD fee is then added to total price (with VAT). That is misleading because the VAT counted and shown is not from the actual total price. When I use CoD fee as a product, the VAT is counted correctly, but only after the customer orders (in the confirmation e-mail). Nevertheless, I really appreciate your effort especially considering that your module is for free. Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 23, 2018 Posted November 23, 2018 6 hours ago, KulMaster said: Thank you. I unfortunately have one more issue. The total price is now right but I also need the VAT counted from the total price (with CoD Fee included) to be shown. Right now the VAT is counted only from the product prices and delivery fee, CoD fee is then added to total price (with VAT). That is misleading because the VAT counted and shown is not from the actual total price. When I use CoD fee as a product, the VAT is counted correctly, but only after the customer orders (in the confirmation e-mail). Nevertheless, I really appreciate your effort especially considering that your module is for free. Thanks for your kind words... To the issue now... In my installation, the default test shop with the default theme of PS 1.7, I can' t see an issue when ordering since all the prices are with tax included and no breakdown of tax is visible anywhere. The only place where tax is mentioned is in the confirmation mail and of course the invoice. Maybe there is an option to display prices differently? The tax option in the module is just for the breakdown in the confirmation email and the invoice and only active if the integration method is to add o COD product to the cart. The COD fee calculated is always with taxes and if the method is to add it to the carrier's fee, it is added to it after taxes. If it is COD product, the taxes rule option gets into effect and the tax breakout is visible in email/invoice but the fee to be paid is the same as calculated before. Share this post Link to post Share on other sites More sharing options...
Andrea Posted November 24, 2018 Posted November 24, 2018 Fantastic module. But I receive this error when I confirm an order: Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 24, 2018 Posted November 24, 2018 3 hours ago, Andrea said: Fantastic module. But I receive this error when I confirm an order: This error occured because the cart secure key and the customer's secure key didn't match (line 1605 in codwfeeplus.php) . AFAIK this is the expected way to deal with this situation by the default validateorder function and you should have received the same error no matter the payment module you used. I haven't come across with this error yet myself, but you can find some prestashop bugs still open if you google for it. So I'm not sure I can do anything in the module to fix this. Share this post Link to post Share on other sites More sharing options...
Andrea Posted November 24, 2018 Posted November 24, 2018 You're right! The problem was that I had updated prestashop and the parameters of the parameters.php file were not the same as the old installation. Now I copied them from the old file and everything works. Thank you! 1 Share this post Link to post Share on other sites More sharing options...
Nita Sorin Posted November 25, 2018 Posted November 25, 2018 Hi. I have a problem, i managed to use your module, but when i choose confirm order, it will redirect me to /module/codwfeeplus/validation, which doesn't exist. What should I do? Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 25, 2018 Posted November 25, 2018 What's your prestashop version? /module/codwfeeplus/validation should exist and you should be able to navigate there (in PS 1.6 at least). Do you get a 404 error? Share this post Link to post Share on other sites More sharing options...
Nita Sorin Posted November 26, 2018 Posted November 26, 2018 (edited) 7 hours ago, sakgiok said: What's your prestashop version? /module/codwfeeplus/validation should exist and you should be able to navigate there (in PS 1.6 at least). Do you get a 404 error? I’m using 1.7.4.4, and no, I don’t get 404 error, just a blank page. edit://now I’m getting this Edited November 26, 2018 by Nita Sorin update (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted November 26, 2018 Posted November 26, 2018 I think it's an php installation issue. Take a look here: https://github.com/PrestaShop/PrestaShop/issues/10640 In short it describes that the error occurs when php-intl extension is not present. Try to check if it's installed or not. Share this post Link to post Share on other sites More sharing options...
Laimonas Mituzas Posted December 3, 2018 Posted December 3, 2018 (edited) Hi, seems to me that module is great. Just can't understand, does it hides other payment methods after client chooses delivery method with COD? Because you have to choose shipping method after that payment method. or does it allows to assign COD payment method to specially created shipping with cod methods? Thanx Edited December 3, 2018 by LaimuX (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 3, 2018 Posted December 3, 2018 Hi @LaimuX, Delivery method and payment method are two different things in Prestashop. The Cash on Delivery (COD) method that this module uses, is only applied to the payment method and has nothing to do with carriers and shipping methods. When you select the COD with fee method in your order, you simply say that you will pay for it when you get the item, according to the shipping method you chose (maybe by a courier or even if you pick it up your self from the store). All this module does is add a fee when the client selects this method of payment and calculates that fee taking under consideration al lot of parameters. For instance, if you have the pick up from the store method for shipping, normally the extra fee for Cash on delivery payment is zero. I hope this covered you and I understood your question. Share this post Link to post Share on other sites More sharing options...
Laimonas Mituzas Posted December 3, 2018 Posted December 3, 2018 Thanx @sakgiok for explanation. My problem is that - COD can't be applied to all delivery methods in my case. Also client chooses delivery method earlier than payment. 1 Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 4, 2018 Posted December 4, 2018 I see... I'll work on something to disable this method on different situations... Thanks @LaimuX for the idea... Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 5, 2018 Posted December 5, 2018 @LaimuX, check the new version. You can now disable the payment method under specific conditions. Share this post Link to post Share on other sites More sharing options...
Laimonas Mituzas Posted December 6, 2018 Posted December 6, 2018 @sakgiok, Thank you, we will check it out Share this post Link to post Share on other sites More sharing options...
Josip Posted December 7, 2018 Posted December 7, 2018 Hi thank you for the plugin and your time. Its working great. One question: Is it possible to show tax in checkout process? See atachment. Like in the email conf. Thank you again and best regards Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 7, 2018 Posted December 7, 2018 Hi @Josip, how are displaying the taxes in the cart summary? Is that a separate module that you're using or did you make a custom tpl. I haven't seen any relevant option in the default PS 1.7 installation, that's why I'm asking. My module uses the default cart summary tpl to display the cart summary when a payment option is selected, injecting the COD fee. Share this post Link to post Share on other sites More sharing options...
Josip Posted December 7, 2018 Posted December 7, 2018 (edited) Hi @sakgiok, To be honest im not sure. I think i didnt use any custom module for that. I put on my 'product price' price with tax and without. In localization -> country -> my country edit -> mark "show tax inc." working exmpl. but for delivery - In delivery option on second step i choose my Tax rule. It adds tax from delivery + product, as you can see on the pict. above ... hmm Im testing on 1.7.4.4 but the same is on my second shop 1.7.2.4 https://www.hostknox.com/knowledgebase/225/How-to-display-the-tax-in-the-cart-in-PrestaShop.html Edited December 7, 2018 by Josip (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 7, 2018 Posted December 7, 2018 Yes, I found it... thanks for reporting this, I'll give it a look and try to fix it as soon as possible. Share this post Link to post Share on other sites More sharing options...
Josip Posted December 7, 2018 Posted December 7, 2018 7 minutes ago, sakgiok said: Yes, I found it... thanks for reporting this, I'll give it a look and try to fix it as soon as possible. Big Big Thank you. If you have paypal i will buy u a beer Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 8, 2018 Posted December 8, 2018 @Josip, should be working fine now... remember, the tax defined in the condition is only applied if the COD product is used. If the fee is added to the carrier's fee, the carrier's tax should be calculated for COD fee. There is a donate button in the info box in module configuration, but it's really not necessary to hit it... Thanks anyway though... Share this post Link to post Share on other sites More sharing options...
Josip Posted December 8, 2018 Posted December 8, 2018 (edited) 6 hours ago, sakgiok said: @Josip, should be working fine now... remember, the tax defined in the condition is only applied if the COD product is used. If the fee is added to the carrier's fee, the carrier's tax should be calculated for COD fee. There is a donate button in the info box in module configuration, but it's really not necessary to hit it... Thanks anyway though... @sakgiok Its working great. Thank you a lot for your time, speed... everything. Edited December 8, 2018 by Josip (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
Bocco Posted December 11, 2018 Posted December 11, 2018 On 12/5/2018 at 11:34 PM, sakgiok said: @LaimuX, check the new version. You can now disable the payment method under specific conditions. I can't disable cod when when pick up in store is selected. How can I do that? Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 12, 2018 Posted December 12, 2018 17 hours ago, Bocco said: I can't disable cod when when pick up in store is selected. How can I do that? Hi @Bocco, you can take a look in the demo shop I have (link and passwords in the first post) to see how I've set this configuration up. Essentially, if you have a condition with type "Module Activation", if this condition validates true, the module will be disabled. 1 Share this post Link to post Share on other sites More sharing options...
Offenback Posted December 12, 2018 Posted December 12, 2018 Hi @sakgiok, thanks a lot for your awesome module. Is there a way to have it in other languages? I'd like to contribute to you kind work once I've translated it to my language. 1 Share this post Link to post Share on other sites More sharing options...
Bocco Posted December 12, 2018 Posted December 12, 2018 22 minutes ago, Offenback said: Hi @sakgiok, thanks a lot for your awesome module. Is there a way to have it in other languages? I'd like to contribute to you kind work once I've translated it to my language. Go to Localizations/Translations and choose Installed modules translations, choose theme and default language - then modify. Help your self with search to find words you need to translate. Share this post Link to post Share on other sites More sharing options...
Offenback Posted December 12, 2018 Posted December 12, 2018 10 minutes ago, Bocco said: Go to Localizations/Translations and choose Installed modules translations, choose theme and default language - then modify. Help your self with search to find words you need to translate. Thanks a lot, @Bocco, for your kind help. Share this post Link to post Share on other sites More sharing options...
Bocco Posted December 12, 2018 Posted December 12, 2018 2 hours ago, sakgiok said: Hi @Bocco, you can take a look in the demo shop I have (link and passwords in the first post) to see how I've set this configuration up. Essentially, if you have a condition with type "Module Activation", if this condition validates true, the module will be disabled. Thx, now it works as I wished to. 1 Share this post Link to post Share on other sites More sharing options...
zahiras Posted December 16, 2018 Posted December 16, 2018 (edited) Thank You for the module! It looks very simple to use. It's sad that it's not working properly 😕 I can't make it work with the courier I need. I can see this courier in the "Courier list" tab, but it's not working. This courier is created automatically by an external module, I believe that cause the problems 😕 Prestashop Version: 1.7.4.4 Edited December 16, 2018 by zahiras (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 16, 2018 Posted December 16, 2018 @zahiras, can you give some more details? Which module are you using for this carrier? Maybe a test in the configuration page will give you more details why it doesn't validate the condition you need. Share this post Link to post Share on other sites More sharing options...
zahiras Posted December 16, 2018 Posted December 16, 2018 9 minutes ago, sakgiok said: @zahiras, can you give some more details? Which module are you using for this carrier? Maybe a test in the configuration page will give you more details why it doesn't validate the condition you need. It's our local courier "Omniva" and their module. The test results are: Condition passed validation. Calculating fee... Fixed fee of 1,50 EUR applied Contition's integration way is add to carrier's fee. Contition's tax for COD product is LT Standard Rate (21%). Fee calculated from this condition: 1,50 EUR But in the cart, there is no option to choose this payment with this courier 😕 My store is. www.miestomada.lt , if You have time to check it Share this post Link to post Share on other sites More sharing options...
zahiras Posted December 16, 2018 Posted December 16, 2018 I tried to change the Prestashop DB and set "0" in the Carrier table, "is module" row, but this did not help Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 16, 2018 Posted December 16, 2018 Can you check in Payment->Preferences if the COD module is enabled for all carriers, countries etc? 1 Share this post Link to post Share on other sites More sharing options...
zahiras Posted December 16, 2018 Posted December 16, 2018 3 minutes ago, sakgiok said: Can you check in Payment->Preferences if the COD module is enabled for all carriers, countries etc? Problem solved! Since all other carriers were working by default, I did not think to look it at there... Thank You for the module and Your help! 1 Share this post Link to post Share on other sites More sharing options...
shikotak Posted December 19, 2018 Posted December 19, 2018 Thank you @sakgiok for your grate module, but I have a problem. My conditions does not apply on shopping cart. I want some of the brands don"t have COD but it does n"t work, and the maximum value that customer can pay COD. it doesn't work. Maybe I do something wrong. Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 19, 2018 Posted December 19, 2018 Hi @shikotak take a look at my demo page (links at first post), at module configuration, I've set it up with the parameters you described and it seems to work as expected. The parameter with id 4 disables the module when a product in the cart belongs to the "Graphic Corner" brand, while condition with id 5 applies a fee of 10€ if the total cart value is smaller or equal to 100€, otherwise the fee is 0€. Let me know please if you had something else on your mind... Share this post Link to post Share on other sites More sharing options...
shikotak Posted December 19, 2018 Posted December 19, 2018 (edited) Hi @@sakgiok. Thank you for your quick reply. My conditions: 1- some categories can use COD method 2- apply when card value is lower than $100 3- some brands can use COD method 4- limit the carriers can use COD Is it possible to set all of the parameters in one condition? Edited December 19, 2018 by shikotak (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 19, 2018 Posted December 19, 2018 You'll have to make one condition for every case you want, e.g. one condition with all the categories that you don't want to use COD with, setting the type of that condition to Module Activation. One condition with all the brands that you don't want to use COD with, setting the type again to Module Activation etc. So three conditions, each one with categories, brands and carriers that you DON'T want COD with, and the type set to Module Activation. If by saying apply when cart value is lower than $100 you mean that, if value is higher than $100 you don't want COD to be available, you need one more condition, again with type Module Activation, and set the "Apply when cart total value is" to higher or equal to $100. That way, if the cart total is >=$100 the COD will not be active. If you mean, the fee will be some $$$ if cart total is lower than $100 but free from $100 and more, you need to make two conditions. One with cart value <=$99.99 which will calculate a fee and one with cart total >=$100 which will be with no fee. In that case though, make sure the >=$100 condition is higher in the list than the <=$99.99 one (the order of the Module Activation conditions doesn't make any difference, since once they are validated, the COD method will be unavailable anyway). And, of course, you can test a lot of scenarios with the test form, see the output of the validation process and "debug" it to change your conditions accordingly. 1 Share this post Link to post Share on other sites More sharing options...
sometimeThere Posted December 20, 2018 Posted December 20, 2018 sakgiok, you have made an amazing job, detailed and complete. Thank you for the COD module. One question: I have add an extra line on classes/PaymentModule.php in order to load the variable {gift_message} and send it through themes/classic/mails/el/order_conf.php when a client makes an order. PaymentModule.php (line 802) (Prestashop 1.7.4.2) '{gift_message}' => (($order->gift == '1') ? '<br><span style="color:#333;font-size:20px"><strong>ΕΚΔΟΣΗ ΤΙΜΟΛΟΓΙΟΥ</strong></span><br>Στοιχεία: <span style="color:#333"><strong>'.$order->gift_message.'</strong></span>' : ''), The thing is that, when I choose a payment other than your COD, the email displays correctly the line. When I choose your COD, it appears that the variable {gift_message} is not filling with any information. Do you have any clue why this is happening? Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 20, 2018 Posted December 20, 2018 (edited) Thanks @sometimeThere, the problem is that when you select to include the COD fee in the carrier's fee, the default validateOrder function is overridden to be able to change the carrier's fee... So, if you have a COD product as integration method (which uses the default validateOrder function) should work fine. To be able to work with "add to carrier's fee" method as well, you need to add the same line you added in the PaymentModule.php, to the codwfeeplus.php (around line 2150, function name is validateOrder_AddToCarrier). Of course, if you update the module, you need to make the same changes again... Edited December 20, 2018 by sakgiok (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
sometimeThere Posted December 20, 2018 Posted December 20, 2018 46 minutes ago, sakgiok said: Thanks @sometimeThere, the problem is that when you select to include the COD fee in the carrier's fee, the default validateOrder function is overridden to be able to change the carrier's fee... So, if you have a COD product as integration method (which uses the default validateOrder function) should work fine. To be able to work with "add to carrier's fee" method as well, you need to add the same line you added in the PaymentModule.php, to the codwfeeplus.php (around line 2150, function name is validateOrder_AddToCarrier). Of course, if you update the module, you need to make the same changes again... Excellent! It works fine. Thank you again 1 Share this post Link to post Share on other sites More sharing options...
karola Posted December 29, 2018 Posted December 29, 2018 Hi! I have error after choosing this payment method: Cytat (1/1) ContextErrorException Notice: Undefined index: id_product in ps_legalcompliance.php line 865 at Ps_LegalCompliance->hookDisplayProductPriceBlock(array('product' => array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array()), 'type' => 'unit_price', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 1))in Hook.php line 966 at HookCore::coreCallHook(object(Ps_LegalCompliance), 'hookdisplayProductPriceBlock', array('product' => array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array()), 'type' => 'unit_price', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 1))in Hook.php line 351 at HookCore::callHookOn(object(Ps_LegalCompliance), 'displayProductPriceBlock', array('product' => array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array()), 'type' => 'unit_price', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 1))in Hook.php line 903 at HookCore::exec('displayProductPriceBlock', array('product' => array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array()), 'type' => 'unit_price', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 1), null)in smarty.config.inc.php line 165 at smartyHook(array('h' => 'displayProductPriceBlock', 'product' => array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array()), 'type' => 'unit_price'), object(SmartyDevTemplate))in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call('smartyHook', array(array('h' => 'displayProductPriceBlock', 'product' => array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array()), 'type' => 'unit_price'), object(SmartyDevTemplate)))in 9721600ec5f263bbddae23ba9d18a5d5adbcf1e8_2.file.order_conf_product_list.tpl.php line 66 at content_5c2786fdd6ec90_28533609(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216 at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, null, null, 0)in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch('/home/mantis18/domains/konopland.pl/public_html/themes/konopland-new/mails/en/order_conf_product_list.tpl', null, null, null, false, true, false)in SmartyDev.php line 40 at SmartyDev->fetch('/home/mantis18/domains/konopland.pl/public_html/themes/konopland-new/mails/en/order_conf_product_list.tpl')in PaymentModule.php line 1100 at PaymentModuleCore->getEmailTemplateContent('order_conf_product_list.tpl', 1, array(array('reference' => 'demo_13', 'name' => 'PASTA KONOPNA CBD 50% 5ml', 'unit_price' => '839,20 zł', 'price' => '839,20 zł', 'quantity' => 1, 'customization' => array())))in codwfeeplus.php line 1941 at codwfeeplus->validateOrder_AddToCarrier(0.0, 38, '3', 839.20000000000005, 'Cash on delivery', null, array(), 1, false, '1c67381eca6afe8a602b07cd0e7182be')in validation.php line 98 at CODwFeePlusValidationModuleFrontController->validate_addToCarrier(0.0, object(Cart), object(Customer))in validation.php line 71 at CODwFeePlusValidationModuleFrontController->postProcess()in Controller.php line 270 at ControllerCore->run()in Dispatcher.php line 509 at DispatcherCore->dispatch()in index.php line 28 Can you please help me to solve the problem? Thanks in advance! Karolina Share this post Link to post Share on other sites More sharing options...
sakgiok Posted December 30, 2018 Posted December 30, 2018 Hi @karola, thanks for the feedback. There is a fix you can try, but unfortunately I can't be sure that the module will work as expected in all circumstances. I will fix it with an update (can't be sure exactly when, but won't be very long). Share this post Link to post Share on other sites More sharing options...
nahasaY Posted January 1, 2019 Posted January 1, 2019 hi' We need image mapping plugin and we would like to purchase that plug in from you. Please refer our attachment for your reference. If you arrange it very soon, it will be great help for us regards nahz, 2018-12-31-13-51-03.flv Share this post Link to post Share on other sites More sharing options...
Nicholas-Rise Posted January 2, 2019 Posted January 2, 2019 Works great, Thanks for creating this plug-in. 1 Share this post Link to post Share on other sites More sharing options...
sakgiok Posted January 3, 2019 Posted January 3, 2019 @karola your issue should be fixed now. Please let me know if it doesn't. Share this post Link to post Share on other sites More sharing options...
Soyons Solidaire Posted January 3, 2019 Posted January 3, 2019 Hello ,Thank you friend for this update. Happy New Year 2019 and your loved ones 1 Share this post Link to post Share on other sites More sharing options...
Vipktor Posted January 4, 2019 Posted January 4, 2019 (edited) HI I installed your module in 1.7.4.4 Unfortunately, after choosing the payment "cash on delivery" and completing the order I get an error "HTTP 500 error" on the page:http://www.testpresta.tcsklep.e-kei.pl/module/codwfeeplus/validation Can you help me ? Edited January 4, 2019 by Vipktor (see edit history) Share this post Link to post Share on other sites More sharing options...
sakgiok Posted January 4, 2019 Posted January 4, 2019 Hi @Vipktor, do you have access to the apache error logs to see what happened? Alternatively, you can enable the debug mode in Prestashop Admin (Advanced Parameters -> Performance) and this might produce some error messages to determine what's wrong. Share this post Link to post Share on other sites More sharing options...
Recommended Posts