Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

GOOGLE CHECKOUT IPN


ski2bbad

Recommended Posts

  • Replies 236
  • Created
  • Last Reply

Top Posters In This Topic

Hi

 

I really need some help I don't have any programming skills I manage to installed Google contribution but it's not working I've tried checking out and it's not transferring to Google so customers are unable to enter there information

 

Thanks

Link to comment
Share on other sites

Hi

 

I really need some help I don't have any programming skills I manage to installed Google contribution but it's not working I've tried checking out and it's not transferring to Google so customers are unable to enter there information

 

Thanks

:'(

Link to comment
Share on other sites

on catalog/includes/modules/payment/google.php:

 

FIND:
		  $tax = number_format($value['tax'] / 100, 2, '.', '');

CHANGE TO:
		  $tax = number_format($value['tax'] / 100, 4, '.', '');

 

If shipping charges are taxable where you reside you also need to change (same file catalog/includes/modules/payment/google.php)

 

FIND:
							  $data .= '				<shipping-taxed>false</shipping-taxed>' . $eol;
CHANGE TO:
							  $data .= '				<shipping-taxed>true</shipping-taxed>' . $eol;

FIND:
							  $data .= '				<rate>' . $default_tax_rate . '</rate>' . $eol;
CHANGE TO:
							  $data .= '				<rate>' . $tax . '</rate>' . $eol;

Hello Ski,

 

I just want to say well done! And, thanks for your time and efforts here!

 

Regards,

 

CT

Link to comment
Share on other sites

Hi

 

I really need some help I don't have any programming skills I manage to installed Google contribution but it's not working I've tried checking out and it's not transferring to Google so customers are unable to enter there information

 

Thanks

:'(

 

We may be able to help you, but you need to be more specific with your posts. Did you follow the Instructions on the Readme file of the GC IPN module? Give us a general idea of where (which page) your problem is occuring. Be specific, otherwise, it's like flying in a fog.

 

ski

Link to comment
Share on other sites

We may be able to help you, but you need to be more specific with your posts. Did you follow the Instructions on the Readme file of the GC IPN module? Give us a general idea of where (which page) your problem is occuring. Be specific, otherwise, it's like flying in a fog.

 

ski

 

Hi Ski

 

The problem is happen just after the customer enters there Delivery Information, then after that were the customer is supossed to enter Payment Information there are not being transferred nor can they enter any payment details.

 

 

this is the readme file that came with payment module GOOGLE CHECKOUT MODULE FOR OSCOMMERCE v1.1 - 10/03/2006

 

INTRODUCTION

============

The Google Checkout module for osCommerce adds Google Checkout as a Checkout Module within osCommerce.

This will allow merchants using osCommerce to offer Google Checkout as an alternate checkout method.

The plugin provides Level 2 integration of Google Checkout with osCommerce.

 

Plugin features include:

1. Posting shopping carts to Google Checkout

2. Shipping support (Currently, flat rates, item rates and table rates are supported)

3. Tax support

4. User and order updates within osCommerce

5. Order processing using osCommerce Admin UI

 

 

REQUIREMENTS

============

osCommerce v2.2

PHP3 or PHP4 or PHP5 with cURL(libcurl) installed and enabled

 

 

INSTALLATION NOTES

==================

* Follow instructions contained in the INSTALLATION file.

* register_globals can be either On or Off.

Verify the installation from the Admin site and selecting MODULES->PAYMENTS and checking if Google Checkout is listed as a payment option.

 

 

SETUP ON ADMIN UI

=================

Select and install the Google Checkout payment module. The following are some of the fields you can update:

 

1. Enable/Disable: Enable this to use Google Checkout for your site.

2. Merchant ID and Merchant Key:(Mandatory) If any of these are not set and the module is enabled, a disabled (gray) Checkout button appears on the Checkout page.

Set these values from your seller Google account under the Settings->Integration tab.

3. Operation Mode: Test your site with Google Checkout's sandbox server before migrating to production. You will need it signup for a separate Google Checkout sandbox account at http://sandbox.google.com/sell. Your sandbox account will have a different Merchant ID and Merchant Key. When you are ready to run against the production server, remember to update your merchant ID and key when migrating.

