Advance software forum
February 04, 2012, 01:56:19 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: need help with google checkout...  (Read 1712 times)
0 Members and 1 Guest are viewing this topic.
zima805
Newbie
*
Offline Offline

Posts: 2


View Profile
« on: April 23, 2008, 10:31:32 PM »

i know i download a free google checkout level 1, after installing it i get this message under shopping cart, on top of google checkout tab:  Warning: Invalid argument supplied for foreach() in /home/isteh/public_html/catalog/googlecheckout/classes/gCart.php on line 85

is there anyway you can help me fix this??...and another thing is when i add product and click on google checkout it went to no website ( http 400 bad request )....any clue?

thank you for your help .....
Logged
Alex
Administrator
Full Member
*****
Offline Offline

Posts: 128


View Profile
« Reply #1 on: April 24, 2008, 04:12:14 AM »

Hello,

Thanks for getting interested in our products and services.
The error you have is simple to fix. It occurs because you have not enabled ANY google checkout shipping methods. Goto your
store admin and enable at least 1 GC shipping (e.g. google checkout flat rate) - and the error will disappear.

P.S. As for the error bad request, open up the osccommunicator class and check if the URLs to google checkout are properly
set up (somewhere at the top) - this module was not updated for a long time, and google seems to change their basic checkout urls.

Best,
Alex
Logged
zima805
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #2 on: April 24, 2008, 06:05:06 PM »

where do i change the google url???

at this line?? = 'GCheckout_button' => "http://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."buttons/checkout.gif",

thank you....


