Jump to content

washley

Members
  • Content count

    4
  • Joined

  • Last visited

Profile Information

  • Real Name
    Will Ashley
  1. Thanks so much for this solution. I've put in the changes and it does allow (any number of) text field(s) from OTF to go through in Goolge Commerce. The problem is that, though that variable goes through correctly - strangely - only *one* non-text attribute will go through after that, the rest come out a as a string of what I think are theur IDs in the databse (i.e. "{10}133{15}181{20}179{27}162{28}17"). Any idea what could be causing this?
  2. I may have slightly mis-stated my problem. It looks like none of the OTF values make it through an update but that all of them but the text area ones are sent on to Google Checkout. Really the only thing I'm trying to fix right now is the passing to the Google Checkout of the text-area values. I am using the Google Checkout contribution: http://code.google.com/p/google-checkout-oscommerce/ I'm nolonger sure the problem is in product_info (though that may be the problem with updating). There's an additional file in the Google Checkout package called gcheckout: <?php /* Copyright © 2007 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* **GOOGLE CHECKOUT ** v1.4.5 * @version $Id: gcheckout.php 5499 2007-09-27 14:58:57Z ropu $ * Script invoked when Google Checkout payment option has been enabled * It uses phpGCheckout library so it can work with PHP4 and PHP5 * Generates the cart xml, shipping and tax options and adds them as hidden fields * along with the Checkout button * A disabled button is displayed in the following cases: * 1. If merchant id or merchant key is not set * 2. If there are multiple shipping options selected and they use different shipping tax tables * or some dont use tax tables */ //error_reporting(E_ALL); //require_once('admin/includes/configure.php'); //require_once('includes/configure.php'); require_once('includes/languages/'. $language .'/modules/payment/googlecheckout.php'); require_once('includes/modules/payment/googlecheckout.php'); // Function which returns the current URL. function gc_selfURL() { $s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : ''; $protocol = gc_strleft(strtolower($_SERVER['SERVER_PROTOCOL']), '/') . $s; $port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'. $_SERVER['SERVER_PORT']); return $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']; } // Used by selfURL. function gc_strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); } // Functions used to prevent SQL injection attacks. function gc_makeSqlString($str) { return addcslashes(stripcslashes($str), "\"'\\..\37!@\@\177..\377"); } function gc_makeSqlInteger($val) { return ((settype($val, 'integer')) ? ($val) : 0); } function gc_makeSqlFloat($val) { return ((settype($val, 'float')) ? ($val) : 0); } // Custom Function to store configuration values (shipping default values) function gc_compare($key, $data, $sep="_VD:", $def_ret='1') { foreach($data as $value) { list($key2, $valor) = explode($sep, $value); if($key == $key2) return $valor; } return $def_ret; } $googlepayment = new googlecheckout(); $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); require('googlecheckout/library/googlecart.php'); require('googlecheckout/library/googleitem.php'); require('googlecheckout/library/googleshipping.php'); require('googlecheckout/library/googletax.php'); $Gcart = new googlecart($googlepayment->merchantid, $googlepayment->merchantkey, MODULE_PAYMENT_GOOGLECHECKOUT_MODE== 'https://sandbox.google.com/checkout/' ?"sandbox":"production", DEFAULT_CURRENCY); $Gwarnings = array(); if(MODULE_PAYMENT_GOOGLECHECKOUT_MODE=='https://sandbox.google.com/checkout/'){ $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_USING_SANDBOX; } // Check installed Version if(MODULE_PAYMENT_GOOGLECHECKOUT_VERSION != GOOGLECHECKOUT_FILES_VERSION) { $Gcart->SetButtonVariant(false); $Gwarnings[] = sprintf(GOOGLECHECKOUT_STRING_WARN_MIX_VERSIONS, MODULE_PAYMENT_GOOGLECHECKOUT_VERSION, GOOGLECHECKOUT_FILES_VERSION); } if (($googlepayment->merchantid == '') || ($googlepayment->merchantkey == '')) { $Gcart->SetButtonVariant(false); $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_NO_MERCHANT_ID_KEY; } $products = $cart->get_products(); require_once(DIR_WS_CLASSES . 'order.php'); $order = new order; $order_items = $order->products; if(MODULE_PAYMENT_GOOGLECHECKOUT_VIRTUAL_GOODS == 'True' && $cart->get_content_type() != 'physical' ) { $Gcart->SetButtonVariant(false); $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_VIRTUAL; } if (sizeof($products) == 0) { $Gcart->SetButtonVariant(false); $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_EMPTY_CART; } $tax_array = array(); $tax_name_array = array(); $flagAnyOutOfStock = false; $product_list = ''; $resticted_categories = split('([ ]?[,][ ]?)',MODULE_PAYMENT_GOOGLECHECKOUT_RESTRICTED_CATEGORIES); for ($i = 0, $n = sizeof($products); $i < $n; $i++) { $product_virtual = false; if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { 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 = '" . gc_makeSqlInteger($products[$i]['id']) . "' " ."and pa.options_id = '" . gc_makeSqlString($option) . "' and pa.options_id = " ."popt.products_options_id and pa.options_values_id = '" . gc_makeSqlString($value) . "' " ."and pa.options_values_id = poval.products_options_values_id and " ."popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); $attr_value = $attributes_values['products_options_values_name']; $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name']; $products[$i][$option]['options_values_id'] = $value; $products[$i][$option]['products_options_values_name'] = $attr_value; $products[$i][$option][' products_options_value_text text'] = $attr_value; $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price']; $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; if(DOWNLOAD_ENABLED == 'true') { $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id"); $virtual_check = tep_db_fetch_array($virtual_check_query); if ($virtual_check['total'] > 0){ $product_virtual = true; } } } } $products_name = $products[$i]['name']; $products_description = tep_db_fetch_array(tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $products[$i]['id'] ."' and language_id = '" . $languages_id . "'")); $products_description = $products_description['products_description']; $tax_result = tep_db_query("select tax_class_title from ". TABLE_TAX_CLASS ." where tax_class_id = ". gc_makeSqlInteger($products[$i]['tax_class_id'])); $tax = tep_db_fetch_array($tax_result); $tt = $tax['tax_class_title']; if (!empty($tt) && !in_array($products[$i]['tax_class_id'], $tax_array)) { $tax_array[] = $products[$i]['tax_class_id']; $tax_name_array[] = $tt; } if (isset ($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= "\n- ". $products[$i][$option]['products_options_name'] .' ' . $products[$i][$option]['products_options_values_name']; } } // refactor $Gitem = new GoogleItem($products_name, $products_description, $products[$i]['quantity'], $currencies->get_value(DEFAULT_CURRENCY) * $products[$i]['final_price'], 'LB', $products[$i]['weight']); // $currencies->get_value(DEFAULT_CURRENCY) * $products[$i]['final_price']); $Gitem->SetMerchantPrivateItemData( new MerchantPrivateItemData(array( // 'item_old' => base64_encode(serialize($products[$i])), 'item' => base64_encode(serialize($order_items[$i]))))); $Gitem->SetMerchantItemId($products[$i]['id']); if(!empty($tt)) { $Gitem->SetTaxTableSelector($tt); } if($product_virtual) { $digital_url = str_replace("&", "&", tep_href_link('checkout_success.php')); $Gitem->SetURLDigitalContent($digital_url, '', $products_name . " " . $products_description . "<br />". GOOGLECHECKOUT_STRING_EXTRA_DIGITAL_CONTENT); } $Gcart->AddItem($Gitem); // Stock Check if (STOCK_CHECK == 'true') { if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { $flagAnyOutOfStock = true; } } $product_list .= ";".(int)$products[$i]['id']; $category_id = tep_db_fetch_array(tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products[$i]['id'] ."'")); if(in_array($category_id['categories_id'], $resticted_categories)) { $Gcart->SetButtonVariant(false); $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_RESTRICTED_CATEGORY; break; } } // Coustom Order Totals require_once(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total(); $order_totals = $order_total_modules->process(); $ot_used = false; foreach($order_totals as $order_total){ if(!in_array($order_total['code'], $googlepayment->ot_ignore)){ // Cant used this since the OT is passed as an item, and tax cant be calculated $tax_class_id = @constant("MODULE_ORDER_TOTAL_" . substr(strtoupper($order_total['code']), 3) . "_TAX_CLASS"); $tax = tep_db_fetch_array(tep_db_query("select tax_class_title from " . TABLE_TAX_CLASS . " where tax_class_id = " . (int)$tax_class_id )); $tt = @$tax['tax_class_title']; if(!empty($tt) && !in_array($tax_class_id, $tax_array)) { $tax_array[] = $tax_class_id; $tax_name_array[] = $tt; } $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); //// number_format(($amount) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)) // $currencies->get_value(DEFAULT_CURRENCY) * $ot_value); $Gitem->SetMerchantPrivateItemData( new MerchantPrivateItemData(array('order_total' => base64_encode(serialize($order_total))))); if(!empty($tt)) { $Gitem->SetTaxTableSelector($tt); } // TaxTable with 0% Rate // $Gitem->SetTaxTableSelector('_OT_cero_tax'); // This is a hack to avoid showing shipping when cart is virtual and an OT is added if(DOWNLOAD_ENABLED == 'true' && $cart->get_content_type() == 'virtual') { $Gitem->SetEmailDigitalDelivery('true'); } $Gcart->AddItem($Gitem); $ot_used = true; } } //if($ot_used) { // $GAtaxTable_OT = new GoogleAlternateTaxTable('_OT_cero_tax'); // $GAtaxRule = new GoogleAlternateTaxRule('0'); // $GAtaxRule->SetWorldArea(); // $GAtaxTable_OT->AddAlternateTaxRules($GAtaxRule); // $Gcart->AddAlternateTaxTables($GAtaxTable_OT); //} // Out of Stock if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($flagAnyOutOfStock == true) ) { $Gcart->SetButtonVariant(false); $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_OUT_OF_STOCK; } $private_data = tep_session_id() .';'. tep_session_name(); $Gcart->SetMerchantPrivateData( new MerchantPrivateData(array('session-data' => $private_data))); $Gcart->AddRoundingPolicy(MODULE_PAYMENT_GOOGLECHECKOUT_TAXMODE, MODULE_PAYMENT_GOOGLECHECKOUT_TAXRULE); $continue_shopping_url = ($googlepayment->continue_url=='gc_return.php')? $googlepayment->continue_url . '?products_id=' . implode(',', explode(';', !empty($product_list)? trim($product_list,';'):'-1')):$googlepayment->continue_url; $Gcart->SetEditCartUrl(tep_href_link('shopping_cart.php')); $Gcart->SetContinueShoppingUrl(tep_href_link($continue_shopping_url)); $Gcart->SetRequestBuyerPhone('true'); if(MODULE_PAYMENT_GOOGLECHECKOUT_EXPIRATION != 'NONE') { // 2007-12-31T11:59:59-05:00 $Gcart->SetCartExpiration(date('Y-m-d\TH:i:s\Z', time() + MODULE_PAYMENT_GOOGLECHECKOUT_EXPIRATION*60 - date('Z', time()))); } //Shipping options $tax_class = array (); $shipping_arr = array (); $tax_class_unique = array (); if(DOWNLOAD_ENABLED != 'true' || $cart->get_content_type() != 'virtual') { $options = explode(", ", MODULE_PAYMENT_GOOGLECHECKOUT_SHIPPING); // Get the properties of the shipping methods. $module_directory = DIR_FS_CATALOG . DIR_WS_MODULES . 'shipping/'; if(!file_exists($module_directory)) { $Gcart->SetButtonVariant(false); $Gwarnings[] = sprintf(GOOGLECHECKOUT_STRING_WARN_WRONG_SHIPPING_CONFIG, $module_directory); } $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $directory_array = array(); if ($dir = @ dir($module_directory)) { while ($file = $dir->read()) { if (!is_dir($module_directory . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { $directory_array[] = $file; } } } sort($directory_array); $dir->close(); } $check_query = tep_db_fetch_array(tep_db_query("select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_id = '" . SHIPPING_ORIGIN_COUNTRY . "'")); $shipping_origin_iso_code_2 = $check_query['countries_iso_code_2']; $module_info = array(); $module_info_enabled = array(); for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) { $file = $directory_array[$i]; include_once (DIR_FS_CATALOG .DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $file); include_once ($module_directory . $file); $class = substr($file, 0, strrpos($file, '.')); $module = new $class; $curr_ship = strtoupper($module->code); switch($curr_ship){ case 'FEDEXGROUND': $curr_ship = 'FEDEX_GROUND'; break; case 'FEDEXEXPRESS': $curr_ship = 'FEDEX_EXPRESS'; break; case 'UPSXML': $curr_ship = 'UPSXML_RATES'; break; case 'DHLAIRBORNE': $curr_ship = 'AIRBORNE'; break; default: break; } if (@constant('MODULE_SHIPPING_' . $curr_ship . '_STATUS') == 'True') { $module_info_enabled[$module->code] = array('enabled' => true); } if ($module->check() == true) { $module_info[$module->code] = array( 'code' => $module->code, 'title' => $module->title, 'description' => $module->description, 'status' => $module->check()); } } // check if there is a shipping module activated that is not flat rate // to enable Merchan Calculations // if there are flat and MC, both will be MC $ship_calculation_mode = MODULE_PAYMENT_GOOGLECHECKOUT_CARRIER_CALCULATED_ENABLED=='True'?false: (count(array_keys($module_info_enabled)) > count(array_intersect($googlepayment->shipping_support , array_keys($module_info_enabled)))) ? true : false; $key_values = explode(", ", MODULE_PAYMENT_GOOGLECHECKOUT_SHIPPING); $shipping_config_errors = ''; $free_shipping = false; foreach ($module_info as $key => $value) { // Check if the shipping method is activated. $module_name = $module_info[$key]['code']; $curr_ship = strtoupper($module_name); switch($curr_ship){ case 'FEDEXGROUND': $curr_ship = 'FEDEX_GROUND'; break; case 'FEDEXEXPRESS': $curr_ship = 'FEDEX_EXPRESS'; break; case 'UPSXML': $curr_ship = 'UPSXML_RATES'; break; case 'DHLAIRBORNE': $curr_ship = 'AIRBORNE'; break; default: break; } $common_string = "MODULE_SHIPPING_" . $curr_ship . "_"; @$zone = constant($common_string . "ZONE"); @$enable = constant($common_string . "STATUS"); @$curr_tax_class = constant($common_string . "TAX_CLASS"); @$price = constant($common_string . "COST"); @$handling = constant($common_string . "HANDLING"); @$table_mode = constant($common_string . "MODE"); $allowed_restriction_state = $allowed_restriction_country = array(); // Exception for enabling shipping modules if(defined('MODULE_SHIPPING_FREESHIPPER_STATUS') && MODULE_SHIPPING_FREESHIPPER_STATUS == "True"){ switch ($curr_ship) { case 'FREESHIPPER': if($cart->free_shipping_items() != $cart->count_contents()){ $enable = "False"; unset($module_info_enabled['freeshipper']); } else { $enable = "True"; $free_shipping = true; } break; default: if($cart->free_shipping_items() == $cart->count_contents()){ $enable = "False"; unset($module_info_enabled['freeshipper']); } break; } } // Disable any merchant-calculation module if Carrier calculated is enabled // This will allow only flat-rate shippings if(MODULE_PAYMENT_GOOGLECHECKOUT_CARRIER_CALCULATED_ENABLED == 'True' && !in_array($module_name, $googlepayment->shipping_support)){ $enable = 'False'; unset($module_info_enabled['freeshipper']); } if ($enable == "True") { if ($zone != '') { $zone_result = tep_db_query("SELECT countries_name, coalesce(zone_code, 'All Areas') zone_code, countries_iso_code_2 FROM " . TABLE_GEO_ZONES . " AS gz inner join ". TABLE_ZONES_TO_GEO_ZONES ." AS ztgz on gz.geo_zone_id = ztgz.geo_zone_id inner join ". TABLE_COUNTRIES ." AS c on ztgz.zone_country_id = c.countries_id left join ". TABLE_ZONES ." AS z on ztgz.zone_id = z.zone_id WHERE gz.geo_zone_id = '". $zone ."'"); $allowed_restriction_state = $allowed_restriction_country = array(); // Get all the allowed shipping zones. while($zone_answer = tep_db_fetch_array($zone_result)) { $allowed_restriction_state[] = $zone_answer['zone_code']; $allowed_restriction_country[] = array($zone_answer['countries_name'], $zone_answer['countries_iso_code_2']); } } if ($curr_tax_class != 0 && $curr_tax_class != '') { $tax_class[] = $curr_tax_class; if (!in_array($curr_tax_class, $tax_class_unique)) $tax_class_unique[] = $curr_tax_class; } if (is_array($googlepayment->mc_shipping_methods[$key])) { foreach($googlepayment->mc_shipping_methods[$key] as $type => $shipping_type){ foreach($shipping_type as $method => $name){ $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); // ['domestic_types'] $shipping_name = $googlepayment->mc_shipping_methods_names[$module_info[$key]['code']] . ': ' . $name; if(!in_array($module_info[$key]['code'], $googlepayment->shipping_support)) { $default_value = gc_compare($module_info[$key]['code'].$method . $type ,$key_values); $shipping_price = $currencies->get_value(DEFAULT_CURRENCY) * $default_value; } // flat rate shipping else { $default_value = 1; $module = new $module_name; $quote = $module->quote($method); $price = $quote['methods'][0]['cost']; $shipping_price = $currencies->get_value(DEFAULT_CURRENCY) * ($price>=0?$price:0); } $Gfilter = new GoogleShippingFilters(); if(MODULE_PAYMENT_GOOGLECHECKOUT_USPOBOX == 'False') { $Gfilter->SetAllowUsPoBox('false'); } if(!empty($allowed_restriction_country)){ foreach($allowed_restriction_state as $state_key => $state) { if($allowed_restriction_country[$state_key][1] == 'US') { if($state == 'All Areas') { $Gfilter->SetAllowedCountryArea('ALL'); } else { $Gfilter->AddAllowedStateArea($state); } } else { // TODO here should go the non us area (not implemented in GC) // now just the country $Gfilter->AddAllowedPostalArea($allowed_restriction_country[$state_key][1]); } } } else { switch($type) { case 'domestic_types': if('US' == $shipping_origin_iso_code_2) { $Gfilter->SetAllowedCountryArea('ALL'); }else{ $Gfilter->AddAllowedPostalArea($shipping_origin_iso_code_2); } break; case 'international_types': $Gfilter->SetAllowedWorldArea(true); if('US' == SHIPPING_ORIGIN_COUNTRY) { $Gfilter->SetExcludedCountryArea('ALL'); }else{ $Gfilter->AddExcludedPostalArea($shipping_origin_iso_code_2); } break; default: // should never reach here! $Gfilter->SetAllowedWorldArea(true); break; } } if ($ship_calculation_mode == 'True') { if($default_value != 0) { $Gshipping = new GoogleMerchantCalculatedShipping($shipping_name, $shipping_price); $Gshipping->AddShippingRestrictions($Gfilter); $Gshipping->AddAddressFilters($Gfilter); $Gcart->AddShipping($Gshipping); } } else { $Gshipping = new GoogleFlatRateShipping($shipping_name, $shipping_price); $Gshipping->AddShippingRestrictions($Gfilter); $Gcart->AddShipping($Gshipping); } } } } else { $shipping_config_errors .= $key ." (ignored)<br />"; } } } if(MODULE_PAYMENT_GOOGLECHECKOUT_CARRIER_CALCULATED_ENABLED == 'True' && !$free_shipping){ $Gshipping = new GoogleCarrierCalculatedShipping('Carrier_shipping'); $country_code = defined('SHIPPING_ORIGIN_COUNTRY')?SHIPPING_ORIGIN_COUNTRY:STORE_COUNTRY; $zone_name = tep_get_zone_code($country_code, STORE_ZONE, ''); $countries_array = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true); $ship_from = new GoogleShipFrom('Store_origin', '', $countries_array['countries_iso_code_2'], SHIPPING_ORIGIN_ZIP, $zone_name); $GSPackage = new GoogleShippingPackage($ship_from,1,1,1,'IN'); $Gshipping->addShippingPackage($GSPackage); $carriers_config = explode(', ', MODULE_PAYMENT_GOOGLECHECKOUT_CARRIER_CALCULATED); // print_r($googlepayment->cc_shipping_methods);die; foreach($googlepayment->cc_shipping_methods_names as $CCSCode => $CCSName){ foreach($googlepayment->cc_shipping_methods[$CCSCode] as $type => $methods) { foreach($methods as $method => $method_name) { $values = explode('|', gc_compare($CCSCode . $method. $type , $carriers_config, "_CCS:", '0|0|0')); if($values[0] != '0') { $CCSoption = new GoogleCarrierCalculatedShippingOption($values[0], $CCSName, $method,$values[1], $values[2], 'REGULAR_PICKUP'); $Gshipping->addCarrierCalculatedShippingOptions($CCSoption); } } } } $Gcart->AddShipping($Gshipping); } } if($ship_calculation_mode == 'True') { if (MODULE_PAYMENT_GOOGLECHECKOUT_MODE == 'https://sandbox.google.com/checkout/' && MODULE_PAYMENT_GOOGLECHECKOUT_MC_MODE == 'http') { $url = HTTP_SERVER . DIR_WS_CATALOG .'googlecheckout/responsehandler.php'; } else { $url = HTTPS_SERVER . DIR_WS_CATALOG .'googlecheckout/responsehandler.php'; } $Gcart->SetMerchantCalculations($url, 'false', 'false', 'false'); } if(MODULE_PAYMENT_GOOGLECHECKOUT_3RD_PARTY_TRACKING != 'NONE') { // Third party tracking $tracking_attr_types = array( 'buyer-id' => 'buyer-id', 'order-id' => 'order-id', 'order-subtotal' => 'order-subtotal', 'order-subtotal-plus-tax' => 'order-subtotal-plus-tax', 'order-subtotal-plus-shipping' => 'order-subtotal-plus-shipping', 'order-total' => 'order-total', 'tax-amount' => 'tax-amount', 'shipping-amount' => 'shipping-amount', 'coupon-amount' => 'coupon-amount', 'coupon-amount' => 'coupon-amount', 'billing-city' => 'billing-city', 'billing-region' => 'billing-region', 'billing-postal-code' => 'billing-postal-code', 'billing-country-code' => 'billing-country-code', 'shipping-city' => 'shipping-city', 'shipping-region' => 'shipping-region', 'shipping-postal-code' => 'shipping-postal-code', 'shipping-country-code' => 'shipping-country-code', ); $Gcart->AddThirdPartyTracking(MODULE_PAYMENT_GOOGLECHECKOUT_3RD_PARTY_TRACKING, $tracking_attr_types); } //Tax options if (sizeof($tax_class_unique) == 1 && sizeof($module_info_enabled) == sizeof($tax_class)) { $tax_rates_result = tep_db_query("select countries_name, coalesce(zone_code, 'All Areas') zone_code, tax_rate, countries_iso_code_2 from " . TABLE_TAX_RATES . " as tr " . " inner join " . TABLE_ZONES_TO_GEO_ZONES . " as ztgz on tr.tax_zone_id = ztgz.geo_zone_id " . " inner join " . TABLE_COUNTRIES . " as c on ztgz.zone_country_id = c.countries_id " . " left join " . TABLE_ZONES . " as z on ztgz.zone_id=z.zone_id where tr.tax_class_id= '" . $tax_class_unique[0] ."'"); $num_rows = tep_db_num_rows($tax_rates_result); $tax_rule = array(); for ($j = 0; $j < $num_rows; $j++) { $tax_result = tep_db_fetch_array($tax_rates_result); $rate = ((double) ($tax_result['tax_rate'])) / 100.0; $GDtaxRule = new GoogleDefaultTaxRule($rate, 'true'); if($tax_result['countries_iso_code_2'] == 'US') { if($tax_result['zone_code'] == 'All Areas') { $GDtaxRule->SetCountryArea('ALL'); } else { $GDtaxRule->SetStateAreas($tax_result['zone_code']); } } else { $GDtaxRule->AddPostalArea($tax_result['countries_iso_code_2']); } $Gcart->AddDefaultTaxRules($GDtaxRule); } } else { $GDtaxRule = new GoogleDefaultTaxRule(0, 'false'); $GDtaxRule->SetWorldArea(true); $Gcart->AddDefaultTaxRules($GDtaxRule); } if(sizeof($tax_class_unique) > 1 || (sizeof($tax_class_unique) == 1 && sizeof($module_info_enabled) != sizeof($tax_class) )) { $Gcart->SetButtonVariant(false); $Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_MULTIPLE_SHIP_TAX; } $i = 0; $tax_tables = array (); foreach ($tax_array as $tax_table) { $tax_rates_result = tep_db_query("select countries_name, coalesce(zone_code, 'All Areas') zone_code, tax_rate, countries_iso_code_2 from " . TABLE_TAX_RATES . " as tr " . " inner join " . TABLE_ZONES_TO_GEO_ZONES . " as ztgz on tr.tax_zone_id = ztgz.geo_zone_id " . " inner join " . TABLE_COUNTRIES . " as c on ztgz.zone_country_id = c.countries_id " . " left join " . TABLE_ZONES . " as z on ztgz.zone_id=z.zone_id where tr.tax_class_id= '" . $tax_array[$i] ."'"); $num_rows = tep_db_num_rows($tax_rates_result); $tax_rule = array (); $GAtaxTable = new GoogleAlternateTaxTable((!empty($tax_name_array[$i])?$tax_name_array[$i]:'none'), 'false'); for ($j = 0; $j < $num_rows; $j++) { $tax_result = tep_db_fetch_array($tax_rates_result); $rate = ((double) ($tax_result['tax_rate'])) / 100.0; $GAtaxRule = new GoogleAlternateTaxRule($rate); if($tax_result['countries_iso_code_2'] == 'US') { if($tax_result['zone_code'] == 'All Areas') { $GAtaxRule->SetCountryArea('ALL'); } else { $GAtaxRule->SetStateAreas($tax_result['zone_code']); } } else { // TODO here should go the non use area $GAtaxRule->AddPostalArea($tax_result['countries_iso_code_2']); } $GAtaxTable->AddAlternateTaxRules($GAtaxRule); } $i++; $Gcart->AddAlternateTaxTables($GAtaxTable); } if(!(MODULE_PAYMENT_GOOGLECHECKOUT_ANALYTICS == 'NONE')) { $Gcart->AddGoogleAnalyticsTracking(MODULE_PAYMENT_GOOGLECHECKOUT_ANALYTICS); } ?> <div align="right"> <?php echo '<div style="width: 180px; text-align: center;"><b>' . MODULE_PAYMENT_GOOGLECHECKOUT_TEXT_OPTION . '</b></div>'; ?> </div> <div align="right"> <?php echo $Gcart->CheckoutButtonCode(); ?> <?php foreach($Gwarnings as $Gwarning) { echo '<div style="font-size:11px; color: red; width: 180px; text-align: center;"> * ' . $Gwarning . '</div>'; } if($shipping_config_errors != ''){ echo '<div style="font-size:11px; color: red; width: 180px; text-align: center;"><b>' . GOOGLECHECKOUT_STRING_ERR_SHIPPING_CONFIG . '</b><br />'; echo $shipping_config_errors; echo '</div>'; } ?> </div> <?php //echo $Gcart->CheckoutHTMLButtonCode(); //echo "<xmp>".$Gcart->GetXML()."</xmp>"; ?> <!-- ** END GOOGLE CHECKOUT ** --> I think there may be a problem with the way this php calls from the mySQL specifically regarding the ADDed columns for OTF: ALTER TABLE products_options ADD products_options_type INT( 5 ) NOT NULL , ADD products_options_length SMALLINT( 2 ) DEFAULT '32' NOT NULL , ADD products_options_comment VARCHAR( 32 ); ALTER TABLE customers_basket_attributes ADD products_options_value_text text; Any help is very much appreciated.
  3. First let me say I love this contribution and that I really appreciate the creation of it. I have installed Option Type Feature v. 2.0.1 (Complete Package) http://www.oscommerce.com/community/contributions,160 both using the manual instruction on my current working installation of osCommerce and as a drop in on a clean installation of 2.2 as control. My problem is that is the Attribute Option Type is set to text area, the contents are lost when the Shopping Cart is updated OR when the shopping cart attemps to pass the value on to payment processing ( in this case Google Checkout ). This is not the case with other Attribute Option Types. It looks like I'm having the same problem that was described as fixed in: Textarea remember attributes bigjat69 7 Aug 2007 ( Which I assumed was included in the Option Type Feature v. 2.0.1 (Complete Package) - but which I have also attempted to install manually. It does seem that the problem is somewhere in product_info.php (which I have included below). Any help is much appreciated. <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } // BOF Product Type Feature /* DDB - 041031 - Form Field Progress Bar */ /*********************************************** * Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/ * Modified by Dynamic Drive for minor changes * Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com * Please keep this notice intact ***********************************************/ function textCounter(field,counter,maxlimit,linecounter) { // text width// var fieldWidth = parseInt(field.offsetWidth); var charcnt = field.value.length; // trim the extra text if (charcnt > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { // progress bar percentage var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit); document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px"; document.getElementById(counter).innerHTML="Limit: "+percentage+"%" // color correction on style from CCFFF -> CC0000 setcolor(document.getElementById(counter),percentage,"background-color"); } } function setcolor(obj,percentage,prop){ obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)"; } // EOF Product Type Feature //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php // BOF Option Type Feature //$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); //while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { //clr 030714 add case statement to check option type switch ($products_options_name['products_options_type']) { case PRODUCTS_OPTIONS_TYPE_TEXT: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')'; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_TEXTAREA: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" wrap="soft" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" rows=5 id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" >' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '</textarea> <div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //--> <tr> <?php if ($products_attribs_array['options_values_price'] != '0') { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td> <?php } else { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td> <?php } ?> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 030714 Add logic for radio buttons $tmp_html = '<table>'; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); $checked = true; while ($products_options_array = tep_db_fetch_array($products_options_query)) { $tmp_html .= '<tr><td class="main">'; $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked); $checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; if ($products_options_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } $tmp_html .= '</tr></td>'; } $tmp_html .= '</table>'; ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'; echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</td></tr>'; break; default: //clr 030714 default is select list //clr 030714 reset selected_attribute variable $selected_attribute = false; // EOF Option Type Feature $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php // BOF Option Type Feature //echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . $products_options_name['products_options_comment']; // EOF Option Type Feature ?></td> </tr> <?php // BOF Option Type Feature } // ends the switch clause // EOF Option Type Feature } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
×