4. Shipping Options: Select the shipping options to be supported.

If the shipping tax rates differ, a disabled Checkout button will appear on the Checkout page.

 

Your Google Checkout setup page is correct if, upon viewing it, a non-disabled Google Checkout button appears.

 

 

TRACKING USERS AND ORDERS

=========================

In order to provide this support (as required for Level 2 integration), update the API callback request field in the seller account to https://<url-site-url>/catalog/googlecheckout/responsehandler.php . Note that the production Checkout server requires an SSL callback site.

The Sandbox server accepts non SSL callback URLs.

 

View your Google Checkout customers and their orders in the Reports tab.

For each order, the default starting state is PENDING.

The state changes to PROCESSING and DELIVERED as follows; corresponding messages will be sent out to the Checkout server for order processing.

 

| Original State | New State | Action | Customer Notification |

| PENDING | PROCESSING | charging the order | Processing order message |

| PROCESSING | DELIVERED | marking the order for delivery | Shipped order message |

 

Any comments added during state change will be sent to the buyer account page if you have selected the Append Comments option.

 

All request and response messages will be logged to the file catalog/googlecheckout/response_message.log.

In case an order payment is declined or an order is cancelled(by Google or otherwise), you can add code to catalog/googlecheckout/responsehandler.php for any specific actions you need to take.

 

 

PROJECT HOME

============

To check out the latest release or to report issues, go to http://code.google.com/p/google-checkout-oscommerce

 

 

GROUP DISCUSSIONS

=================

To meet other developers and merchants who have integrated Google Checkout with osCommerce and to discuss any topics related to integration of Google Checkout with osCommerce, go to http://www.oscommerce.com/forums/index.php?showtopic=229637

Link to comment
Share on other sites

Hi Ski

 

The problem is happen just after the customer enters there Delivery Information, then after that were the customer is supossed to enter Payment Information there are not being transferred nor can they enter any payment details.

this is the readme file that came with payment module GOOGLE CHECKOUT MODULE FOR OSCOMMERCE v1.1 - 10/03/2006

 

Queen-T.

 

There is your problem right there. This forum is for the Google Checkout IPN contribution. I have no idea about the GOOGLE CHECKOUT MODULE FOR OSCOMMERCE v1.1 - 10/03/2006 contribution. You need to find their forum and they will be able to help you there.

 

Good luck,

 

ski

Link to comment
Share on other sites

I tried that with discount coupons it still does not work

 

Thought you said in your PM to me that you had coupons working?

 

If this is kgt discount coupons then no it does not work for me either. kgt suggested a couple of code changes but they have not worked and I have not had time to go back to this at the moment. Take a look at the discount coupon thread and you will see these posts.

 

You can use google coupons though? I can't because they are not working for the UK at present......

Link to comment
Share on other sites

Are you using STS? I just installed this on a site using STS and got the same problem.

 

Here is how to fix it:

 

Open includes/sts_display_output.php:

Find

|| strpos($scriptname, "info_shopping_cart") !== false

 

Add after (on the same line):

|| strpos($scriptname, "google_checkout_process") !== false

 

This will stop STS from trying to process the google checkout page (which was resulting in the blank page)

 

This does not work with the STS 4.x versions

 

 

 

Jimmy

I'm not a coder just a splicer.

Link to comment
Share on other sites

hi.

i just installed googlecheckoutIPN and testing it on sandbox.

 

the order gets to google no problem, but i cant have google to updated the status of the order in my OSCstore.

 

after different tests, i am trying something very stupid:

  1. is ste the API callback URL:www.mysite.com/google_ipn.php
  2. on my site, i edited google_ipn.php so that in the first lines i wrote:
    $fp = @fopen("gclog/google_log.txt","a");
    @fwrite($fp, "hallo world");
    @fclose($fp);
  3. i buy something, then also change the status of the order in google
  4. nothing happen in my store!