<?
/*
  gOscCommunicator.php,  Advance Google Checkout BETA

  Advance Software
  http://www.advancewebsoft.com

  Copyright (c) 2006 Advance Software

*/
   
  class gOscCommunicator {

      function gOscCommunicator($language)
      {  
         $this->language = $language;
         $this->languages_id = 1;
       require_once('includes/configure.php');
       require_once(DIR_FS_CATALOG.DIR_WS_FUNCTIONS.'database.php');
       require_once(DIR_FS_CATALOG.DIR_WS_INCLUDES .'filenames.php');
       require_once(DIR_FS_CATALOG.DIR_WS_INCLUDES .'database_tables.php');
       tep_db_connect() or die('Unable to connect to database server!');
    }

    function tep_get_products_description($product_id, $language_id) {
      $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
      $product = tep_db_fetch_array($product_query);

      return $product['products_description'];
    }
    
    function _get_products_model($products_id)
    {
      $product_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
      $product = tep_db_fetch_array($product_query);
      return $product['products_model'];
    }
    
    function _get_tax_rate($country_id, $zone_id, $tax_class_id)
    {
         $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$tax_class_id . "' group by tr.tax_priority");
          if (tep_db_num_rows($tax_query)) {
            $tax_multiplier = 1.0;
            while ($tax = tep_db_fetch_array($tax_query)) {
              $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);
            }
            $tax_rate = ($tax_multiplier - 1.0) * 100;
          } else {
            $tax_rate = 0;
          }
       return $tax_rate;
    }
          
      function getConfiguration()
      {
      $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION .' where configuration_key like "GOOGLECHECKOUT_%" or configuration_key = "DEFAULT_ORDERS_STATUS_ID" or configuration_key = "SHIPPING_MAX_WEIGHT" or configuration_key = "SHIPPING_ORIGIN_COUNTRY" or configuration_key = "SHIPPING_ORIGIN_ZIP"');
      while ($configuration = tep_db_fetch_array($configuration_query)) {
        define($configuration['cfgKey'], $configuration['cfgValue']);
      }

      $this->shipping_modules = array();
      
      if (defined('GOOGLECHECKOUT_FLAT_STATUS') && (GOOGLECHECKOUT_FLAT_STATUS == 'true' || GOOGLECHECKOUT_FLAT_STATUS == 'True'))
      $this->shipping_modules[] = array('file' => 'gCheckout_flat.php','class' => 'gCheckout_flat');
      
      if (defined('GOOGLECHECKOUT_ITEM_STATUS') && (GOOGLECHECKOUT_ITEM_STATUS == 'true' || GOOGLECHECKOUT_ITEM_STATUS == 'True'))
      $this->shipping_modules[] = array('file' => 'gCheckout_item.php','class' => 'gCheckout_item');

      require_once('includes/languages/' . $this->language . '/modules/payment/gCheckout.php');
      
        $GCheckout_subdomain = GOOGLECHECKOUT_SUBDOMAIN;
      $GCheckout_merchant_id  =  GOOGLECHECKOUT_MERCHANT_ID;
      $GCheckout_merchant_key =  GOOGLECHECKOUT_MERCHANT_KEY;
        
      $options = array(
         'GCheckout_currency'    => 'USD',
         'GCheckout_xmlSchema'   => 'http://checkout.google.com/schema/2',
         'GCheckout_button' => "http://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."buttons/checkout.gif",
         'GCheckout_button_w' => '180',
         'GCheckout_button_h' => '46',
         'GCheckout_button_loc' => 'en_US',
         'GCheckout_button_style' => 'trans',
         'GCheckout_base_url' => "https://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."cws/v2/Merchant/".$GCheckout_merchant_id,
         'GCheckout_url' => "https://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."cws/v2/Merchant/".$GCheckout_merchant_id. "/checkout",
         'GCheckout_diagnose_url' => "https://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."cws/v2/Merchant/".$GCheckout_merchant_id. "/checkout/diagnose",
         'GCheckout_request_url' => "https://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."cws/v2/Merchant/".$GCheckout_merchant_id. "/request",
         'GCheckout_request_diagnose_url' => "https://".$GCheckout_subdomain.".google.com/".($GCheckout_subdomain == 'sandbox'?'checkout/':'')."cws/v2/Merchant/".$GCheckout_merchant_id. "/request/diagnose",
         'GCheckout_or_use_text' => GOOGLECHECKOUT_OR_USE
      );
      
      $options['GCheckout_subdomain'] = $GCheckout_subdomain;
      $options['GCheckout_merchant_id'] = $GCheckout_merchant_id;
      $options['GCheckout_merchant_key'] = $GCheckout_merchant_key;

      return $options;
    }
    
    function getContinueShoppingUrl()
    {
      return HTTP_SERVER. DIR_WS_CATALOG;
    }
    
    function getShoppingCartUrl()
    {
      return HTTP_SERVER. DIR_WS_CATALOG. FILENAME_SHOPPING_CART;
    }
    
    function getItemWeight($products_id)
    {
       $weight_query = tep_db_query("Select products_weight from ".TABLE_PRODUCTS." where products_id = '".(int)$products_id."'");    
       $weight = tep_db_fetch_array($weight_query);
       return $weight['products_weight'];
    }
    
    function getProducts($cart, $languages_id) {
       $products_array = array();
       $products = $cart->get_products();
      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
        $products_array[$i]['name'] = $products[$i]['name'];
        if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
          $products_array[$i]['name'].=' (';
          while (list($option, $value) = each($products[$i]['attributes'])) {
            $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                        from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                        where pa.products_id = '" . (int)$products[$i]['id'] . "'
                                         and pa.options_id = '" . (int)$option . "'
                                         and pa.options_id = popt.products_options_id
                                         and pa.options_values_id = '" . (int)$value . "'
                                         and pa.options_values_id = poval.products_options_values_id
                                         and popt.language_id = '" . (int)$languages_id . "'
                                         and poval.language_id = '" . (int)$languages_id . "'");
            $attributes_values = tep_db_fetch_array($attributes);

            $products_array[$i]['name'].= $attributes_values['products_options_name'].": ".$attributes_values['products_options_values_name'].", ";
          }
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!