List Info

Thread: Generating Cart buttons through code more than 1 shopping cart on page fails.




Generating Cart buttons through code more than 1 shopping cart on page fails.
user name
2006-12-29 00:12:10
Hi,

When I click on the second or third form on your page, it
returns the
following error:
<error-message>Duplicate shipping name All
found.</error-message>

It seems that your shoppingcart XML contains two
flat-rate-shipping
methods with the same name, "All" as follows:

<shipping-methods>
  <flat-rate-shipping name="All"><price
currency="USD">4.5</price></flat-rate-
shipping>
  <flat-rate-shipping name="All"><price
currency="USD">23.8</price></flat-rate
-shipping>
</shipping-methods>

Could you please ensure that the shipping method names are
unique?

Please reply back if this doesn't help.

Thanks,
Jacob


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---

Generating Cart buttons through code more than 1 shopping cart on page fails.
user name
2006-12-29 18:48:58
You were right about the duplicate "All" shipping
default. I fixed
this, and the results are getting better.

The issue now is that whichever form button the user clicks
on, the
preceeding forms are submitted into the cart, too.

I thought that this could be solved using javascript, to
mask the names
of the forms that i didn't want to have submitted, and only
submitting
the form which was actively clicked on.

I don' t think that was the issue now. Instead, I am
thinking that the
Global Variables for the Google API Cart are appended to
with each new
item that is added to the cart. How can I clear out the
pertinent
Globabl variables before I have a cart created in my code?

(thanks)


This is the code which creates the code:


$recCounter += 1;  // This is a counter value which is
initialized to 0
in the header file.

$nameIS = "<$MTEntryTitle
encode_js="1"$>";
$descriptionIS = "<$MTEntryMore
remove_html="1"$>";
$qtyIS = 1;
$priceIS = <$MTExtraFieldValue
field="price"$>;
$shippingIS = <$MTExtraFieldValue
field="shipping"$>;


$tax_table_selector = "";
$merchant_private_item_data = "";



CreateItem($nameIS, $descriptionIS, $qtyIS, $priceIS,
    $tax_table_selector, $merchant_private_item_data);  //
call to
CheckoutAPIFunction.CreateItem()


 // Tax rate for Connecticut can be changed using the
$item_CT_tax
variable  below
$item_CT_tax = 0.06;

$rate = "$item_CT_tax";
$tax_area_state = "CT";
$tax_area = CreateTaxArea("state",
$tax_area_state);
$shipping_taxed = "false";
CreateDefaultTaxRule($rate, $tax_area, $shipping_taxed);

$name = "All".$recCounter ;
$shipPrice = "$shippingIS";
$shipping_restrictions = "";
CreateFlatRateShipping($name, $shipPrice,
$shipping_restrictions);

$dom_testShow = domxml_new_doc("1.0");
$dom_testShow = $tax_area;

$merchant_calculated = "false";
CreateTaxTables($merchant_calculated);

$edit_cart_url = "";
$continue_shopping_url = "";

 CreateMerchantCheckoutFlowSupport($edit_cart_url,
$continue_shopping_url);

// Specify an expiration date for the order and build
<shopping-cart>
$cart_expiration = "2086-12-31T23:59:59";
$merchant_private_data =
   "<merchant-note>My order number
9876543</merchant-note>";

CreateShoppingCart($cart_expiration,
$merchant_private_data);

$xml_cart = CreateCheckoutShoppingCart();
$signature = CalcHmacSha1($xml_cart);
$b64_cart = base64_encode($xml_cart);
$b64_signature = base64_encode($signature);
$checkout_post_data = "cart=" .
urlencode($b64_cart) . "&signature=" .
    urlencode($b64_signature);

LogMessage($GLOBALS["logfile"],
$checkout_post_data);

GoogleCheckoutDevPro wrote:
> Hi,
>
> When I click on the second or third form on your page,
it returns the
> following error:
> <error-message>Duplicate shipping name All
found.</error-message>
>
> It seems that your shoppingcart XML contains two
flat-rate-shipping
> methods with the same name, "All" as follows:
>
> <shipping-methods>
>   <flat-rate-shipping
name="All"><price
>
currency="USD">4.5</price></flat-rate-
shipping>
>   <flat-rate-shipping
name="All"><price
>
currency="USD">23.8</price></flat-rate
-shipping>
> </shipping-methods>
>
> Could you please ensure that the shipping method names
are unique?
> 
> Please reply back if this doesn't help.
> 
> Thanks,
> Jacob


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---

Generating Cart buttons through code more than 1 shopping cart on page fails.
user name
2006-12-29 23:40:21
Hi,

If you have multiple Google Checkout buttons on a page, then
you would
need to clear the global variable $dom_items_obj as follows:

    global $dom_items_obj = "";

Please reply back if this doesn't help.

Thanks,
Jacob


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---

Generating Cart buttons through code more than 1 shopping cart on page fails.
user name
2006-12-30 06:24:34
You were right, I had to use unset() for the obj variable,
but that was
what i needed.

One more thing, what object do i have to unset, to get rid
of previous
entered shipping rules.

I have many Google Checkout Buttons, each will be created
with their
own default shipping value, and I do not want the other ones
available
as options.

Thanks very much,

Mike


GoogleCheckoutDevPro wrote:
> Hi,
>
> If you have multiple Google Checkout buttons on a page,
then you would
> need to clear the global variable $dom_items_obj as
follows:
>
>     global $dom_items_obj = "";
> 
> Please reply back if this doesn't help.
> 
> Thanks,
> Jacob


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )