Jump to content
sakgiok

[Free Module] Cash on Delivery with fee PLUS PS 1.6-1.7

Recommended Posts

20 minutes ago, monxas said:

I haven't been able to install this module. im using 1.6.1.23 and I upload the module but it doesnt appear in the list of modules. (it says properly added though) I checked via ftp and its properly uploaded. I checked the database and no emtry for the module is created. I added it manually and it does appear but then when clicking on configure it says controller not found.

HI, you wash installed from the back office ?

Edited by Soyons zen
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, monxas said:

I haven't been able to install this module. im using 1.6.1.23 and I upload the module but it doesnt appear in the list of modules. (it says properly added though) I checked via ftp and its properly uploaded. I checked the database and no emtry for the module is created. I added it manually and it does appear but then when clicking on configure it says controller not found.

As @Soyons zen said, you need to upload and install it from the back office. Download the zip from the first post, go to your modules page in your store's backoffice and click on the Add a new module button on the top-right corner. There you can upload the zip file and the module should be installed. Also, all the updates are applied the same way, just installing the new version over the old one.

Share this post


Link to post
Share on other sites

Hi @sakgiok thank you for this module!

I installed it today and it worked very well.
I only have the problem with the cart summary update that other users has shown.


In my case the problem was the $address_id in the ajax.php file.

The function getTaxAddressId give me an error, and now i commented that.

Can you please check it?

Thank you again.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @Marco Cianetti

thanks for the report, this is indeed the problem. I have already replaced that function but  I need to test some other tests on some other versions of Prestashop before  I release an update, plus some other minor bugs that I have to test as well.

Share this post


Link to post
Share on other sites

Is it possible to get this module for prestashop 1.4.9?

 

Share this post


Link to post
Share on other sites
On 1/28/2019 at 1:58 PM, crisrodreyes said:

Hello, I have a problem with this module.

(sorry about my english, because it is very bad).

The products are shown on my website without taxes, and later, in the summary car, you can see all the taxes calculated and the total amount with that taxes.

So, the problem is, this module show the COD fee with taxes in the summary cart. That produces confusion in my costumers because they see that if they add together the subtotales, the result is not the same... I don't know if you know what I mean...

Attached two exemples:

999.jpg.c9c962b1a0999e1767e808c7d9244010.jpg

 

998.jpg.d2de103ae4bbfbe338f8e05cdac9ebf0.jpg

Regards!

I have the same problem!!

Even when my COD cost is 0€ something is calculated wrong in Total Cost!

image.png.4f479d17d8c04e0ce2207b75e2579c36.pngwith bank payment

image.png.f2822e7873d3f419382a37737daaff71.pngwith 0€ COD

Its like the total amount field is moving down so it calculates wrong!

  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, Bocco said:

Is it possible to get this module for prestashop 1.4.9?

 

I don't know how much of the module have to change to support this version. Right now, even version 1.6.0.9 has issues. The next version is going to support 1.6.1.xx to 1.7.5 and I'll see if it can be converted to support previous versions.

Share this post


Link to post
Share on other sites
2 minutes ago, sakgiok said:

I don't know how much of the module have to change to support this version. Right now, even version 1.6.0.9 has issues. The next version is going to support 1.6.1.xx to 1.7.5 and I'll see if it can be converted to support previous versions.

OK. I have presta 1.7.5 - it works fine here.

For 1.4.9. - ok, if there is no module for this version. I

 

Share this post


Link to post
Share on other sites

HI Sakgiok,

i just installed your module on PrestaShop 1.6.1.5 and works fine.
If I am correct, your module can set the value of the fee according to value or category.

How to activate or disable the cash on delivery according to category or manufacturer?
I don't need to change the value of the fee, I would like to:
- disable the cod payment for some categories/manufactures, so it won't be displayed as a payment for some categories/manufactures. IS that possible?

Thanks
Navid

 

Share this post


Link to post
Share on other sites
39 minutes ago, 911636_1508423853 said:

HI Sakgiok,

i just installed your module on PrestaShop 1.6.1.5 and works fine.
If I am correct, your module can set the value of the fee according to value or category.

How to activate or disable the cash on delivery according to category or manufacturer?
I don't need to change the value of the fee, I would like to:
- disable the cod payment for some categories/manufactures, so it won't be displayed as a payment for some categories/manufactures. IS that possible?

Thanks
Navid

 

Hi Navid,

you can add conditions, setting the type to "DEACTIVATE MODULE". You may have to add more than one condition to meet your criteria exactly though (e.g. one for categories and one for manufacturers). If any of these conditions are validated, the module will be deactivated.

You can always test your setup with the test form to be sure and see the steps taken to come to the desired solution.

Share this post


Link to post
Share on other sites

Hi,

   I am using this module https://thrive.qa/prestashop/sway in English version it is working fine,  whereas.. in Arabic any other.... Especially in RTL getting error as i attached. 

  Same error i am getting if i use free prestashop COD module. 

 

kindly please help me regarding this....

  

Screen Shot 2019-02-06 at 3.26.33 PM.png

Share this post


Link to post
Share on other sites

Hi @thrive,

it seems this occurs during the creation of the (invoice?) pdf. I'll try to reproduce it to see exactly what causes the error. What version of PS are you using? 

  • Like 1

Share this post


Link to post
Share on other sites

Hi sakgiok,

Looks like a fantastic module, but I can't seem to get it uploaded. Look at the snip below. I can't see it on server in modules/ either.

Any ideas? I am using prestashop 1.6.1.22

CODsakgiok.thumb.PNG.ed8ab7eb1f7d298def94ff2da0f61472.PNG

Any help would be appreciated!

Thanks,

Milan

Share this post


Link to post
Share on other sites

Hi sakgiok,

Sorry, my bad, for some reason the link to download didn't work in this thread and I checked it in github and that one didn't seem to do upload. Just tried to download from first post here and it worked and it also uploaded. still have to setup! Thanks for the great module tough!

Where is paypal donate button? 

Thanks

  • Thanks 1

Share this post


Link to post
Share on other sites

