PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

[Module] Offline CreditCard + Show Parcels Module UPDATE 23/09/2009

134 replies to this topic
#1
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
This Module is a merge of Off Line Credit Card and Show Parcels.

- Off Line Credit card by By Kevin (http://Ox40.us/).
- Showparcels: By Mend's (master_odlanier@hotmail.com).

- Tested with 1.2.3 and 1.2.4 PS versions.
- I have made a lot of changes in order to make both modules working like only one, and I think I did it.


Please tell me what do you think about it.

Tip: If nothing is filled in the showparcels fields, it works like the original CreditCard module, but with several and deep changes.

Update: Solved a hack attempt issue.

To prevent problems with the totals in PDF Invoice.

After line 491, in classes/PDF.php, search for:

if (!self::$orderSlip OR (self::$orderSlip AND self::$orderSlip->shipping_cost))
{
$pdf->Cell($width, 0, self::l('Total with Tax').' : ', 0, 0, 'R');
$pdf->Cell(0, 0, self::convertSign(Tools::displayPrice((self::$orderSlip ? ($totalProductsTi + self::$order->total_discounts + self::$order->total_shipping) : self::$order->total_paid), self::$currency, true, false)), 0, 0, 'R');
$pdf->Ln(4);
}

And replace:

if (!self::$orderSlip OR (self::$orderSlip AND self::$orderSlip->shipping_cost))
{
if(self::$order->module == 'creditcard')
$pdf->Cell($width, 0, self::l('Total with Tax and/or CreditCard Surchage').' : ', 0, 0, 'R');
else
$pdf->Cell($width, 0, self::l('Total with Tax').' : ', 0, 0, 'R');
$pdf->Cell(0, 0, self::convertSign(Tools::displayPrice((self::$orderSlip ? ($totalProductsTi + self::$order->total_discounts + self::$order->total_shipping) : self::$order->total_paid), self::$currency, true, false)), 0, 0, 'R');
$pdf->Ln(4);
}


It allow to show a different message if is a credicard order.

Attached Files


My Blog
PS v1.4.7.0

#2
dnmusic

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts
This might be quite handy as a Layaway module. Will work with it some and see what happens. Thanks!

#3
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
Hi, deepee

You have to set the number of parcels:
eg: interest tax-> 2%; number of parcels-> 1, or 2, or 3....or 12....or 24.....
My Blog
PS v1.4.7.0

#4
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
Hi Ehinarr

Thanks for the pointer.

I have tried changing the value in the "number of parcels" field.
It will accept any value I insert, but the "Add" button does not work and the total order value does not get increased by 2%

I checked again and don't seem to be missing anything?

Thanks
Deepee

#5
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
The Add button is for to add more cards, go to the front office and you will see the parcelling option. Otherwise, click modules->creditcard->configuration and you will see your settings.
My Blog
PS v1.4.7.0

#6
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
Thanks, yes I can see how it works now.

I was really looking for a way to add a standard 2% surcharge for credit card payments but I don't think I can do it with this module.

Thanks anyway for all your help.
Deepee

#7
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
It only works with more than one parcel.
My Blog
PS v1.4.7.0

#8
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
Got you.
Most of our products are single items.

Do you know of any other way to globally add a fixed percentage to credit card payments?

Thanks
Deepee

#9
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts

From 1252457377:

Got you.
Most of our products are single items.

Do you know of any other way to globally add a fixed percentage to credit card payments?

Thanks
Deepee


Try this:

in credicard.php, near line 255 and 338, let it like bellow:

/** CHECA SE É A PRIMEIRA PARCELA E DEIXA-A LIVRE DE JUROS **/
//if ( $i_par == 1 )
//{
// $montante = $valor * $i_par;
// $texto = '';
//}


It add a percentual also to the first parcel (1x).
My Blog
PS v1.4.7.0

#10
booblebab

    PrestaShop Apprentice

  • Members
  • PipPip
  • 102 posts
Good job! But the Credit Card module doesn't seem to work with 1.2.3...? Any experience? When I click to install it the first time, it does nothing. Then the second time it shows "The following module(s) were not installed successfully: creditcard", but does have the green thing next to its name...

And seems to work at times in the store...

...However, I can no longer update any of the module translations - the whole section is dead...

#11
VIXUS

    PrestaShop Addict

  • Members
  • PipPipPip
  • 583 posts
sounds interesting but it don't work on v1.1
it freezes entire modules listing

#12
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
Thanks very much for the mod, Ehinarr.

The first chance I got to have a look at it was this morning.

I edited creditcard.php and got the following error in Admin> Backoffice> Modules :-
"Parse error(s) in module(s)"

After this, the credit card module did not function at all.

I checked the code and the line following the mod, in both instances, started with "elseif"
I changed them both to "if" and the module started functioning again.

I went back to the parcels configuration in the credit card module admin page and enabled 2.% in "Interest Tax" field and "1" in the "Number of Parcels" field.

I tried a credit card sale with a value of $552.50

In the Order Summary page I can see:-

"Parcelling Options for Credit Card Payment
-> 1x with Fee of $563.55"

This is the correct value after 2% has been added.

However, when I complete the checkout, the order confirmation page shows:-

"Your order is now complete.
Once your card has been verified and funds have been accepted, your order will be shipped.
- Total Payment Pending: $552.50"

The 2% is not actually being added to the final total.

I should mention that I'm running version 1.2.1.0

Is there something else I need to change?

Thanks
deepee

#13
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts

From 1252853429:

Good job! But the Credit Card module doesn't seem to work with 1.2.3...? Any experience? When I click to install it the first time, it does nothing. Then the second time it shows "The following module(s) were not installed successfully: creditcard", but does have the green thing next to its name...

And seems to work at times in the store...

...However, I can no longer update any of the module translations - the whole section is dead...


From 1252874191:

sounds interesting but it don't work on v1.1
it freezes entire modules listing


I do not know what can be, it is up and running in both version 1.1 and in 1.2.3 of PS.
My Blog
PS v1.4.7.0

#14
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts

From 1252880018:


"Your order is now complete.
Once your card has been verified and funds have been accepted, your order will be shipped.
- Total Payment Pending: $552.50"

The 2% is not actually being added to the final total.



That I had not noticed. Wait a little while I do some tests.
My Blog
PS v1.4.7.0

#15
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
Hi, deepee

I added another version which I hope that solves your problem.
My Blog
PS v1.4.7.0

#16
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
Hi Ehinarr

Thank you for all your efforts on this.

I just downloaded, installed/configured it.

Unfortunately it is not adding the 2.00% I set in the "Interest Tax" field.

The Order Summary shows - "The total amount of your order is $144.92"

But the Parceling Options for Credit Card Payment shows: " -> 1x with Fee of $144.92"

I tried uninstalling and re-installing/reconfiguring it but still the same.

Anything else you would like me to try?

Thanks
Deepee

#17
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
Look at the picture below, it is not what you wanted?

Attached Files


My Blog
PS v1.4.7.0

#18
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
I was hoping to just have a single option to apply a 2% fee for all credit card transactions.

Using your original module and recent modification you can see that the parceling option in the order summary does correctly apply the fee.

But if you look at the order confirmation, the total does not contain the 2%

If it had worked I was then hoping to change the text "Parceling Options for Credit Card Payment" to "Credit Card Surcharge"
and change the text " -> 1x with Fee of $144.92" to "Includes 2% Credit Card Fee"

Thanks
deepee

Attached Files



#19
booblebab

    PrestaShop Apprentice

  • Members
  • PipPip
  • 102 posts

From 1252882596:

From 1252853429:

Good job! But the Credit Card module doesn't seem to work with 1.2.3...? Any experience? When I click to install it the first time, it does nothing. Then the second time it shows "The following module(s) were not installed successfully: creditcard", but does have the green thing next to its name...

And seems to work at times in the store...

...However, I can no longer update any of the module translations - the whole section is dead...


I do not know what can be, it is up and running in both version 1.1 and in 1.2.3 of PS.


hmm... so nobody has gotten that error message? weird :(

its such a nifty module that i want it to work! :(

#20
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
I'm working for it to work properly. Please pay attention that I just did the merge of the modules. Thus, each one has its own operating characteristics. All reports of problems are being analyzed in order to find a solution for everyone. I hope to finalize the adjustments soon.
My Blog
PS v1.4.7.0