according to point2, when google callback www.mysite.com/google_ipn.php it should write HALLO inside google_log.txt

But it doesnt.

If i broswe www.mysite.com/google_ipn.php directly from my browser, instead, google_log.txt is correctly edited.

 

which makes me think that google DOEST call google_ipn.php at anytime.

 

What mistake am i doing?

is that because i am working on sandbox?

 

thanks everyone for support!

Expresionario.com | Pura Sub-cultura!

Link to comment
Share on other sites

hi.

i just installed googlecheckoutIPN and testing it on sandbox.

.....

What mistake am i doing?

is that because i am working on sandbox?

 

thanks everyone for support!

 

ops. sorry. it seems that in fact i am getting the calls from sandox.google.

so forget about what i wrote before please.

 

Now the problem seems to be that we don't save the google_order_id in our DB, so we cant update the status as the matching will fail.

 

I will post again when i will be more clear about my problem

thanks

Expresionario.com | Pura Sub-cultura!

Link to comment
Share on other sites

Ok.

this is the situation:

 

google is reporting the error:

 

Cannot find the declaration of element 'add-merchant-order-number' in

<?xml version="1.0" encoding="UTF-8"?>

<add-merchant-order-number xmlns="http://sandbox.google.com/checkout/schema/2" google-order-number="861522794689330">

<merchant-order-number>0</merchant-order-number>

</add-merchant-order-number>

 

This XML is sent from Us to google when google calls google_ipn.php

In fact the merchant-order-number is =0, as no ID is saved in the table google_checkout_logs.google_order_id when we create the order in our system.

 

I am not sure on what is the logic behind this.

We FIRST create an order on our system, then send its details to google to process.

Google will generate a google_order id on its own DB, then once it has processesd the order will get back to our system with its ID.

 

Our system now is supposed to create a link between OUR ID and google ID, and then send back to google this linkage information (using the XML above)

 

But because the order ID is generated in our system BEFORE going to google, how can we make the match between the 2 IDs? what is the problem ? or am i just missing something?

thanks

jacopo

Expresionario.com | Pura Sub-cultura!

Link to comment
Share on other sites

Ok.

this is the situation:

 

google is reporting the error:

 

Cannot find the declaration of element 'add-merchant-order-number' in

<?xml version="1.0" encoding="UTF-8"?>

<add-merchant-order-number xmlns="http://sandbox.google.com/checkout/schema/2" google-order-number="861522794689330">

<merchant-order-number>0</merchant-order-number>

</add-merchant-order-number>

 

This XML is sent from Us to google when google calls google_ipn.php

In fact the merchant-order-number is =0, as no ID is saved in the table google_checkout_logs.google_order_id when we create the order in our system.

 

I am not sure on what is the logic behind this.

We FIRST create an order on our system, then send its details to google to process.

Google will generate a google_order id on its own DB, then once it has processesd the order will get back to our system with its ID.

 

Our system now is supposed to create a link between OUR ID and google ID, and then send back to google this linkage information (using the XML above)

 

But because the order ID is generated in our system BEFORE going to google, how can we make the match between the 2 IDs? what is the problem ? or am i just missing something?

thanks

jacopo

 

 

 

Hello Jacopo, here is the solution maybe :)

find this page /catalog/include/modules/payment/google.php

find function after_process() and replace $data = $this->gen_shopping_cart($insert_id); with $data = $this->gen_shopping_cart(((int)$insert_id)); //maybe 91

find function gen_shopping_cart and

replace $data .= ' <tax-table-selector>tax-' . $value['id'] . '</tax-table-selector>' . $eol;

with $data .= ' <tax-table-selector>tax-' . (int)$value['id'] . '</tax-table-selector>' . $eol; maybe 193

 

replace $alternate_tax .= ' <alternate-tax-table name="tax-' . $value['id'] . '" standalone="false">' . $eol;

with $alternate_tax .= ' <alternate-tax-table name="tax-' . (int)$value['id'] . '" standalone="false">' . $eol; maybe 195

 

 

AND DO NOT forget Set up API callback URL to your site in google

AND DO NOT forget Select XML for "Callback Method"

 

That's all

^_^

Link to comment
Share on other sites

google is reporting the error:

 

Cannot find the declaration of element 'add-merchant-order-number' in

<?xml version="1.0" encoding="UTF-8"?>

<add-merchant-order-number xmlns="http://sandbox.google.com/checkout/schema/2" google-order-number="861522794689330">

<merchant-order-number>0</merchant-order-number>

</add-merchant-order-number>

 

I also saw this error in google checkout but mysteriously it does not seem to have produced any problems with the order or updating it yet?

Link to comment
Share on other sites

Ok.

this is the situation:

 

google is reporting the error:

 

Cannot find the declaration of element 'add-merchant-order-number' in

<?xml version="1.0" encoding="UTF-8"?>

<add-merchant-order-number xmlns="http://sandbox.google.com/checkout/schema/2" google-order-number="861522794689330">

<merchant-order-number>0</merchant-order-number>

</add-merchant-order-number>

 

This XML is sent from Us to google when google calls google_ipn.php

In fact the merchant-order-number is =0, as no ID is saved in the table google_checkout_logs.google_order_id when we create the order in our system.

 

I am not sure on what is the logic behind this.

We FIRST create an order on our system, then send its details to google to process.

Google will generate a google_order id on its own DB, then once it has processesd the order will get back to our system with its ID.

 

Our system now is supposed to create a link between OUR ID and google ID, and then send back to google this linkage information (using the XML above)

 

But because the order ID is generated in our system BEFORE going to google, how can we make the match between the 2 IDs? what is the problem ? or am i just missing something?

thanks

jacopo

 

Hi jacopo,

 

I also experience your problem and I am working on the issue. For now, I have been able to make the XML error go away, but I still have not been able to see the "merchant-order-number" in the Sandbox order (just below the Google order number on the bottom right of the order). Here is what I did . . . . . . go to catalog/includes/modules/payment/google/google_func.php and

 

Find:
$data .=					   '<merchant-order-number>' . $orders_id . '</merchant-order-number>';

Change to:
$data .= '<merchant-order-number>' . $orders_id . '</merchant-order-number>';

 

Apparently the space between the $data command was causing the error (at least in my case). Once I removed the spaces the xml error went away. I noticed that the merchant-order-number is sent correctly by the XML, but somehow it is not being picked up by Google. I am working on it and if I find a fix I will post it here.

 

This error, by the way, does not interfere with the checkout process. Also, your database will not have the Google order number, since your database is updated once the customer "confirms" the order on your site (which is prior to Google generating their order number). Google will notify you via email and update your Orders in Admin as previously mentioned by madcrazygirl. Again. . . . . this contribution is not as robust as the "preferred" Google Checkout, so be patient and we will get it up to speed once more coders start improving on it.

 

Hope this helps.

 

ski

Link to comment
Share on other sites

You may be spending time needlessly worrying about this?

 

I have been back and checked in my sandbox account and indeed this error was there every time but when I now go and look in my production account it is not.

 

At the bottom of the real orders it also has the correct order refs completed:

 

Google order number: xxxxxxxxx

My order number: xxxxx

 

May just be a Google sandbox thing? This happened to me with Paypal sandbox and in the end I just gave up on the sandbox and there was nothing wrong!

Edited by madcrazygirl
Link to comment
Share on other sites

You may be spending time needlessly worrying about this?

 

I have been back and checked in my sandbox account and indeed this error was there every time but when I now go and look in my production account it is not.

 

At the bottom of the real orders it also has the correct order refs completed:

 

Google order number: xxxxxxxxx

My order number: xxxxx

 

May just be a Google sandbox thing? This happened to me with Paypal sandbox and in the end I just gave up on the sandbox and there was nothing wrong!

 

Hi madcrazygirl,

 

Thanks for the info. . . . I was actually going to ask you about that since you had mentioned that your store had GC IPN in production. I had my suspicions as I thought the extra space should not be that critical, but then again I wanted to make sure. In any event, I wish that the Sandbox behaved in the same manner as Production, but more often than not they are very different. It's like someone made an environment just good enough to play in, but not a true "real-world" environment.

 

