Jump to content

[Module] Cash on delivery (COD) v0.5 with fixed and percentage fees


Recommended Posts

Hi, I have created a module for my 1.3.2 Prestashop (PS3Pic) modfying Prestaworks v0.4 "Cash on delivery with fee" module because I want to set a fixed and percentage fees for Cash on delivery payment (same as PayPal module). I attach here for free because I have downloaded some modules from other users for free too.

cashondeliverywithfee.zip

  • Like 3

Share this post


Link to post
Share on other sites
  • Replies 220
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Workfull Cashondelivery Module from PrestaHost.cz for 1.5.X PS Version.   CASHONDELIVERYPLUS.zip cashondeliveryplus.zip

Hi, I have created a module for my 1.3.2 Prestashop (PS3Pic) modfying Prestaworks v0.4 "Cash on delivery with fee" module because I want to set a fixed and percentage fees for Cash on delivery payment

OCTOBER 2015: NEW COD WORKS ON 1.5.6.0 & 1.6.0.9 & 1.6.0.11 & 1.6.1 (PRESTA-APPS.COM  FREE RELEASE)   October 2015. I recommend Presta App Module. I have tried with 100 buyers in my web.

Posted Images

In the spanish forum post of my module "filer 1" user have asked me if I could make one modification of 0.5 version, to add a maximum value. I have did it and I attach here 0.6 version modified for this purpose. I have tested it but... test it before "if the flies" (HAHAHA, it's a spanish expresion but I don't know it translation to english language). I have translated fully the module to english and spanish lagunages.

User instructions
Set your choice in radio buttons (fixed tax, percentage tax or both).
Set the value in the amount box and/or in the percentage box, depends of your choice.
If you wan't a minimum value for percentage or fixed plus percentage fees, enter the value in minimum fee box.
If you wan't a maximum value for percentage or fixed plus percentage fees, enter the value in maximum fee box.
If minimum fee is higher than maximum fee maximum fee doesn't works.
To deactivate the minimum and maximum fees set it to 0 (zero) value.

cashondeliverywithfee-v0.6.zip

Share this post


Link to post
Share on other sites
  • 2 weeks later...

To install it you must unzip the zip file and put the folder cashondeliverywithfee in your prestashop modules folder. Go to Modules in your back office and press Install. Then push in "Configure" and you will enter to the configuration page for set the values you want. You must install the module to configure it.

User instructions
Set your choice in radio buttons (fixed tax, percentage tax or both).
Set the value in the amount box and/or in the percentage box, depends of your choice.
If you wan’t a minimum value for percentage or fixed plus percentage fees, enter the value in minimum fee box.
If you wan’t a maximum value for percentage or fixed plus percentage fees, enter the value in maximum fee box.
If minimum fee is higher than maximum fee maximum fee doesn’t works.
To deactivate the minimum and maximum fees set it to 0 (zero) value.

Share this post


Link to post
Share on other sites

Congratulations "mister-design", there was an error in the module. But only if you set the tax in fixed plus percentage, there was an error calculating the COD fee. I think that there are only two persons (you and me) that have set the module with this configuration because nothing more have told me anything and I made several tests but I didn't see the bug in the final step.

You are in the credits of this 0.7 version. Please, people who have downloaded 0.6 version, update your module to 0.7 although you aren't using fix plus percentage tax because you could use it in the future.

cashondeliverywithfee-v0.7.zip

Share this post


Link to post
Share on other sites

Hallo zantos

Thx for the modul, now it works fine.

One Question:
Is it possible to show after the order process an other site
like the bankwire modul?
I think its better to show the customer a site like:

....Thank you for your order, more details we send you in a mail bla bla.......

Thx mister-design

Share this post


Link to post
Share on other sites

Hi "mister-design", you are fully testing my modified module, best than me, HAHAHA. I tested it and this issue was from 0.4 Prestaworks version (the other issue was my fault but not this). I attach here the 0.8 version fixed. Now at the finish of the order you will see a confirmation instead of history orders page. This isn't a working issue, people who have 0.7 version could use it but I recommend to update it to be up to date with latest changes.