@Sibirksacedra,

Yeah, no worries friend, thanks for the clarification... 

There is a donate button in the about form, in the module settings, but it's really not necessary...

At another subject, I'm on final testing for the next update (a lot of versions of PS with a lot of differences between them), solving hopefully all issues reported here...

Share this post


Link to post
Share on other sites

New version finally uploaded (see original post) fixing (hopefully) all the problems reported to me.

A note about compatibility. There are a lot of versions of Prestashop out there with a lot of differences. I tested the module with various versions from 1.6.0.x to 1.7.5.0 and it seems it works as intended. There might be a version that I missed checking that has some things entirely different and the module might brake. Please report your version with any bug report to help me recreate the problem and hopefully fix it.

When reordering and your order has a COD Product in it, most PS versions will take you to the cart summary with an error that you cannot order that product. The solution I thought, is to have javascript remove the COD Product in a situation like this, so the customer can continue the order. There are some early PS 1.7 versions that will not display the cart with the error and go directly to checkout. Unfortunately, I can't think of anything to avoid or correct that (other than editing core files and adding overrides, which I'm not going to do).

Finally, I saw sometimes blank validation screens, or the server threw a 500 error at some cases. I found out these errors were due to php meeting the script memory limit (was 128M at my dev machine). I made some adjustments to code and for any test I made afterwards (with default Prestashop installations - no other custom modules loaded) I didn't see an issue. If you get some similar results (the browser just takes a lot of time to display the page and when it ends trying you get a blank page, or http 500 errors), try to increase this limit in your php.ini file (the entry is memory_limit), e.g. the previous value + 32M...

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Hi, Thank you brother for this excellent sharing
 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 2/6/2019 at 4:05 PM, sakgiok said:

Hi @thrive,

it seems this occurs during the creation of the (invoice?) pdf. I'll try to reproduce it to see exactly what causes the error. What version of PS are you using? 

yes... i had issue with PDF tpl files... transation strings... i updated that... now it is working fine. thanks a lot.

  • Thanks 1

Share this post


Link to post
Share on other sites

hi, 
i'm back with a new issue. 

i paused the project for a while and this week got back to it with a new fresh installation of PS 1.7.5.1.

i keep receiving this error msg in your module:

COD product was not found in database. Use the button to recreate it. (Product ID: 0)

 

i could not find any referenc inthis thread. any help?

 

thanks

Share this post


Link to post
Share on other sites

Hi @e-piazza.biz

I assume you used the recreate product button. Any error messages? Please try with debug mode on to pinpoint the problem.

Share this post


Link to post
Share on other sites
9 hours ago, sakgiok said:

recreate product button

that's my problem: i read that part but could not find the RECREATE button.

Share this post


Link to post
Share on other sites

It's called Reset COD Product, on the top right corner.

Share this post


Link to post
Share on other sites
3 hours ago, sakgiok said:

It's called Reset COD Product, on the top right corner.

i thought so, and tried that already.

received -> Failed to reset COD Product.

where should I look into the code to manually fix it?

Share this post


Link to post
Share on other sites

Hi.

Module worked like charm, but now I am facing problem.

I migrated data from previous shop with module One click migration. After uploading data module COD stops working. When trying to configure it, I get this error:

 

Symfony\Component\Debug\Exception\ ContextErrorException

 

in var/cache/dev/smarty/compile/93/4b/20/934b206a7c8462ae2623fb91094d22fa913e6119_0.file.form.tpl.php (line 257)

 

Block_1777962875c724b8038eee0_34525801->callBlock(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 248)

 

Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_1777962875c724b8038eee0_34525801), object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 184)

 

Smarty_Internal_Runtime_Inheritance->process(object(SmartyCustomTemplate), object(Block_1777962875c724b8038eee0_34525801)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 156)

 

Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyCustomTemplate), 'Block_1777962875c724b8038eee0_34525801', 'input', 0) in var/cache/dev/smarty/compile/93/4b/20/934b206a7c8462ae2623fb91094d22fa913e6119_0.file.form.tpl.php (line 1520)

 

Block_4581908665c724b8038b6a4_58689274->callBlock(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 248)

 

Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_4581908665c724b8038b6a4_58689274), object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 184)

 

Smarty_Internal_Runtime_Inheritance->process(object(SmartyCustomTemplate), object(Block_4581908665c724b8038b6a4_58689274)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 156)

 

Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyCustomTemplate), 'Block_4581908665c724b8038b6a4_58689274', 'field', 0) in var/cache/dev/smarty/compile/93/4b/20/934b206a7c8462ae2623fb91094d22fa913e6119_0.file.form.tpl.php (line 1555)

 

Block_20572780435c724b803740f7_93986884->callBlock(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 248)

 

Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_20572780435c724b803740f7_93986884), object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 184)

 

Smarty_Internal_Runtime_Inheritance->process(object(SmartyCustomTemplate), object(Block_20572780435c724b803740f7_93986884)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 156)

 

Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyCustomTemplate), 'Block_20572780435c724b803740f7_93986884', 'input_row', 0) in var/cache/dev/smarty/compile/93/4b/20/934b206a7c8462ae2623fb91094d22fa913e6119_0.file.form.tpl.php (line 1713)

 

Block_17217539435c724b80360004_23524931->callBlock(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 248)

 

Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_17217539435c724b80360004_23524931), object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 184)

 

Smarty_Internal_Runtime_Inheritance->process(object(SmartyCustomTemplate), object(Block_17217539435c724b80360004_23524931)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 156)

 

Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyCustomTemplate), 'Block_17217539435c724b80360004_23524931', 'fieldset', 0) in var/cache/dev/smarty/compile/93/4b/20/934b206a7c8462ae2623fb91094d22fa913e6119_0.file.form.tpl.php (line 1880)

 

Block_6249074505c724b803422f5_68884731->callBlock(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 248)

 

Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_6249074505c724b803422f5_68884731), object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 184)

 