I like to be very thorough during all of my testings so that I don't have to pay for it later. A good habit to have, but sometimes I over do it.

 

Thank you again!

 

Now on to the next test . . . lol

 

Regards,

 

ski

Link to comment
Share on other sites

You may be spending time needlessly worrying about this?...

well.. in my case was not needlessly worries, it didnt work at all!

As it was not saving the GL order id in our system , we couldnt re-create the matching between the 2 IDs at later stage, therefore the error.

 

So in our case the problem was not the add-merchant-order-number XML itself, but WHY we didnt have a GL order id stored in our system before that!

 

now i found the solution given by Jacky Wu to be working for us:

we add a

(set)

in front of every number, such for

(int)$insert_id

in the file /catalog/include/modules/payment/google.php.

 

Only this way we manage to have the gl_order_id stored in our DB, and then add-merchant-order-number XML calls will also work.

 

I wish we have the OK by the masters of this contiribution, anyway i belive the change suggested by JackyWu can be considered as Bug, and suggested for a new release of this contribut.

 

what you think?

Expresionario.com | Pura Sub-cultura!

Link to comment
Share on other sites

Well I guess this must be something else in your store causing this then because mine was installed as per the contribution and I have just also looked in the orders database to check and the google ID is there too.

 

Therefore I do not think it is a bug but perhaps a fix for something else you have installed?

Link to comment
Share on other sites

well.. in my case was not needlessly worries, it didnt work at all!

As it was not saving the GL order id in our system , we couldnt re-create the matching between the 2 IDs at later stage, therefore the error.

 

So in our case the problem was not the add-merchant-order-number XML itself, but WHY we didnt have a GL order id stored in our system before that!

 

now i found the solution given by Jacky Wu to be working for us:

we add a

(set)

in front of every number, such for

(int)$insert_id

in the file /catalog/include/modules/payment/google.php.

 

Only this way we manage to have the gl_order_id stored in our DB, and then add-merchant-order-number XML calls will also work.

 

I wish we have the OK by the masters of this contiribution, anyway i belive the change suggested by JackyWu can be considered as Bug, and suggested for a new release of this contribut.

 

what you think?

 

Hi jacopo,

 

I'm glad you gotta it working. I don't think that I am following your explanantion above. Would you mind posting your modified code here (even if only part of it). As for a fix for next release, I am gathering information of all the fixes and will update the next release accordingly. Thank you for the suggestion. I also want to say thank you to JackyWu for giving us a solution.

 

regards,

 

ski

Link to comment
Share on other sites

Hi jacopo,

As for a fix for next release, I am gathering information of all the fixes and will update the next release accordingly.

 

 

Ski See my post above but mine posts the google id to the database correctly without any mods?

Link to comment
Share on other sites

Well I guess this must be something else in your store causing this then because mine was installed as per the contribution and I have just also looked in the orders database to check and the google ID is there too.

 

Therefore I do not think it is a bug but perhaps a fix for something else you have installed?

 

Hi.

 

I concur with you, as "google_order_id" number is being inserted into my database as well. Therefore, I don't think it is a bug. However, I'd like to include the suggested modification in a section of the readme file for next release just in case someone else runs into the same problem.

 

regards,

 

ski

Link to comment
Share on other sites

It's already been pointed out once in this thread, but I'll point it out again for those who haven't read it.

 

The CCGV contribution modifies checkout_process.php so if you bypass that to use google_checkout_process.php then CCGV won't work unless you modify google_checkout_process.php in the same way as checkout_process.php

 

Vger

 

Hi CT,

 

I've never had this up and running with anything other than protx, so I don't know if any other payment modules would or do work. I was going to strip out the ICW credit class thing but if it works for you then I'll leave it. I think the STS thing might have something to do with it but cant find the code being referred to. I changed my checkout_confirmation.php for a stock one and it works ok with protx still, but not with GC.

Link to comment
Share on other sites

Hello,

 

