[ic] InternationalCheckout.com's PHP code to Interchange??

Chris Kershaw chris at endpoint.com
Fri Oct 22 14:43:18 UTC 2010


Lisa Collins wrote:
> Dear Interchange Gurus,
>
> I am praying someone here can help me because my programming skills
> are next to none and I've been told, "It's so easy!". I have tried so
> many things over the last few days to no avail.
>
> I'm trying to integrate InternationalCheckout.com's code on my site
> [include include/checkout/shopping_cart] but the only example they
> give is in PHP.
>
> How can I do this with Interchange? What would be the equivalent of
> this PHP Code to transfer the shopping cart to them?
>
> From their instructions:
> In order to transmit the contents of your shopping cart to the
> International Checkout page, you’ll have to send the contents of your
> store’s
> shopping cart to International Checkout. The following parameters have
> to be passed to our shopping cart in the form of HIDDEN
> elements of HTML.
> ---Just a few parameters from the list which I need:
>
> ItemDescription (ItemDescription1)
> ItemSKU (ItemSKU1)
> ItemQuantity (ItemQuantity1)
> ItemPrice (ItemPrice1)
>
>
>
> Sample Code they provided in PHP:
>
> <form name="icForm" id="icForm" method="post"
> action="https://www.internationalcheckout.com/cart.php">
> <?php for($i = 1; $i <= TOTAL ITEMS IN YOUR CART; $i++) { ?>
> <input type="hidden" name="ItemDescription<?php echo $i?>" value="ITEM
> DESCRIPTION">
> <input type="hidden" name="ItemSKU<?php echo $i?>" value="ITEM CODE
> VALUE">
> <input type="hidden" name="ItemSize<?php echo $i?>" value="ITEM SIZE">
> <input type="hidden" name="ItemQuantity<?php echo $i?>" value="ITEM
> QUANTITY">
> <input type="hidden" name="ItemPrice<?php echo $i?>" value="ITEM PRICE">
> <? } ?>
> <input type="hidden" name="p" value=" YOUR PARTNER VALUE REGISTERED
> WITH US ">
> </form>
> <script>document.getElementById('icForm').submit();</script>
>
> ---
> From the above, I'm assuming "value=" would be MY Fields from
> products.txt??
>
>
> I would be SO Grateful to anyone who could tell me how to do this!

Hi Lisa,

Try something like this. This would be the Interchange equivalent to the
php code.

<form name="icForm" id="icForm" method="post"
action="https://www.internationalcheckout.com/cart.php">
[item-list]
<input type="hidden" name="ItemDescription[item-increment]"
value="[item-description]">
<input type="hidden" name="ItemSKU[item-increment]" value="[item-code]">
<input type="hidden" name="ItemSize[item-increment]"
value="[item-modifier size]">
<input type="hidden" name="ItemQuantity[item-increment]"
value="[item-quantity]">
<input type="hidden" name="ItemPrice[item-increment]" value="[item-price]">
[/item-list]
<input type="hidden" name="p" value=" YOUR PARTNER VALUE REGISTERED WITH
US ">
</form>
<script>document.getElementById('icForm').submit();</script>

Hope this helps,
Chris

-- 
Chris Kershaw
End Point Corp.
Direct Line: 919-249-5356
Fax: 866-281-1373 
http://www.endpoint.com




More information about the interchange-users mailing list