Order Total Values Not Showing Up / Address Shipping From Invalid

1 view
Skip to first unread message

Kevin

unread,
Oct 1, 2007, 10:31:50 AM10/1/07
to Google Checkout Mod for OSC Community Support Forum
I just upgraded to ver 1.4.5 and I'm having some problems.

First with the CCS option turned on I keep getting this error: "The
address that you are shipping from is invalid. Please send a correct
US address."

The XML seems to be ok, first the city was blank so I tried adding in
the city into the gcheckout.php file, but that didn't work either.

<ship-from id="Store_origin">
<city></city>
<region>OH</region>
<postal-code>43230</postal-code>
<country-code>US</country-code>
</ship-from>

Then I turned that off and noticed the Order Total (handling for under
$50) show up but the value is set to 0 when it shouldn't be. Could the
new version of Google checkout not be loading something that the
module needed before or something?

Ropu

unread,
Oct 1, 2007, 10:51:57 AM10/1/07
to google-checkout-f...@googlegroups.com
Hi
CCS is enabled by default

if u use CCS, u wont be able to use merchant calculated shippings. The city is not mandatory, so blank is ok. (btw, There is no place to take the city from the  OSC configs)

I've just tested with that address in my demos servers and had NO problems :S

Order totals are a different thing, could you plis send more info?

Kevin

unread,
Oct 1, 2007, 11:09:51 AM10/1/07
to Google Checkout Mod for OSC Community Support Forum
Here's the process function for the order total in question:

function process() {
global $order, $currencies;

if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
case 'national':
if ($order->delivery['country_id'] == STORE_COUNTRY) $pass
= true; break;
case 'international':
if ($order->delivery['country_id'] != STORE_COUNTRY) $pass
= true; break;
case 'both':
$pass = true; break;
default:
$pass = false; break;
}

if ( ($pass == true) && !$order->info['software_order'] &&
( ($order->info['total'] - $order->info['shipping_cost']) <
MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) ) {
$tax =
tep_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $order-
>delivery['country']['id'], $order->delivery['zone_id']);

$tax_description =
tep_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS,
$order->delivery['country']['id'], $order->delivery['zone_id'], $order-
>info['customers_tax_exempt']);

$order->info['tax'] +=
tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$order->info['tax_groups']["$tax_description"] +=
tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$order->info['total'] += MODULE_ORDER_TOTAL_LOWORDERFEE_FEE
+ tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);

$this->output[] = array('title' => $this->title . ':',
'text' => $currencies-
>format(tep_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax), true,
$order->info['currency'], $order->info['currency_value']),
'value' =>
tep_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax));
}
}
}

Nothing was changed to this OT module and it worked fine for the
previous version of the google checkout mod.

I wonder if something else is wrong with the XML being sent for CCS
and just throwing the shipping from is invalid error. Here's more from
the XML:

<shipping-methods>
<carrier-calculated-shipping>
<carrier-calculated-shipping-options>
<carrier-calculated-shipping-option>
<price currency="USD">10</price>
<shipping-company>UPS</shipping-company>
<shipping-type>Ground</shipping-type>
<carrier-pickup>REGULAR_PICKUP</carrier-pickup>
</carrier-calculated-shipping-option>
<carrier-calculated-shipping-option>
<price currency="USD">20</price>
<shipping-company>UPS</shipping-company>
<shipping-type>2nd Day Air</shipping-type>
<carrier-pickup>REGULAR_PICKUP</carrier-pickup>
</carrier-calculated-shipping-option>
<carrier-calculated-shipping-option>
<price currency="USD">30</price>
<shipping-company>UPS</shipping-company>
<shipping-type>Next Day Air Saver</shipping-type>
<carrier-pickup>REGULAR_PICKUP</carrier-pickup>
</carrier-calculated-shipping-option>
<carrier-calculated-shipping-option>
<price currency="USD">40</price>
<shipping-company>UPS</shipping-company>
<shipping-type>Next Day Air</shipping-type>
<carrier-pickup>REGULAR_PICKUP</carrier-pickup>
</carrier-calculated-shipping-option>
<carrier-calculated-shipping-option>
<price currency="USD">50</price>
<shipping-company>UPS</shipping-company>
<shipping-type>Next Day Air Early AM</shipping-type>
<carrier-pickup>REGULAR_PICKUP</carrier-pickup>
</carrier-calculated-shipping-option>
</carrier-calculated-shipping-options>
<shipping-packages>
<shipping-package>


<ship-from id="Store_origin">
<city></city>
<region>OH</region>
<postal-code>43230</postal-code>
<country-code>US</country-code>
</ship-from>