cashondeliverywithfee-v0.8.zip

  • Like 1

Share this post


Link to post
Share on other sites

Hi zantos

Thx for the fast answer.
Now it works very good.

Thx for that great Module ;-)

Is it possible to display the Cod-Fee additional to the total price?:

Example:

Total Price 50€
COD Fee: 5 €
---------------------------
Total Price with Fee 55€

Can you give me a code snippet for the tpl.?

regards mister-design

Share this post


Link to post
Share on other sites

Genial !!!! funcionando 100%

Lo que no logro es poder modificar el texto que hay dentro de la caja, la que ve el usuario, ver; Pago por reembolso: +2.5€ es un poco pobre, he mirado en traducciones y no logro ver donde modificar eso.

Saludos y buen fin de semana

Share this post


Link to post
Share on other sites

mister-design this is a new implementation and takes me a lot of time, I have other request in the spanish forum and I will try to make both but slowly.

tafisa, busca esa frase en el archivo es.php la carpeta del módulo y modificala a tu gusto.

Please, there is some people doing test in my shop (I have seen some orders without sense). Don't do this, you can use Prestashop demo shop to make your test as I do.

Share this post


Link to post
Share on other sites
Genial !!!! funcionando 100%

Lo que no logro es poder modificar el texto que hay dentro de la caja, la que ve el usuario, ver; Pago por reembolso: +2.5€ es un poco pobre, he mirado en traducciones y no logro ver donde modificar eso.

Saludos y buen fin de semana


Si lo que quieres es modificar el texto, imagenes, posición, añadirle el precio total a pagar y muchas mas cosas eso lo haces todo desde el payment.tpl

Share this post


Link to post
Share on other sites
  • 4 weeks later...

I wrote the translation to Italian for module v0.8.
Ho scritto la traduzione in italiano per il modulo v0.8.

Attached modified it.php. You may include in next release.
In allegato it.php modificato. Può essere incluso nella prossima release.

it.php

Share this post


Link to post
Share on other sites

Hi zantos,

I am also very, very interested in the same function like mister-design.

Is it possible to display the Cod-Fee additional to the total price?:

Example:

Total Price 50€
COD Fee: 5 €
—————————————-
Total Price with Fee 55€

Thanks
wind

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hi
I am new to all this, and have installed your nice module. When choosing COD, the total in order summary is updated, but neither the cart module not the summary in header is updated with the new total. It looks confusing. Can thie be adjusted some how?
Thank you

Share this post


Link to post
Share on other sites
  • 1 month later...

Hello,
I found this module very useful.
I am testing it on PrestaShop 1.3.6 and it works very well so far.

I noticed that the override is not supported. I compared the module with the original cashondelivery module and something is missed to load the .tpl from the theme path:

     $template = 'validation.tpl';
    if (file_exists(_PS_THEME_DIR_.'modules/cashondeliverywithfee/'.$template))
      echo Module::display('cashondeliverywithfee', $template);
    else
        echo Module::display(__FILE__, $template);



It would be nice if next version will have this directly included in validation.php file

Thank you!

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 2 weeks later...

Hi Zantos,

Looks you have made a great module here,

is it also suitable/adjustable to give the customer % Discount?

I f have tried to configure with 15%discount, but unfortumately I can not complete the test order as it give following error: Hack attempt (Order -> total_shipping = -8.25)

I want to use it for giving customers a 15% discount when they come to me to pickup the order.

How can adjust so it will be accepted as 15% discount or negative shipping costs?

Thank you
kind regards

Marianne

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...

I have tested in 1.4.1

It recognizes the module, I have installed it. In the payment methods the module is seen, after you have chosen COD with extra fee, a blank screen comes "No template found for module validation" written on it. validation php must be edited I think. You can not see the buttons "other payment methods" and "I confirm my order"...

If somebody knows Please help

Share this post


Link to post
Share on other sites
  • 2 weeks later...