Smarty_Internal_Runtime_Inheritance->process(object(SmartyCustomTemplate), object(Block_6249074505c724b803422f5_68884731)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php (line 156)

 

Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyCustomTemplate), 'Block_6249074505c724b803422f5_68884731', 'defaultForm') in var/cache/dev/smarty/compile/93/4b/20/934b206a7c8462ae2623fb91094d22fa913e6119_0.file.form.tpl.php (line 39)

 

content_5c724b805f22b7_97158746(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php (line 123)

 

Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php (line 114)

 

Smarty_Template_Compiled->render(object(SmartyCustomTemplate)) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php (line 216)

 

Smarty_Internal_Template->render(false, 0) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php (line 232)

 

Smarty_Internal_TemplateBase->_execute(object(SmartyCustomTemplate), null, null, null, 0) in vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php (line 116)

 

Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false) in classes/Smarty/SmartyCustomTemplate.php (line 44)

                }

            }

            return $tpl;

        } else {

            return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);

        }

    }

}

 

 

SmartyCustomTemplateCore->fetch() in classes/helper/Helper.php (line 114)

 

HelperCore->generate() in classes/helper/HelperForm.php (line 271)

 

HelperFormCore->generate() in classes/helper/HelperForm.php (line 67)

 

HelperFormCore->generateForm(array('form' => array('form' => array('id_form' => 'codwfeeplus_configform', 'input' => array(array('type' => 'html', 'name' => 'CODWFEEPLUS_PRODUCT_INFO', 'html_content' => '<div class="codwfeeplus_productstatus"><div class="codwfeeplus_productstatus_true"><p>COD product found in database. Product ID: <a href="/admin123/index.php/sell/catalog/products?_token=SvoaNJ1usm6nzTsmyAw0stzno739BqkdBmaPvP-myME&id_product=122927&updateproduct">122927</a></p></div></div>'), array('type' => 'switch', 'label' => 'Auto check for updates', 'name' => 'CODWFEEPLUS_AUTO_UPDATE', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => 'Enabled'), array('id' => 'active_off', 'value' => 0, 'label' => 'Disabled')), 'hint' => 'Toggle whether check for updates when this page is loaded.'), array('type' => 'html', 'html_content' => '<hr class="codwfeeplus_form_hr">', 'col' => '12', 'label' => '', 'name' => 'sep'), array('type' => 'select', 'label' => 'Integration', 'name' => 'CODWFEEPLUS_INTEGRATION_WAY', 'options' => array('query' => array(array('id_option' => 0, 'name' => 'Defined by first successful condition'), array('id_option' => 1, 'name' => 'Add to carrier\'s fee'), array('id_option' => 2, 'name' => 'Add a COD product to the order')), 'id' => 'id_option', 'name' => 'name'), 'hint' => 'How to integrate the COD fee to the order.'), array('type' => 'select', 'label' => 'Order Status', 'name' => 'CODWFEEPLUS_ORDERSTATE_DEF', 'options' => array('query' => array(array('id_option' => 1, 'name' => '1 - Awaiting check payment'), array('id_option' => 2, 'name' => '2 - Payment received'), array('id_option' => 3, 'name' => '3 - Processing in progress'), array('id_option' => 4, 'name' => '4 - Shipped'), array('id_option' => 5, 'name' => '5 - Delivered'), array('id_option' => 6, 'name' => '6 - Canceled'), array('id_option' => 7, 'name' => '7 - Refunded'), array('id_option' => 8, 'name' => '8 - Payment error'), array('id_option' => 9, 'name' => '9 - On backorder (paid)'), array('id_option' => 10, 'name' => '10 - Awaiting bank wire payment'), array('id_option' => 11, 'name' => '11 - Remote payment accepted'), array('id_option' => 12, 'name' => '12 - On backorder (not paid)'), array('id_option' => 13, 'name' => '13 - Awaiting Cash On Delivery validation'), array('id_option' => 14, 'name' => '14 - Awaiting for PayPal payment'), array('id_option' => 15, 'name' => '15 - Awaiting for Braintree payment'), array('id_option' => 16, 'name' => '16 - Awaiting for Braintree validation')), 'id' => 'id_option', 'name' => 'name'), 'hint' => 'What the status of the order will be.'), array('type' => 'text', 'label' => 'COD product title', 'name' => 'CODWFEEPLUS_PRODUCT_TITLE', 'lang' => true, 'hint' => 'The name of the COD product that will be displayed in the order.', 'form_group_class' => 'codwfeeplus_product_details'), array('type' => 'text', 'label' => 'COD product reference', 'name' => 'CODWFEEPLUS_PRODUCT_REFERENCE', 'hint' => 'The reference of the COD product that will be displayed in the order.', 'class' => 'fixed-width-xxl', 'form_group_class' => 'codwfeeplus_product_details'), array('type' => 'switch', 'label' => 'Store orders', 'name' => 'CODWFEEPLUS_KEEPTRANSACTIONS', 'is_bool' => true, 'values' => array(array('value' => 1), array('value' => 0)), 'hint' => 'Toggle whether to keep a log of orders done with this module.'), array('type' => 'select', 'label' => 'Behavior', 'name' => 'CODWFEEPLUS_BEHAVIOUR', 'options' => array('query' => array(array('id_option' => 0, 'name' => 'Apply the highest in the list, matching fee'), array('id_option' => 1, 'name' => 'Add all matching fees')), 'id' => 'id_option', 'name' => 'name'), 'hint' => 'How to calculate the final fee.'), array('type' => 'html', 'html_content' => '<hr class="codwfeeplus_form_hr">', 'col' => '12', 'label' => '', 'name' => 'sep'), array('type' => 'switch', 'label' => 'Enable logo', 'name' => 'CODWFEEPLUS_LOGO_ENABLED', 'is_bool' => true, 'values' => array(array('value' => 1), array('value' => 0)), 'hint' => 'Toggle whether to enable the logo display on the payment page.'), array('type' => 'file', 'label' => 'Payment logo', 'name' => 'CODWFEEPLUS_LOGO_FILENAME_17', 'hint' => 'Select a logo for the payment page.'), array('type' => 'html', 'name' => 'CODWFEEPLUS_LOGO_FILENAME_17_PREVIEW', 'html_content' => '<div class="codwfeeplus_logo_preview"><img src="/modules/codwfeeplus/views/img/codwfeeplus_logo_17.png"></img></div>'), array('type' => 'html', 'html_content' => '<hr class="codwfeeplus_form_hr">', 'col' => '12', 'label' => '', 'name' => 'sep'), array('type' => 'file', 'label' => 'Import Conditions', 'name' => 'CODWFEEPLUS_CONDITIONS_IMPORT', 'hint' => 'Select a previously exported file, to import conditions')), 'submit' => array('title' => 'Save'))))) in modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php (line 1355)

 

