Zen Cart Logo
Forums / Addon Payment Modules / Duplicate freecharger module

Duplicate freecharger module

Views: 2,732

Results 1 to 15 of 15
17 Apr 2012, 10:01 PM
#1
tikii avatar

tikii

New Zenner

Join Date:
Apr 2012
Posts:
6
Plugin Contributions:
0

Duplicate freecharger module

Hi!

I make a web shop where the price must be calculated after ordering. So shopping cart will only be an order form for price inquiry. Since all prices are zero is "freecharger" module the only one that works but I have 2 options they can choose from. So what I try to do is to duplicate the "freecharger" module and change the text on one.

Does anyone know how I can do this? Or any other solutions?

18 Apr 2012, 4:12 PM
#2
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Duplicate freecharger module

FreeCHARGER??? You mean freeshipper, right? Or freeoptions maybe?
Sorry, moment of stupidity... I apologize. :blush:

18 Apr 2012, 4:20 PM
#3
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Duplicate freecharger module

I've attached a cloned module, you can try uploading that.

Let us all know if it works.

18 Apr 2012, 6:51 PM
#4
tikii avatar

tikii

New Zenner

Join Date:
Apr 2012
Posts:
6
Plugin Contributions:
0

Re: Duplicate freecharger module

balihr:

I've attached a cloned module, you can try uploading that.

Let us all know if it works.

Thank you! It comes up as an option on checkout_payment. But if they choose that option it does not show on the checkout_confirmation and order confirmation e-mail.

Do you have any solutions on this?

18 Apr 2012, 10:49 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Duplicate freecharger module

The freecharger.php is a "special" payment module ...

If you want to have two of them, you will need to further customize the code ...

Go to the Tools ... Developers Tool Kit ... and in the bottom input box enter:
freecharger

and select Catalog and click SEARCH ...

You need to customize the 3 classes that come up so that your cloned payment module can also work ...

18 Apr 2012, 10:56 PM
#6
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Duplicate freecharger module

Ajeh:

The freecharger.php is a "special" payment module ...

Oh dang... :frusty:

I totally forgot about that, my mind was still on the shipping modules... Should've tested first, my bad... :oops:

18 Apr 2012, 10:57 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Duplicate freecharger module

NOTE: you should also use:
freecharger2

vs trying to use
freecharger**_**2

that underscore will cause you issues ...

19 Apr 2012, 10:11 PM
#9
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Duplicate freecharger module

I believe we both understand what you want (especially Ajeh :smile:) but I can't help you with this. Unless Ajeh is willing to code this for you, I'm afraid you'll have to go to the Commercial help section... Sorry.

19 Apr 2012, 11:30 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Duplicate freecharger module

First, make sure you re-wrote your freecharger_2.php to be freecharger2.php and use:
freecharger2
FREECHARGER2

Next, customize the 3 class files:
/includes/classes/order.php

and around line 582 change to:

        if ($_SESSION['payment'] != 'freecharger' && $_SESSION['payment'] != 'freecharger2') {

/includes/classes/payment.php

and change the code around line 39 to:

        // Free Payment Only shows
        if ((zen_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') || zen_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER2_STATUS')) and ($_SESSION['cart']->show_total()==0 and $_SESSION['shipping']['cost']== 0)) {
          $this->selected_module = $module;
          if (file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . '/payment/' . 'freecharger.php')) {
            $include_modules[] = array('class'=> 'freecharger', 'file' => 'freecharger.php');
          }
          if (file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . '/payment/' . 'freecharger2.php')) {
            $include_modules[] = array('class'=> 'freecharger2', 'file' => 'freecharger2.php');
          }

/includes/classes/order_total.php

and change the code around line 216 to:

      if ( $difference <= 0.009 && ($_SESSION['payment'] != 'freecharger' && $_SESSION['payment'] != 'freecharger2')) {

That should allow for both Free Charger files to work ...

20 Apr 2012, 1:06 AM
#11
tikii avatar

tikii

New Zenner

Join Date:
Apr 2012
Posts:
6
Plugin Contributions:
0

Re: Duplicate freecharger module

Thank you so much, Ajeh! Both Free charger files finally works now. :D

20 Apr 2012, 1:09 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Duplicate freecharger module

You are most welcome ... just took awhile to hunt through the code and find all the changes needed ... :lamo:

4 Jun 2012, 12:08 AM
#13
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: Duplicate freecharger module

What the heck is freecharger. I cant find any information on it.

4 Jun 2012, 2:13 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Duplicate freecharger module

The Payment Module for Zen Cart Free Charger freecharger was renamed in v15 to the Payment module Free Order freecharger ...

It is used for Orders that are $0.00 orders ...

4 Jun 2012, 5:38 PM
#15
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: Duplicate freecharger module

Well thanks for the partial answer. It would be nice if there was some documentation on that so I wouldnt have to post.:D