<width unit="IN" value="1" />
<length unit="IN" value="1" />
<height unit="IN" value="1" />
<delivery-address-category>RESIDENTIAL</delivery-address-
category>
</shipping-package>
</shipping-packages>
</carrier-calculated-shipping>
</shipping-methods>

> --
> .-. --- .--. ..-
> R o p u

Ropu

unread,
Oct 1, 2007, 11:32:23 AM10/1/07
to google-checkout-f...@googlegroups.com
i must check that, but its wokring on my side.

check https://demo.globant.com/~brovagnati/osc_demo2/catalog

compare it with ur one.

ropu

Kevin

unread,
Oct 1, 2007, 12:25:39 PM10/1/07
to Google Checkout Mod for OSC Community Support Forum
Other than some different shipping methods and tax rules they look the
same.

On Oct 1, 11:32 am, Ropu <rovagn...@gmail.com> wrote:
> i must check that, but its wokring on my side.
>

> checkhttps://demo.globant.com/~brovagnati/osc_demo2/catalog

Ropu

unread,
Oct 1, 2007, 12:31:05 PM10/1/07
to google-checkout-f...@googlegroups.com
as u can see mine is working fine


not sure what ur issue could be :S

duhno

unread,
Nov 9, 2007, 3:02:24 AM11/9/07
to Google Checkout Mod for OSC Community Support Forum
I'm have the same problem with the low order fee not displaying using
1.45. It displays the name but the cost shows as $0.00.
Any suggestions.

> > R o p u- Hide quoted text -
>
> - Show quoted text -

duhno

unread,
Nov 9, 2007, 4:21:13 AM11/9/07
to Google Checkout Mod for OSC Community Support Forum
Ok, can someone tell me where the following was added:

06/20/2007 v1.4 apha (ropu)
...
- Added OT support (low order fees, group discounts and any other
custom OT module)

duhno

unread,
Nov 9, 2007, 5:32:18 AM11/9/07
to Google Checkout Mod for OSC Community Support Forum
ok, i've got it.

I modified the code in gcheckout.php as follows:

$Gitem = new GoogleItem($order_total['title'],
'',
'1',
// $currencies->get_value(DEFAULT_CURRENCY)
* $products[$i]['final_price'],
// 'LB', 0);

//// number_format(($amount) * $currencies-
>get_value($my_currency), $currencies-
>get_decimal_places($my_currency))
$currencies->get_value(DEFAULT_CURRENCY) *
$ot_value);


The values for the desired order total modules now display. When I
tested it in sandbox, everything looked ok.
The developer might want to check this for verification

Ropu

unread,
Nov 12, 2007, 8:12:01 AM11/12/07
to google-checkout-f...@googlegroups.com
Hi

could u please send the version of the file and the lines u've modify ?

if u have a diff much better

thx

ropu

osCommerce Design Studio

unread,
Nov 12, 2007, 11:35:20 AM11/12/07
to google-checkout-f...@googlegroups.com
Hello,
 
Your 1.45 version comments out:
$currencies->get_value(DEFAULT_CURRENCY) * $ot_value);
That is the line needed to display the order total values which aren't displaying in 1.45
 
The modifications that I made:
1) Only work if Merchant Calculations are used
2) Are exactly the same code that you used in version 1.4
 
My initial testing after the changes that I made using merchant calculations.  I then tested it with
carrier calculations.  I discovered that in this manner it was giving an error related to the weight
of the product not being provided (because the weight was commented out.  I couldn't get both the
weight and ot values to work together).
 
I then went back  to the version 1.4 and realized that the differences between version 1.4 and 1.45 (relative to this issue)
was around 187 and 253.
 
The attached file is the googlecheckout/gcheckout.php file
 
Regards,
gcheckout.php

Ropu

unread,
Jan 2, 2008, 10:00:25 AM1/2/08
to google-checkout-f...@googlegroups.com
hi

sorry, my fault, copy paste bug, grrrrr


patch:

googlecheckout/gcheckout.php line 246
Replace:
    $ot_value = $order_total['value'] * (strrpos($order_total['text'], '-')===false?1:-1);//($order_total['text']{0}=='-'?-1:1);
    $Gitem = new GoogleItem($order_total['title'],
                            '',
                            '1',
                            $currencies->get_value(DEFAULT_CURRENCY) * $products[$i]['final_price'],
                            'LB', 0);
with
    $ot_value = $order_total['value'] * (strrpos($order_total['text'], '-')===false?1:-1);//($order_total['text']{0}=='-'?-1:1);
    $Gitem = new GoogleItem($order_total['title'],
                            '',
                            '1',
                            $currencies->get_value(DEFAULT_CURRENCY) * $ot_value,
                            'LB', 0);                         

thx for the report, this will be added in next release

ropu
Reply all
Reply to author
Forward
0 new messages