The only clue i have....

Check in your module, that error comes up from calling of function Module::display.

In PS 1.3, you call by:

Module::display(FILE, ‘.tpl’);

But in PS 1.4, you should call:

Module::display(dirname(FILE).’/’.’’, ‘.tpl’);



from
VNguyen

http://www.prestashop.com/forums/viewthread/108548/third_party_modules/module_cashondeliverywithfeeaural__no_template_found_for_module_validation_1_dot_4_dot_1/


If somebody found the solution, please post it

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 2 weeks later...
Solved,
Author has released a 1.4 version also free :-)

Thanks to

http://prestashop-module.de/payment/82-nachnahme-mit-nachnahmegebuhr-modul-fuer-prestashop.html


Hi,

I installed the module in my prestashop 1.4.2.5 and it calculates well. However, when I confirm the last step gives this result: "An order has already been placed using this cart"

Do I have to do any other configurations?

Please help

Share this post


Link to post
Share on other sites

An order has already been placed using this cart...


modules/cashondeliveryvithfee/cashondeliveryvithfee.php.

Check all:

$cart->OrderExists() === 0

and change to:

!$cart->OrderExists()

Share this post


Link to post
Share on other sites
  • 2 weeks later...
An order has already been placed using this cart...


modules/cashondeliveryvithfee/cashondeliveryvithfee.php.

Check all:

$cart->OrderExists() === 0

and change to:

!$cart->OrderExists()


Hi MarcoM

The bills of COD are now without Tax.

Please help

Share this post


Link to post
Share on other sites
Yes it is working with the change of MarcoM.
However, the bills of COD are now without Tax.

Please ngalfas, can you check on your bill?


i dont have tax on courier price, so i don't have a problem.

Share this post


Link to post
Share on other sites
Yes it is working with the change of MarcoM.
However, the bills of COD are now without Tax.

Please ngalfas, can you check on your bill?


i dont have tax on courier price, so i don't have a problem.


Hi ngalfas,

It's not the shipping tax, it's the product tax. although it calculate all taxes but it doesn't reflect it in the bill!!!

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 4 weeks later...

hello,

on PS 1.4.4 didn't work it says :

 

 

No hay se encuentra plantilla para el módulo validation

 

 

"There is no template for the validation module"

 

What can I do??

 

Many Thanks

Share this post


Link to post
Share on other sites

Muchas gracias!!!

Llevaba batallando y probando un montón de módulos de contra reembolso para prestashop.

Para mi tienda prestashop 1.3.1.1 la solución ha sido instalar Cash on delivery 0.8.

 

Escribo el post para google!!!

 

 

Saludos

Share this post


Link to post
Share on other sites

hello, an order placed with Cash on delivery (COD).<br/>by canceling the articles he did not return to stock.<br/>can help?

 

Hi,

Have you found the solution for calculate a correct stock amount after cancellation?? ( in v. 1.3) Please let me know. Thanks

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...
  • 3 months later...

hi zantos.. while i am clicking on the payment module (cod with fee) on the purchase it goes to another page..

 

No template found for module validation

 

and it just stops there.. any issue with this or any setting i missed out ?

thanks

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 2 months later...

Anyone please!! Same problem as johnnyme, tiga, rene, etc.

 

If you know something just tell me, because i really need this module.

 

Or if you know any other module that works with cash method payment in 1.4.3 i'll be very greatful!

  • Like 1

Share this post


Link to post
Share on other sites

I can upload a working version of the module but i dont know how.

Give me directions how to upload files in my post and i will give it to you.

It works fine in PS 1.4.7.3

Share this post


Link to post
Share on other sites

I'm having problem with translation of this module.. When making translation though Tools->Translations, prestashop doesn't save all phrases.. And it keps using english language.. I deleted previous standard COD module and presta was able to save 3 default-payment phrases, but all 9 payment-validation phases are still impossible to save..

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 2 weeks later...

I have 2 carriers: One is free, the other not.When I choose the free one I get a blank field where I want to choose my payment.