The following modifications will allow you to select whether or not a product can be purchased through the Google Checkout IPN, on a per product basis. It is by default set for each product to be able to. To set a product to not be able to be purchased using the Google Checkout IPN payment option - in the admin ui's product page (categories.php) you just set the newly created "Allow Google Payment:" drop down to "No".

 

Though it is presented here based on a vanilla 2.2 install, it's not been tested on a vanilla install. It was originally done for a heavily modified install. It's been put together by mimicking code from oscommerce and several oscommerce contributions, and it is not likely coded efficiently, nor prudently. I don't even know that all the code is necessary. I do know it works well in my modified environment.

 

As an aside, I've used the same/similar procedure/process to make several different per product switches/flags and triggers.

 

Regards,

 

CT

 

 

In:

admin/categories.php

 

1) Find:

'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

1) Replace with:

'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']),
// prevent GCIPN payment option
							  'products_google_payment_product' => tep_db_prepare_input($HTTP_POST_VARS['products_google_payment_product']));
// /prevent GCIPN payment option

 

 

 

2) Find:

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

2) Replace with:

// prevent GCIPN payment option (added: , products_google_payment_product)
$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id, products_google_payment_product from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
// /prevent GCIPN payment option (added: , products_google_payment_product)

 

 

 

3) Find:

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

3) Replace with:

// prevent GCIPN payment option (added: , products_google_payment_product)
tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_google_payment_product) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
// /prevent GCIPN payment option (added: , products_google_payment_product)

 

 

 

4) Find:

'manufacturers_id' => '');

4) Replace with:

'manufacturers_id' => '',
// prevent GCIPN payment option
				   'products_google_payment_product' => '');
// /prevent GCIPN payment option

 

 

 

5) Find:

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

5) Replace with:

// prevent GCIPN payment option (added: , p.products_google_payment_product)
$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_google_payment_product from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
// /prevent GCIPN payment option (added: , p.products_google_payment_product)

 

 

 

6) Find:

$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

6) Replace with:

// prevent GCIPN payment option
$google_payment_product_array = array(array('id' => '1', 'text' => TEXT_YES), array('id' => '0', 'text' => TEXT_NO));
// /prevent GCIPN payment option
$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

 

 

 

First Find:

TEXT_PRODUCTS_PRICE_GROSS

7) Then find 2 lines below:

</tr>

7) Replace with:

</tr>
// prevent GCIPN payment option
	  <tr bgcolor="#ebebff">
		<td class="main"><?php echo TEXT_PRODUCTS_GOOGLE_PAYMENT_PRODUCT; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_google_payment_product', $google_payment_product_array, $pInfo->products_google_payment_product); ?></td>
	  </tr>
// /prevent GCIPN payment option

 

 

 

8) Find:

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

8) Replace with:

// prevent GCIPN payment option (added: , p.products_google_payment_product)
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, p.products_google_payment_product  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
// /prevent GCIPN payment option (added: , p.products_google_payment_product)

 

 

 

9) Find:

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");

9) Replace with:

// prevent GCIPN payment option (added: , p.products_google_payment_product)
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id, p.products_google_payment_product from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
// /prevent GCIPN payment option (added: , p.products_google_payment_product)

 

 

 

10) Find:

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

10) Replace with:

// prevent GCIPN payment option (added: , p.products_google_payment_product)
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_google_payment_product from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
// /prevent GCIPN payment option (added: , p.products_google_payment_product)

 

 

 

11) Find:

$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');

11) Replace with:

$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
// prevent GCIPN payment option
		if ($pInfo->products_google_payment_product == "1") {
		  $google_payment_product_indicator = TEXT_YES;
		} else {
		  $google_payment_product_indicator = TEXT_NO;
		}
		$contents[] = array('text' => '' . TEXT_PRODUCTS_GOOGLE_PAYMENT_PRODUCT . ' ' . $google_payment_product_indicator . '');
// /prevent GCIPN payment option

 

 

----------------------------

 

 

In:

admin/includes/languages/english/categories.php

 

1) Find:

?>

1) Replace with:

