Please help with Google Checkout!

I am trying to implement individual pricing in Google Checkout. Here is what I put in the image.php page:

<div id="google">
<?php if (function_exists('GoogleCheckoutPricelistFromString')) {
printGoogleCartWidget();
googleCheckout(NULL, true);
} ?>
</div>

I entered default values for $pricelist in the GoogleCheckout.php
file, and entered a pricelist string in the customdata field for one of my images that needs special pricing. But it shows the default pricing. Has anyone done this and can they give me a little help?

Thanks very much,
Tim

Comments

  • You should pass the pricelist to the googleCheckout() function. Changing the option defaults will do nothing after the first execution of the script.

    Review the documentation of the plugin for details.
  • Thanks, sbillard, this is an amazing piece of software, you should be very proud. Can you explain a bit more how to pass the pricelist to the function? I read the docs, but I'm still learning when it comes to scripting.

    Which file should I be working in?
  • Pricelists are arrays of pricing elements. The `index` of the element is the 'name' of the price item--say "8x10 glossy" and the value of the element is the price. So a custom price list might be `array('8x10 glossy'=>25.00, '16x20 matte'=>45.00)`. You pass this as the parameter to `googleCheckout()`.

    Since you say you are storing the custom price information in the customdata field, you will have to convert it to an array before passing. To do this use the `GoogleCheckoutPricelistFromString()` function. Your custom data should be in the form `size`:`media`=`price` repeated for as many price items as you have.
Sign In or Register to comment.