The other carrier is working fine. Can someone solve this?

Thanks

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 5 weeks later...
  • 1 month later...
  • 4 weeks later...
  • 2 months later...
  • 3 weeks later...

I had install it but how to use it because it didn't appear on the front office when i check out. it just show one shipping company which is the one i configure but the cod does not appear. i'm using prestashop 1.5.4.1.

Is there any setting that i need to do? If yes where should i configure.

Besides, this case also same as i install the free cod thats come with prestashop. i had install it but it doesn't appear on the front office.

Please help!!!

Share this post


Link to post
Share on other sites

I had found it out what is the problem because i was in step 1 and that's why it is not there. It only appear on the last step. Any how the module not working after clicking confirm order it takes me to the blank page.

Share this post


Link to post
Share on other sites

Active el log de errores y me salto el siguiente error : Fatal error: Class 'QuantityDiscount' not found in /var/....../modules/cashondeliverywithfee/cashondeliverywithfee.php linea 410

Me sucedía a veces si y otras no porque en esa linea de codigo tenía una condición que sólo entraba si había seleccionado más de un artículo.

 

 

La solución es editar el fichero cashondeliverywithfee.php y cambiar

 

 

Cambiar :

																		  /* Quantity discount */
																		  $reduc = 0.0;
																		  if ($product['cart_quantity'] > 1 AND ($qtyD = QuantityDiscount::getDiscountFromQuantity($product['id_product'], $product['cart_quantity'])))
																		  {
																						  $reduc = QuantityDiscount::getValue($price_wt, $qtyD->id_discount_type, $qtyD->value);
																						  $price -= $reduc / (1 + floatval($tax) / 100);
																		  }

Por

										   							   $reduc = 0.0;	
																		  if ($product['cart_quantity'] > 1)
																		  {
						   			   $quantityDiscount = SpecificPrice::getQuantityDiscount((int)$product['id_product'], Shop::getCurrentShop(), (int)$cart->id_currency, (int)$vat_address->id_country, (int)$customer->id_default_group, (int)$product['cart_quantity']);
		        		    		   $unitPrice = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? intval($product['id_product_attribute']) : NULL), 2, NULL, false, true, 1, false, (int)$order->id_customer, NULL, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
   		    			    	   $reduc = $quantityDiscount ? ((Product::getTaxCalculationMethod((int)$order->id_customer) == PS_TAX_EXC ? Tools::ps_round($unitPrice, 2) : $unitPrice) - $quantityDiscount['price'] * (1 + $tax_rate / 100)) : 0.00;
																		     $price -= $reduc / (1 + floatval($tax) / 100);												      
																		  }

 

Probado en versión 1.4.10!!!

  • Like 2

Share this post


Link to post
Share on other sites

hi.

 

i'm using presta 1.5.3.1 and i installed v.9 but i also get the...

 

"No template found for module validation"

 

... error.

 

see attached "NoTemplateError".+

 

is there a fix for this?

 

thanks,

jez....

post-520279-0-96895700-1368481881_thumb.png

Share this post


Link to post
Share on other sites

hi.

 

i'm using presta 1.5.3.1 and i installed v.9 but i also get the...

 

"No template found for module validation"

 

... error.

 

see attached "NoTemplateError".+

 

is there a fix for this?

 

thanks,

jez....

 

 

¿has comprobado que el fichero validation.php tenga las siguientes lineas?

 

   $smarty->assign('this_path', __PS_BASE_URI__.'modules/cashondeliverywithfee/');
   $template = 'validation.tpl';
   echo Module::display('cashondeliverywithfee', $template);

 

Fijate bien porque me he encontrado en módulos que se llamaba a un directorio incorrecto como por ejemplo :

 

   $smarty->assign('this_path', __PS_BASE_URI__.'modules/cashondelivery/');

 

NOTA : Tienes qjue cambiar la palabra 'cashondelivery' por 'cashondeliverywithfee'

Share this post


Link to post
Share on other sites