AdminCODwFeePlusController->renderConfigForm(true, false) in modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php (line 243)

 

AdminCODwFeePlusController->renderView() in classes/controller/AdminController.php (line 2094)

 

AdminControllerCore->initContent() in modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php (line 119)

 

AdminCODwFeePlusController->initContent() in classes/controller/Controller.php (line 281)

 

ControllerCore->run() in classes/Dispatcher.php (line 509)

 

DispatcherCore->dispatch() in admin123/index.php (line 99)

Share this post


Link to post
Share on other sites

I run the module on a 1.7.5.1 installation without any problem, so if I can't reproduce the error I can't do much to help you. Please try to activate the debug mode (advanced parameters -> performance -> Debug mode) to see if you get any error messages when resetting the COD product. Make sure to have the latest version of my module (v1.1.4 right now) as well.

Share this post


Link to post
Share on other sites
3 hours ago, sakgiok said:

I run the module on a 1.7.5.1 installation without any problem, so if I can't reproduce the error I can't do much to help you. Please try to activate the debug mode (advanced parameters -> performance -> Debug mode) to see if you get any error messages when resetting the COD product. Make sure to have the latest version of my module (v1.1.4 right now) as well.

[PrestaShopDatabaseException]

Duplicate entry '4294967295' for key 'PRIMARY'
 

