Git Product home page Git Product logo

codwfeeplus's Introduction

codwfeeplus

A prestashop module for implementing Cash On Delivery with a fee with a lot of options.

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.

Installation

Just like any prestashop module. Just zip the codwfeeplus folder and upload your zip file to the prestashop modules page, selecting to add a module.

codwfeeplus's People

Contributors

mylgeorge avatar sakgiok avatar simonharvan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codwfeeplus's Issues

Assign an existing product ID

Hi,

I´m using CODWFEEPLUS on prestashop 1.6, and now i´m moving to 1.7, on a new version of my store, from the start.

I have imported products from my old store... and now when installing codfeeplus it has created a new product id on the database, but i had one already, and i would have to import more products still, and I´m afraid some would overwrithe the new product ID created today.

Can I force codwfeeplus to take an existing product ID instead creating a new one when is installed?

Thanks!

Undefined index id in switch input of setting form

I updated prestashop to version 1.7.8.7 in my local environment and found the error bellow when opening the module setting page:

image

This happens because the values array of switch input does not have the key id:

array(
'type' => 'switch',
'label' => $this->l('Store orders'),
'name' => 'CODWFEEPLUS_KEEPTRANSACTIONS',
'is_bool' => true,
'values' => array(
array(
'value' => 1,
),
array(
'value' => 0,
),
),

It should be:

'values' => array( 
         array( 
             'id' => 'active_on', 
             'value' => 1, 
         ), 
         array( 
             'id' => 'active_off', 
             'value' => 0, 
         ), 

All switch input in the form need to be fixed.

Thank you!

PS 8.1.2 - PHP 8.1 - ErrorException in classes/helper/HelperForm.php (line 120)

Describe the bug
After the fresh install went ok, first thing i click is on module to configure i get

Warning: Undefined array key "id"
ErrorException
in classes/helper/HelperForm.php (line 120)
$switch_values = $params['values']; if (!empty($params['values'])) { foreach ($switch_values as $k => $value) { if (!isset($value['label'])) { $default_key = (int) $value['value'] ? 1 : 0; $defautl_label = $default_switch_labels[$value['id']] ?? $default_switch_values[$default_key]['label']; $this->fields_form[$fieldset_key]['form']['input'][$key]['values'][$k]['label'] = $defautl_label; } } } else { $this->fields_form[$fieldset_key]['form']['input'][$key]['values'] = $default_switch_values;

Prestashop version(s)
Fresh install of PS 8.1.2

Screenshots
codfee

Prestashop 1.7.7.7

Hi,

I have problem with this module in prestashop 1.7.7.7. Can you fix this?

PS_1 7 7 7

Can't access Config Page while in Debug Mode

Describe the bug
Trying to open Config Page of the module while in Debug, if at least an order condition is supplied, in Debug Mode gives 500 error. In standard mode, it works fine
Prestashop version(s)
1.7.6.1
To Reproduce
Steps to reproduce the behavior:

  1. Fresh Install this module
  2. Enable Debug Mode
  3. Add a Rule Condition

Expected behavior
Config Page should show

Screenshots
`Symfony\Component\Debug\Exception\ContextErrorException:
Notice: Undefined index: id_codwfeeplus_conditions

at src/Adapter/Routing/LegacyHelperLinkBuilder.php:74
at PrestaShop\PrestaShop\Adapter\Routing\LegacyHelperLinkBuilder->buildActionParameters('update', 'codwfeeplus_conditions', array('id_codwfeeplus_cond' => 1, 'token' => '2cbae91ede41bd2b248ae8990f04118a'))
(src/Adapter/Routing/LegacyHelperLinkBuilder.php:55)
at PrestaShop\PrestaShop\Adapter\Routing\LegacyHelperLinkBuilder->getEditLink('codwfeeplus_conditions', array('id_codwfeeplus_cond' => 1, 'current_index' => 'http://$URL/admin-xxx/index.php?controller=AdminCODwFeePlus', 'token' => '2cbae91ede41bd2b248ae8990f04118a'))
(classes/helper/HelperList.php:865)
at HelperListCore->getEditLink('2cbae91ede41bd2b248ae8990f04118a', 1)
(classes/helper/HelperList.php:513)
at HelperListCore->displayEditLink('2cbae91ede41bd2b248ae8990f04118a', 1, null)
(classes/helper/HelperList.php:265)
at HelperListCore->displayListContent()
(classes/helper/HelperList.php:187)
at HelperListCore->generateList(array(array('id_codwfeeplus_cond' => 1, 'id_codwfeeplus_cond_array' => array('id' => 1, 'condtype' => 0), 'codwfeeplus_desc' => 'Standard', 'codwfeeplus_integration' => array('val' => 'Carrier Fee', 'condtype' => 0), 'codwfeeplus_orderstate' => 2, 'codwfeeplus_feecalc' => '<div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Fee Type</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">Fixed Fee</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Fee</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">6,00 €</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Percent</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value"><span class="label-tooltip codwfeeplus_condlist_tooltip" data-toggle="tooltip" data-html="true" title="" data-original-title="Carrier's fee is not included to the calculation.">0.00 %</span></div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Min Fee</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">0,00 €</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Max Fee</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">0,00 €</div></div>', 'codwfeeplus_conds' => '<div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Cart value is</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Carriers:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value"><span class="label-tooltip codwfeeplus_condlist_tooltip" data-toggle="tooltip" data-html="true" title="" data-original-title="TNT">1</span></div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Countries:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">States:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Zones:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Groups:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Categories:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Brands</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div><div class="codwfeeplus_sublist_row"><div class="codwfeeplus_sublist_title">Suppliers:</div><div class="codwfeeplus_sublist_divider"></div><div class="codwfeeplus_sublist_value">--</div></div>', 'codwfeeplus_tax' => array('val' => 'IT Standard Rate (22%)', 'condtype' => 0), 'codwfeeplus_active' => 1, 'position' => 0, 'class' => 'codwfeeplus_condlist_type_fee')), array('id_codwfeeplus_cond' => array('title' => 'ID', 'class' => 'codwfeeplus_list_cell_hidden', 'type' => 'text', 'align' => 'center', 'orderby' => false), 'id_codwfeeplus_cond_array' => array('title' => 'ID', 'callback' => 'callbackCondListTooltip_idandtype', 'type' => 'text', 'align' => 'center', 'orderby' => false, 'class' => 'codwfeeplus_col_id'), 'codwfeeplus_desc' => array('title' => 'Descrizione', 'type' => 'text', 'orderby' => false, 'class' => 'codwfeeplus_col_desc'), 'codwfeeplus_integration' => array('title' => 'Integration', 'type' => 'text', 'callback' => 'callbackCondListTooltip_integration', 'align' => 'center', 'orderby' => false, 'class' => 'codwfeeplus_col_integration'), 'codwfeeplus_tax' => array('title' => 'Product Tax', 'type' => 'text', 'callback' => 'callbackCondListTooltip_tax', 'align' => 'center', 'orderby' => false, 'class' => 'codwfeeplus_nowrap codwfeeplus_col_tax'), 'codwfeeplus_orderstate' => array('title' => 'Order Status', 'type' => 'text', 'callback' => 'callbackCondListTooltip_orderstate', 'align' => 'center', 'orderby' => false, 'class' => 'codwfeeplus_col_orderstate'), 'codwfeeplus_feecalc' => array('title' => 'Fee Calculation', 'type' => 'text', 'align' => 'center', 'orderby' => false, 'html' => true, 'class' => 'codwfeeplus_col_feecalc'), 'codwfeeplus_conds' => array('title' => 'Validation Rules', 'type' => 'text', 'align' => 'center', 'orderby' => false, 'html' => true, 'class' => 'codwfeeplus_col_cond'), 'codwfeeplus_active' => array('title' => 'Active', 'active' => 'status', 'type' => 'bool', 'align' => 'center', 'orderby' => false, 'class' => 'codwfeeplus_col_active'), 'position' => array('title' => 'Posizione', 'position' => 'true', 'align' => 'center', 'orderby' => true)))
(modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php:1773)
at AdminCODwFeePlusController->renderConditionsList()
(modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php:246)
at AdminCODwFeePlusController->renderView()
(classes/controller/AdminController.php:2114)
at AdminControllerCore->initContent()
(modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php:121)
at AdminCODwFeePlusController->initContent()
(classes/controller/Controller.php:292)
at ControllerCore->run()
(classes/Dispatcher.php:515)
at DispatcherCore->dispatch()
(admin-xxx/index.php:97)`

Back-office order not adding COD fee

Describe the bug
Adding order via back-office and chosing COD with Fee module for payment do not add the COD fee to transport price.

Prestashop version(s)
Actual module version 1.1.9, PS 8.1.3, PHP 8.0

To Reproduce
Steps to reproduce the behavior:

  1. set-up module, available front-office working COD fee, adding to transport fee
  2. try to make same FO-like order via BO function

Expected behavior
COD fee should be added to transport price, just as one customer makes order on front-office

Just a Warning in the log. Should help in the future version

In the log i got this warning:

AH01071: Got error 'PHP message: PHP Deprecated: The hook "header" is deprecated, please use "displayHeader" instead in module "codwfeeplus". in /var/www/vhosts/****/classes/Hook.php on line 921'

Hope it can help in future updates.

COD payment option not showing on checkout for some cases

Describe the bug
COD payment option not showing with specific condition for multi currency stores

Prestashop version(s)
1.7.6.9

Expected behavior
Showing COD at payment options

Additional context
The issue happened when I defined a condition to disable COD for a certain cart total (above 35 OMR)

https://prnt.sc/w8zmbw

Order with OMR currency works correctly

https://prnt.sc/w8zqvl

However when a customer checkout with a less value currency (AED for example)

Then it will not show COD option for order total of 119 AED (equals 11.9 OMR) (COD) should be available but it is not showing

https://prnt.sc/w8zrka

When I try with a BHD which is same value of OMR it works correctly

https://prnt.sc/w8zrh8

Note: all of my tests was with the same item with same product price

My expectation: I think COD module is treating currencies as a float (all same value) instead of checking the conversion rate as configured in prestashop

https://prnt.sc/w8zu2w

35 OMR = 350 AED = 35 BHD

Order finalization

The order can be processed with prestashop debug enabled. If debug is off, nothing happens. What may be the problem ?

Prestashop 1.7.6.1

image

COD into order datail: double amount "Notice € 45.80 paid instead of € 22.90"

Hello sakgiok, hello all. i installed successfully your module on a couple of shops. Purchase process is fine, it works in frontend.
Bbut i noticed a small flaw in the order detail

Describe the bug

  • Order process il Ok
  • Into backend, into order list, I can see the amount that the customer has paid (order + fee). That's correct.
  • But into order details > Payment Tab -> COD payment method is shown 2 times. There is a news message in red that says:
    "Notice € 45.80 paid instead of € 22.90"
  • Product price is 17,5€ + Fee 5€. Customer paid 22,90, Not 45.80

It seems to be an internal message due to some setting ... but I can't figure out what it is due to.

in another prestashop store (same PS version and same module version, same configuration) I don't have the same defect. The amount in the order detail is shown only once without the red notice

Prestashop version(s)
PS version 1.7.6.9
Cash on delivery with fee (COD) PLUS v1.1.8
Template: Warehouse
Checkout module: The Checkout
Shop has multilingual (default store)
Site is multistore (2 stores)

The other comparison shop (where I do not find the defect) has the same version of the module, the same prestashop version, it is not multilingual, it is not multistore, same module settings, same theme, same checkout module

To Reproduce
Steps to reproduce the behavior:

  1. module settiings like screenshot
  2. purchase
  3. Check into order detail if the red notice happens

Expected behavior
Hide red notice -> "Notice € 45.80 paid instead of € 22.90"

Screenshots
Checkout paymento active modules
checkout-payment-module
order list
order-list
order detail/payment
order-detail
COD module configuration
module-c1
module-c2
module-c3
module-c4

Additional context
Can someone give me some tips or indication to investigate into this?

Sync with fork / update

Hello @sakgiok ,
first of all, thanks for your plugin, I've been using it for more than a year!
Meantime I made also a partial translation to Czech language, if you're interested in, I can create a PR.

However I've found some clone of this addon https://conexiaweb.es/producto/contrareembolso-con-recargo-para-prestashop/
without even a mention of your name, which find very disappointing.

Would you mind to review this version and update/fix some possible issues from it to your master?

And once again thanks for your work, I really appreaciate it!
Kind regards,
Jarda

when changing the order, COD payment is deleted

Describe the bug
Hello,
congratulations for the module, I am having a problem with the Prestashop 1.7.6.x version when I modify the order, the cash on delivery is eliminated.
Can you fix this problem?
thank you very much

Prestashop version(s)
Prestashop 1.7.6.x

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Admin > Orders'
  2. Click on ' VIEW'
  3. Scroll down to 'Customer Details'
  4. When i edit, the payment reference (COD) is lost

translation problem

Describe the bug
will get 500 error when i try to translate the module

Prestashop version(s)
1.7.5.2

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'international'
  2. Click on 'translations'
  3. choose COD module and choose any language (i have english and arabic)
  4. See error

Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

Expected behavior
should open the translation page

Screenshots
https://prnt.sc/p6u5kc
when debug mode is enabled

Module does not work with Supercheckout

I am using the superchekout module, but selecting this payment method does not add the additional cost to the total and listing. As if it didn't exist. I have played without the module and it works correctly. Do you have to modify something in the code?

Versión de PrestaShop: 1.7.6.2

Información del servidor Linux #1 SMP Tue Mar 17 23:49:17 UTC 2020 x86_64
Versión del software del servidor: Apache/2.4.39 (Unix) OpenSSL/1.0.2k-fips
Versión PHP: 7.3.16
Límite de memoria: 512M
Tiempo máx. de ejecución: 300
Tamaño máx. para la subida de archivos: 20M
Versión de MySQL: 10.1.44-MariaDB

Malfunction plays in Supercheckout view

Screenshots
https://hosting.photobucket.com/images/p712/websolutionsnic/WhatsApp%20Image%202020-04-15%20at%2017.20.04.jpeg
https://hosting.photobucket.com/images/p712/websolutionsnic/WhatsApp%20Image%202020-04-15%20at%2017.17.23.jpeg

Additional context
Add any other context about the problem here.

Customization module

Hello Sir

I'm on PS 1.7 so I found you module very helpful and I need you help please

I installed the module for propose that it calculate payment in advance so when customer choose this method he will get information that he should pay 10% of the cart in advance
https://prnt.sc/qmifz9

so I found a solution to do that and I changed the + to - but when I confirm the order the fees are added to the price total so I need you show me how I can remove the product code from the cart validation

$total_original = $cart->getOrderTotal(true, Cart::ONLY_PRODUCTS);
        $integration = Configuration::get('SG_CODWFEEPLUS_INTEGRATION_WAY');
        if ($integration == 0) {
            //By condition
            if ($cond_integration == 1 && $CODfee != 0) {
                $this->validate_removeProduct($CODfee, $cart, $customer, $taxrule, $orderstate);
            } else {
                $this->validate_addToCarrier($CODfee, $cart, $customer, $orderstate);
            }
        } elseif ($integration == 2 && $CODfee != 0) {
            $this->validate_removeProduct($CODfee, $cart, $customer, $taxrule, $orderstate);
        } else {
            $this->validate_addToCarrier($CODfee, $cart, $customer, $orderstate);
        }

Regards

Error ajax on shoping cart resume.

It works on PS 8.0.2 but:

When selecting the cash on delivery option in the shopping cart, the price in the summary is not updated. Generate ajax error.

Is it possible to correct it?

Many thanks.

Email sent on purchase

Hello, first of all nice module!
I am having problems to translate the email that is sent after the user buys using COD payment method.
Basically I am receiving the email for "Awaiting payment by check". The thing is this email its translated already to spanish and anyway we receive it in english. You know what may cause this?

Thanks!

Error when trying to modify addresses in Order page - BO

When I try to change the address (both shipping and billing) of a back office order, paid with "cash on delivery", the shipping costs are retracted.
Even setting on Prestashop in the settings "Shop Parameters"> "Order Settings"> "Recalculate shipping costs after changing the order" on the value NO, the fee is no longer calculated in the shipping costs.

I tried to replicate the same error with a different payment but only "cash on delivery" has this problem.

Schermata 2021-08-02 alle 09 45 36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.