// prevent GCIPN payment option
define('TEXT_PRODUCTS_GOOGLE_PAYMENT_PRODUCT', 'Allow Google Payment:');
// /prevent GCIPN payment option

?>

 

 

----------------------------

 

 

In:

checkout_payment.php

 

2) Find:

$selection = $payment_modules->selection();

2) Replace with:

$selection = $payment_modules->selection();

// prevent GCIPN payment option
$order->info['g_payment'] = $cart->g_payment;
if (($cart->g_payment) > 0) {

 for($i=0, $n=sizeof($selection); $i<$n; $i++) {
if($selection[$i]['module'] == MODULE_PAYMENT_GOOGLE_TEXT_TITLE) {
  array_splice($selection, $i, 1);	
  break;   
}
 }

}
// /prevent GCIPN payment option

 

 

----------------------------

 

 

In:

includes/classes/shopping_cart.php

 

1) Find:

var $contents, $total, $weight, $cartID, $content_type;

1) Replace with:

// prevent GCIPN payment option (added: , $g_payment)
var $contents, $total, $weight, $cartID, $content_type, $g_payment;
// /prevent GCIPN payment option (added: , $g_payment)

 

 

 

First Find:

function calculate() {

2) Then find 2 lines below:

$this->weight = 0;

2) Replace with:

$this->weight = 0;
// prevent GCIPN payment option
  $this->g_payment = 0;
// /prevent GCIPN payment option

 

 

 

3) Find:

$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

3) Replace with:

// prevent GCIPN payment option (added: , products_google_payment_product)
$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight, products_google_payment_product from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
// /prevent GCIPN payment option (added: , products_google_payment_product)

 

 

 

4) Find:

if ($product = tep_db_fetch_array($product_query)) {

4) Replace with:

// prevent GCIPN payment option
	$products_google_payment_product = $product['products_google_payment_product'];
// /prevent GCIPN payment option
if ($product = tep_db_fetch_array($product_query)) {

 

 

 

5) Find:

$this->total += tep_add_tax($products_price, $products_tax) * $qty;

5) Replace with:

$this->total += tep_add_tax($products_price, $products_tax) * $qty;
// prevent GCIPN payment option
	  $this->g_payment += ($products_google_payment_product == 1)?0:(tep_add_tax($products_price, $products_tax) * $qty);
// /prevent GCIPN payment option

 

 

 

6) Find:

$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

6) Replace with:

$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
// prevent GCIPN payment option
$this->g_payment += ($products_google_payment_product == 1)?0:($qty * tep_add_tax($attribute_price['options_values_price'], $products_tax));
// /prevent GCIPN payment option

 

 

 

7) Find:

$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

7) Replace with:

$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
// prevent GCIPN payment option
$this->g_payment -= ($products_google_payment_product == 1)?0:($qty * tep_add_tax($attribute_price['options_values_price'], $products_tax));
// /prevent GCIPN payment option

 

 

----------------------------

 

 

added sql:

ALTER TABLE `products` ADD `products_google_payment_product` TINYINT( 1 ) DEFAULT '1' NOT NULL;

 

END

Link to comment
Share on other sites

In:

admin/categories.php

 

7) Replace with:

</tr>
// prevent GCIPN payment option
	  <tr bgcolor="#ebebff">
		<td class="main"><?php echo TEXT_PRODUCTS_GOOGLE_PAYMENT_PRODUCT; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_google_payment_product', $google_payment_product_array, $pInfo->products_google_payment_product); ?></td>
	  </tr>
// /prevent GCIPN payment option

The above code modification is incorrect (concerning the "admin/categories.php" file, and "7) Replace with:").

It should be:

</tr>
<!-- prevent GCIPN payment option -->
	  <tr bgcolor="#ebebff">
		<td class="main"><?php echo TEXT_PRODUCTS_GOOGLE_PAYMENT_PRODUCT; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_google_payment_product', $google_payment_product_array, $pInfo->products_google_payment_product); ?></td>
	  </tr>
<!-- /prevent GCIPN payment option -->

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...