INSERT INTO `wpny_product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `supplier_reference`, `location`, `width`, `height`, `depth`, `weight`, `quantity_discount`, `ean13`, `isbn`, `upc`, `cache_is_pack`, `cache_has_attachments`, `is_virtual`, `state`, `additional_delivery_times`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `low_stock_threshold`, `low_stock_alert`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_type_redirected`, `available_for_order`, `available_date`, `show_condition`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`) VALUES ('1', '0', '0', 'COD', '', '', '0', '0', '0', '0', '0', '', '', '', '0', '0', '0', '1', '1', '2', '1', '0', '0', '0', '1', NULL, '0', '0', '0', '', '0', '0', '0', '0', '0', '1', '', '0', '1', '0000-00-00', '0', 'new', '1', '0', 'both', '0', '0', '2019-02-24 10:11:32', '2019-02-24 10:11:32', '3')


at line 769 in file classes/db/Db.php

 

764.         if ($webservice_call && $errno) {
765.             $dbg = debug_backtrace();
766.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
767.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
768.             if ($sql) {
769.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
770.             }
771. 
772.             throw new PrestaShopDatabaseException($this->getMsgError());
773.         }
774.     }

*********************************************

[EDIT]

 

I understood fomr the debug that there was an error with products ID in DB

So reading online how to clean it up, i found there is PS CLEANER : official module by PS that cleans db (useful to anyone to also delete default products and preset order coming along within the installation of PS).

 

DB cleaned - > your module works properly.

 

thank you verymuch for it and your kind support!

Edited by e-piazza.biz
  • Thanks 1

Share this post


Link to post
Share on other sites

I don't know if you saw my post. Module worked like a charm until I uploaded data with One click migrate module. After uploading data I got error (see attached file).

errorcod.png

Share this post


Link to post
Share on other sites

Hi @Bocco,

sorry I missed your original post somehow... the error looks similar to a previous one and it seems to have something to do with languages...

I suggest to clear the cache, uninstall and reinstall the module to see if this fixes it...

Share this post


Link to post
Share on other sites

I did uninstall module and install again - nothing changed. I tried to reset module - same issue. I tried with clean copy, installed module COD - working. But as soon as I upload migration data -  I get error.

I tried clean cache also...Also tried module prestashop cleaner...

Share this post


Link to post
Share on other sites

Well, the good news is that it's only a notice and not an error and only for the backoffice, so if you disable debug mode, the module should be working as it should... Since I don't have access to this migration module (I assume it's the paid one that I found that you used), I don't see a way right now to reproduce the error and see what is causing it.

How many languages do you have in your shop? I do think it's connected to the shop's languages and their indexes...

Share this post


Link to post
Share on other sites

If I disable debug mode, I don't have access to backoffice anymore. I did that trick once and have to do restore.

I have 3 languages - english, slovenian and croatian. But I found in psfm_meta_lang  a lot more languages shown. I even deleted all languages I do not use from that table.

 

Share this post


Link to post
Share on other sites

I found solution, thx to you @sakgiok. Problem was in psfm_carrier_lang. With migrating data a lot of languages were made in psfm_carrier_lang. When deleting all redundant languages, module worked again.

  • Thanks 1

Share this post


Link to post
Share on other sites

hi, on my ps 1.7.5 version is not shown in the total cart, only after the order has been completed the show in total, but before completing the order

 

in summary cart, on total miss my 4€ fee...

Cattura.JPG

Share this post


Link to post
Share on other sites

I just want to clarify something about the way the cart summary is working. It was made to work with the default theme in mind, so when COD is selected (or deselected) it looks for a specific DOM element in the page and replaces its contents, to display the extra COD fee.

If you have a different theme that doesn't have the same DOM elements at the cart summary section, then the cart summary extra info will not be displayed. In that case, you need to modify the front.js file, replacing the appropriate sections. Of course some basic javascript knowledge is required...

That might not do the trick either though, as the them might even have modified the templates for displaying the cart summary (it should be rare but might happen). In that case you need to modify more things in my module to make it work.

Anyway, the javascript file for the simple case is /modules/codwfeeplus/views/js/front.js (I suggest copy the edited file in the appropriate folder in your theme to prevent overwriting from a future update) and for the more complicated case you'll need to modify the /modules/codwfeeplus/controllers/front/ajax.php that takes care of the data sent to javascript.

If you have a problem like that and you use a custom theme, send me a message and, after I take a look at your site, I can suggest an edit in the javascript file that might work.

Share this post


Link to post
Share on other sites
On 1/21/2019 at 2:05 PM, stoigniew said:

Hi. I testet this module on 1.7.5 and it works fine. But i have one problem, in one of my shipping metod i don't want COD and i can't off COD. In Validation Rules i have deselect that shipping and check "Match all grupes". Its posible to off COD for some shipping metod?

COD.jpg

you also can simply go to payments->configurations and un-check box delivery option

Share this post


Link to post
Share on other sites

I have a strange behavior. It double add  tax for COD.

image.thumb.png.0f88d145e2a866432aed0e8261304bae.png

 

before accepting order shows correctly 1.50, but after accept order in order summary it shows 1.35?! maybe now where to find a problem? Thanks in advice.

image.thumb.png.88bff2432ee9bb28a030c7c91fff41e7.png

Share this post


Link to post
Share on other sites
8 hours ago, Darius1990 said:

I have a strange behavior. It double add  tax for COD.

image.thumb.png.0f88d145e2a866432aed0e8261304bae.png

 

before accepting order shows correctly 1.50, but after accept order in order summary it shows 1.35?! maybe now where to find a problem? Thanks in advice.

image.thumb.png.88bff2432ee9bb28a030c7c91fff41e7.png

Which PS version are you using?

Share this post


Link to post
Share on other sites

HI, @sakgiok I'm getting an 500 serevr error when submitting an order. So I turned on Debug Mode. I've got this

(1/1) ContextErrorException

Notice: Use of undefined constant INTL_IDNA_VARIANT_UTS46 - assumed 'INTL_IDNA_VARIANT_UTS46'

in Mail.php line 883
at MailCore::toPunycode('sites@extremecode.info')in Mail.php line 318
at MailCore::send(1, 'preparation', 'Processing in progress', array('{lastname}' => 'De Silva', '{firstname}' => 'Yohan', '{id_order}' => 11, '{order_name}' => 'NPHYQNNMV', '{total_paid}' => 'RS. 499.00'), 'sites@extremecode.info', 'Yohan De Silva', 'info@yuppy.lk', 'Yuppy', null, null, '/home/yuppylk/public_html/mails/',false, 1)in OrderHistory.php line 546
at OrderHistoryCore->sendEmail(object(Order), array())in OrderHistory.php line 468
at OrderHistoryCore->addWithemail(true, array())in PaymentModule.php line 747
at PaymentModuleCore->validateOrder(23, '3', 499.0, 'Cash on delivery', null, array(), 3, false, '29589f1e7324abe444a825e5f80bb5b0')in validation.php line 93
at CODwFeePlusValidationModuleFrontController->validate_addProduct(50.0, object(Cart), object(Customer), 0, '3')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

 

 

 

Share this post


Link to post
Share on other sites

@Yohan De Silva, This is just a notice and it shouldn't produce a 500 error code. Are you able to make a purchase when codwfeeplus is disabled? I would disable debug mode and look into the apache (or whatever web server you're using) error log to see the error 500 cause.

Share this post


Link to post
Share on other sites

@Darius1990,  I can't find a case where this problem would occur. First step, I would open the cod product from the product list, and see if it has the correct price. If it does, then all my module does is to add this product to the cart, as any other product, so I can't say what's happening unless I debug the source code.

Share this post


Link to post
Share on other sites

@sakgiok thanks a lot for sharing your work. This is highly appreciated.

I played a bit with your module but wasn't able to do what I need. I know, you're writing that the module is meant for COD but I thought I could use it as well in another way. Let me explain what I am looking for: what I need is, that a surcharge (e.g. a fixed value) is added to all carts with a value less than 40, no mater wich payment the customer chooses.
Is there a chance that this can be achieved with your module?

Share this post


Link to post
Share on other sites

Hi @Oli4CH,

I'm afraid it's not possible to do the thing you want with this module. It'a a payment module, so it only works when the specific payment method is chosen.

Share this post


Link to post
Share on other sites

@sakgiok no worries, that's what I thought. Nevertheless, thanks a lot for your answer and as well for your great contribution.

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hi.

Prestashop 1.6.1.20 here but your module doesn't work.

If i choose to display the fee as a product it doesn't show at all, if I choose to Add the fee to the carrier's seems to work fine, but after pressing on the final "I confirm my order" button, a blank page with an error on it appears.

It displays this:

* @version: 1.0 * @copyleft: 2006, AGOW.org * * */ class HttpRequest{ var $bytes; // number of bytes to read for each request var $server; // server ip var $host; // domain var $use_proxy; // boolean var $proxy; // proxy informations var $vars; // Array var_name=>var_value var $files; // Array Files upload var_name=>{[fname]=>/path/to/file,[ctype]=>'text/plain'} var $cookies; // Array var_name=>var_value var $headers; // request headers array var $err; // err var $method; // GET/POST var $port; // Server port var $timeout; // connection timeout var $target; // Remote script path var $protocol; // protocol schema (http/udp/ssl) var $result; // response result var $response; // Object HttpResponse var $_query; // full query-string name=>value&name=>value&name=>value var $_request; // complete HTTP request /** * HttpRequest Constuctor * @access public * @return HttpRequest */ function HttpRequest(){ $this->protocol = 'http'; $this->protocol_version = '1.0'; $this->bytes = 0; $this->server = '127.0.0.1'; $this->host = 'localhost'; $this->use_proxy = false; $this->proxy = array( 'name' => "www.anonymouse.org", 'user' => '', 'pass' => '', 'port' => 8080 ); $this->vars = array(); $this->files = array(); $this->cookies = array(); $this->err = ''; $this->method = 'GET'; $this->port = 80; $this->timeout = 5; $this->target = '/index.php'; $this->headers = array(); $this->response = &new HttpResponse(); $this->_query = ""; $this->_request = ''; $this->_result = ''; } /** * Initialize an HttpRequest * @access private * @return boolean */ function Init(){ //error_reporting(0); $this->err = ''; $this->result = ''; $this->_request = ''; $this->_query = ''; foreach ($this->vars as $var_name=>$var_value){ $this->_query .= urlencode($var_name)."=".urlencode($var_value)."&"; } $this->_query = substr($this->_query,0,-1); $this->_request = $this->method." "; $this->_request .= $this->target; if($this->method=='GET'){ /* SIMPLE GET METHOD */ if(!empty($this->_query))$this->_request .= "?".$this->_query; if(isset($this->headers['Content-Type'])) unset($this->headers['Content-Type']); if(isset($this->headers['Content-Length'])) unset($this->headers['Content-Length']); }else{ /* POST METHOD */ if(count($this->files)>0){ /* WITH FILES */ srand((double)microtime()*1000000); $boundary = "---------------------".substr(md5(rand(0,32000)),0,10); $this->headers['Content-Type'] = "multipart/form-data, boundary=$boundary"; $data = ''; foreach($this->vars as $var_name=>$var_value){ $data .="--$boundary\r\n"; $data .= "Content-Disposition: form-data; name=\"".$var_name."\"\r\n"; $data .= "\r\n".$var_value."\r\n"; $data .="--$boundary\r\n"; } foreach($this->files as $var_name=>$file_info){ if(file_exists($file_info['fname'])){ $fs = filesize($file_info['fname']); if($fs>0){ $ctype = (isset($file_info['ctype']))?$file_info['ctype']:mime_content_type($file_info['fname']); $data .="--$boundary\r\n"; $data .= "Content-Disposition: form-data; name=\"$var_name\"; filename=\"".$file_info['fname']."\"\r\n"; $data .= "Content-Type: ".$ctype."\r\n\r\n"; $fh = fopen($file_info['fname'],'rb'); while(!feof($fh)) $data .= fread($fh,1024); fclose($fh); $data .="\r\n--$boundary\r\n"; } }else{ $this->err .= $file_info['fname']." not found\r\n"; return false; } } $data .="\r\n--$boundary--\r\n"; $this->headers['Content-Length'] = strlen($data); }else{ /* WITHOUT FILES (ONLY VARS) */ $lenght = strlen($this->_query); $this->headers['Content-Type'] = 'application/x-www-form-urlencoded'; $this->headers['Content-Length'] = $lenght; } } if(count($this->cookies)>0){ $cookies = array(); foreach($this->cookies as $cookie_name=>$cookie_value) $cookies[] = "$cookie_name=$cookie_value"; $this->headers['Cookie'] = implode('; ',$cookies); } if($this->protocol=='http'){ $this->_request .= " HTTP/".$this->protocol_version."\r\n"; $this->_request .= "Host: ".($this->use_proxy?$this->proxy['name']:$this->host)."\r\n"; } if(count($this->headers>0)){ foreach($this->headers as $header_name=>$header_value){ $this->_request .= $header_name.": ".$header_value."\r\n"; } } if($this->method=='POST'){ if(count($this->files)==0) $this->_request .= "\r\n".$this->_query."\r\n"; else{ $this->_request .= "\r\n".$data; } }else{ $this->_request .= "\r\n"; } return true; } /** * Send an http request and store the http response in a HttpResponse object * @access public * @return boolean */ function Send(){ $this->_result = ''; if($this->server!=""){ $errno = ''; $errstr = ''; if($this->use_proxy){ $this->headers['Proxy-Authorization'] = "Basic ".base64_encode($this->proxy['user'].":".$this->proxy['pass']); $this->target = $this->protocol.'://'.$this->host.$this->target; $fp = fsockopen ($this->proxy['name'], $this->proxy['port'], $errno, $errstr, $this->timeout); if(!$this->Init()) return false; }else{ if(!$this->Init()) return false; $fp = fsockopen ($this->server, $this->port, $errno, $errstr, $this->timeout); } if (!$fp) { $this->err = "$errstr ($errno)"; } else { fputs($fp, $this->_request); if($this->bytes<=0){ while(!feof($fp)) { $this->_result .= fgets($fp,1024); } }else $this->_result = fgets($fp,$this->bytes); fclose($fp); $this->response = &new HttpResponse($this->_result); $this->response->Init(); return true; } }else $this->err = "Empty Server value."; return false; } } ?> Send() call * and it's a structure of 3 elements: * code: es. HTTP/1.1 200 OK * body: es. ... * headers: associative array of response headers * es. [content-type] = 'text/html' * [content-length] = 2561 * [location] = 'page.php' * ecc ... * * * @author: #ffffff * @version: 1.0 * @copyleft: 2006, AGOW.org * * */ class HttpResponse{ var $headers; // associative array of headers var $code; // first header var $body; // response body var $_response; // All server response (not parsed) function HttpResponse($response=''){ $this->_response = $response; } function Init(){ $start_body = $this->_getHeaders(); $this->_getBody($start_body); } function _getHeaders(){ $this->headers = array(); $lines = explode("\n",str_replace("\r",'',$this->_response)); foreach($lines as $k=>$line){ if($k==0){ $this->code = $line; continue; } if(!empty($line)){ $elem = explode(': ',$line); if(count($elem)>1){ $key = array_shift($elem); if(isset($this->headers[strtolower($key)])) $this->headers[strtolower($key)] .= ';'.rtrim(ltrim(implode('',$elem))); else $this->headers[strtolower($key)] = rtrim(ltrim(implode('',$elem))); }elseif(count($elem)==1) $this->headers[$elem[0]] = ''; }else return $k; } } function _getBody($start_line){ $body = array(); $lines = explode("\n",str_replace("\r",'',$this->_response)); foreach($lines as $k=>$line){ if($k>=$start_line){ $body[] = $line; } } $this->body = implode("\r\n",$body); } } ?>

 

Any solutions?

 

Thank you!

Edited by VanigliaPro

Share this post


Link to post
Share on other sites

Well, this is clearly php code that shouldn't be displayed, and moreover, I couldn't find this code in the default prestashop code. So I'm assuming there is another module (or something else) involved here. These urls showing up are maybe a point out to what's involved (AGOW . org and anonymouse . org).

Share this post


Link to post
Share on other sites

Hello,

Thanks for this very useful module.

It would be perfect if we could use it with Skroutz Analytics but there is a problem.

Skroutz needs to return the revenue and the shipping cost seperately from the COD fee but with this module the revenue and the shipping include the COD fee.

Would it be possible to rework it and return the values seperately?

Yopu can see the requirementx following this link https://developer.skroutz.gr/analytics/ecommerce/

Thanks in advance

Share this post


Link to post
Share on other sites

Hi @aanton,

this is up to the skroutz analytics module you're using. You can always use the "add a cod product" method, instead of the "add to carrier's fee", to keep the carrier's fee clean of cod fees.

Share this post


Link to post
Share on other sites
1 hour ago, sakgiok said:

Hi @aanton,

this is up to the skroutz analytics module you're using. You can always use the "add a cod product" method, instead of the "add to carrier's fee", to keep the carrier's fee clean of cod fees.

Hello @sakgiok

I think it's not up to the analytics code or module alone. It's a combination of both.

I'm using a custom code but I also tried the only module available from Ilia-s.  There's a long thread here:

If I use add a cod product there are two problems. 1. The shippning is OK but the revenue is not and 2. Skroutz rejects the dummy product because it's not included in the xml feed.

I guess that what is needed is to have something like $order->total_shipping = $order->total_shipping_tax_incl-$fee; (taken from the other post) inside your module and pass it to the custom code or the module.

Share this post


Link to post
Share on other sites
Posted (edited)

Yeah, that's why I said it's the skroutz module's to do this. I don't think there is a way to modify my module to do what you're asking for, since prestashop doesn't have any specific variable in the cart or order object to store the cod fee.

What you can do is to modify the skroutz module (or your custom code) to the calculation you wrote above. Since the custom code should be running after the order validation you should have access to the cart object, so I suggest something like this:

$cart = $this->context->cart;
$codmodule = Module::getInstanceByName('codwfeeplus');
$codfee = $codmodule->getCostFromCart($cart);
$order->total_shipping = $order->total_shipping_tax_incl - $codfee;

The other way of course, if you have cod product method is to filter the cod product from the final order in your custom code...

Edited by sakgiok

Share this post


Link to post
Share on other sites
17 minutes ago, sakgiok said:

Yeah, that's why I said it's the skroutz module's to do this. I don't think there is a way to modify my module to do what you're asking for, since prestashop doesn't have any specific variable in the cart or order object to store the cod fee.

What you can do is to modify the skroutz module (or your custom code) to the calculation you wrote above. Since the custom code should be running after the order validation you should have access to the cart object, so I suggest something like this:


$cart = $this->context->cart;
$codmodule = Module::getInstanceByName('codwfeeplus');
$codfee = $codmodule->getCostFromCart($cart);
$order->total_shipping = $order->total_shipping_tax_incl - $codfee;

The other way of course, if you have cod product method is to filter the cod product from the final order in your custom code...

OK, I understand. I'll try your suggestion and inform you about the results.

Thanks a lot.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi!

Congrats for the module! This is fantastic for me!
I have a problem!

In prestashop 1.7.5 i configure the module but i have this error:
https://maldon.shop/pt/module/codwfeeplus/validation
Its a 500 error page.

Other problem for me is in email confirmation.
the site cant send email confirmation
See print screens

Captura de ecrã 2019-03-24, às 12.42.59.png

Captura de ecrã 2019-03-24, às 12.42.56.png

Captura de ecrã 2019-03-24, às 12.42.49.png

Captura de ecrã 2019-03-24, às 12.41.48.png

Share this post


Link to post
Share on other sites
26 minutes ago, sakgiok said:

Hi @carlosmfalves,

please enable the debug mode and reproduce the error to see what's going on...

Whoops, looks like something went wrong.

 

(1/1) UndefinedFunctionException

Attempted to call function "idn_to_ascii" from the global namespace.

in Mail.php line 878
at MailCore::toPunycode('me@carlosmfalves.eu')in Mail.php line 317
at MailCore::send(7, 'preparation', 'Preparação em curso', array('{lastname}' => 'Alves', '{firstname}' => 'Carlos', '{id_order}' => 18, '{order_name}' => 'BNHZNDVYG', '{total_paid}' => '42,99 €'), 'me@carlosmfalves.eu', 'Carlos Alves', 'admin@maldon.shop', 'Maldon', null, null, '/home/pg35nxsq/public_html/mails/', false, 1)in OrderHistory.php line 546
at OrderHistoryCore->sendEmail(object(Order), array())in OrderHistory.php line 468
at OrderHistoryCore->addWithemail(true, array())in 17500.php line 551
at include('/home/pg35nxsq/public_html/modules/codwfeeplus/validate_functions/17500.php')in codwfeeplus.php line 1858
at codwfeeplus->runCorrect_validateOrder(3.0, 93, '3', 42.99000000000000198951966012828052043914794921875, 'Cash on delivery', null, array(), 2, false, '906fd9fb697893cd899f68f27a3e8b2d')in validation.php line 101
at CODwFeePlusValidationModuleFrontController->validate_addToCarrier(3.0, object(Cart), object(Customer), '3')in validation.php line 73
at CODwFeePlusValidationModuleFrontController->postProcess()in Controller.php line 270
at ControllerCore->run()in Dispatcher.php line 509
at DispatcherCore->dispatch()in index.php line 28

Share this post


Link to post
Share on other sites
Posted (edited)

On validating order i get error 500 :( Any tips? PS version 1.6.0.6

@sakgiok

 

 

[02-Apr-2019 17:36:10 Europe/Sofia] PHP Fatal error:  Uncaught Error: Undefined class constant 'DEBUG_MODE' in /home/etnolina/public_html/shop/modules/codwfeeplus/validate_functions/16009.php:24
Stack trace:
#0 /home/etnolina/public_html/shop/modules/codwfeeplus/codwfeeplus.php(1838): include()
#1 /home/etnolina/public_html/shop/modules/codwfeeplus/controllers/front/validation.php(101): codwfeeplus->runCorrect_validateOrder(0.18, 8126, '3', 19.68, 'Cash on deliver...', NULL, Array, 1, false, 'da2f8a199aa5873...')
#2 /home/etnolina/public_html/shop/modules/codwfeeplus/controllers/front/validation.php(73): CODwFeePlusValidationModuleFrontController->validate_addToCarrier(0.18, Object(Cart), Object(Customer), '3')
#3 /home/etnolina/public_html/shop/classes/controller/Controller.php(171): CODwFeePlusValidationModuleFrontController->postProcess()
#4 /home/etnolina/public_html/shop/classes/Dispatcher.php(373): ControllerCore->run()
#5 /home/etnolina/public_html/shop/index.php(28): DispatcherCore->dispatch()
#6 {main}
  thrown in /home/etnolina/public_html/shop/modules/codwfeeplus/validate_functions/16009.php on line 24
Edited by ironbg

Share this post


Link to post
Share on other sites

Hi @ironbg,

It seems that version 1.6.0.6 has more differences that I thought... It's getting really hard to try and support all these older versions...

Try these files I attached to see if the problem is fixed and the module works as expected. If all goes well, I'll include them in the next version (whenever that is going to be), so you can upgrade the module.

Just replace the first file and put the second file under validate_functions folder (in the modules/codwfeeplus folder of course)

codwfeeplus.php

16006.php

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hi, The module works on the PS version 1.6.1.23
 

Edited by TCHOUPI
  • Thanks 1

Share this post


Link to post
Share on other sites
21 hours ago, sakgiok said:

Hi @ironbg,

It seems that version 1.6.0.6 has more differences that I thought... It's getting really hard to try and support all these older versions...

Try these files I attached to see if the problem is fixed and the module works as expected. If all goes well, I'll include them in the next version (whenever that is going to be), so you can upgrade the module.

Just replace the first file and put the second file under validate_functions folder (in the modules/codwfeeplus folder of course)

codwfeeplus.php

16006.php

Thank you but i got another error now :(

Fatal error: Call to undefined function array_column() in /home/etnolina/public_html/shop/modules/codwfeeplus/codwfeeplus.php on line 1871

 

Share this post


Link to post
Share on other sites

I would guess your php version is lower than 5.5.0. If that's true, I don't know how exactly this can be resolved, other of course than upgrading your php, which I totally recommend for security reasons.

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thank you! With php 7 works like a charm! 

Edited by ironbg
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello, i have tried the module with 1.7.4.3 but i get this error 

 

INFO06:23:56 php User Deprecated: AdminMarketing is a deprecated tab since version 1.7.0 and "Default" will be removed in 1.7.1.. Upgrade module using the docs: http://build.prestashop.com/news/how-we-reorganized-main-menu-prestashop-1.7/.
DEBUG06:23:56 php Warning: filemtime(): stat failed for /home/bemo/public_html/shop/bemopetadmin/themes/default/css/theme.css
CRITICAL06:23:57 php Uncaught Notice: Undefined offset: 1
DEBUG06:23:57 doctrine SELECT name FROM psm1_module WHERE active = 1
INFO06:23:57 php User Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "Csa\Bundle\GuzzleBundle\DataCollector\GuzzleCollector".
CRITICAL06:23:57 request Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined offset: 1" at /home/bemo/public_html/shop/var/cache/dev/smarty/compile/f3/be/d0/f3bed081ad02c149ec8c643993fbc6848abdca31_0.file.form.tpl.php line 257

Share this post


Link to post
Share on other sites

Hi @Funieru Bogdan,

The error at line 257 of file.form.tpl.php had come up before in this thread and it was an issue of the shop's language setup (or something similar). @Bocco had a maybe similar issue that was solved...

Share this post


Link to post
Share on other sites

Great work!

There is a manual? In the BO I don't understand the meaning of attached configuration fields

 

Thanks

Cattura.JPG

Share this post


Link to post
Share on other sites

Hi @andrea71,

Although there are some tooltips that may provide some help I'll try to explain these settings...

Integration: There are two ways the cod fee is integrated into the order. Either the fee is added to the carrier's fee, or a product is added to the order (a cod product) that its price is equal to the cod fee. Here you either select one of these two methods that will always be applied, or define that the method that will be used for the order, is the method contained in the first condition that passes validation.

Order status: What's the order status that will be returned to your store if this order is successfully processed.

COD product title - reference: The title and reference of the cod product, when the corresponding method (add a cod product) is used in integration. This is configurable because these values are shown on the customer's invoice.

Store Orders: Either store the transactions and the output of the module's logic to select a fee or not. The stored data can be reviewed with the view order log button (top-right).

Behaviour: The logic the module is working is that it goes through the conditions from the list (according to its position, starting on one) and for each condition (if it is enabled), it tries to validate it. There could be more than one condition validated in an order, each one providing a different fee maybe. This field is specifying what to do in a situation like that. One option is to apply the fee of the first validated condition (the top in the list of validated conditions), or add all the fees from all the validated conditions and use this sum as fee.

Hope this clarifies some things...

Share this post


Link to post
Share on other sites

Hi Sakgiok, thanks a lot for your explanation. Is not so clear the "Store Orders" but I will try to understand better.

Thanks again

Share this post


Link to post
Share on other sites

Just whether to log the transactions made with this module. As I said, you can see this log via the view order log button, where you can also see the full process of validating the condition, for the specific order (it's the same output as testing your conditions provides but this time the output is derived from an actual order).

If you disable this option, nothing changes in the module behaviour or in your front office, you just not logging the orders made with this module for later review.

Edited by sakgiok

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

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