Jump to content

cyberfolli

Members
  • Content count

    46
  • Joined

  • Last visited

  1. cyberfolli

    Wishlist 3.0 Support Thread

    Did you ever get this resolved? I am having the same issue.. I am hosting with godaddy?..
  2. Hi all here is a description of the issue. I walked into this module after the fact but the problem is cart page .. it will not show the subtotal if this shipping option is used in the admin product page. the module is assigned on the product page by using any number over 0 example 2 and turns this shipping method on.. what I have found is that if it is on if I use a weight example 34.24 it doesn't show the subtotal in the cart. if I use example 00.34 (ounces) it does show the subtotal. this is the code that affects that .. function _setWeight($pounds, $ounces=0) { $this->pounds = $pounds; $this->ounces = $ounces; This is a con-way module.. the bottom line if it is in affect the cart page does not show the subtotal correctly <?php /* $Id: */ class conway { var $code, $title, $description, $icon, $enabled, $countries; // class constructor function conway() { global $order; $this->code = 'conway'; $this->title = MODULE_SHIPPING_CONWAY_TEXT_TITLE; $this->description = MODULE_SHIPPING_CONWAY_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_CONWAY_SORT_ORDER; $this->icon = ''; // DIR_WS_ICONS . 'shipping_usps.gif'; $this->tax_class = MODULE_SHIPPING_CONWAY_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_CONWAY_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_CONWAY_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_CONWAY_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes, $lift_gate; $conwayQuote = $this->_getQuote(); //print_r($conwayQuote); exit; if (is_array($conwayQuote)) { if (isset($conwayQuote['error'])) { $this->quotes = array('module' => $this->title, 'error' => $conwayQuote['error']); } else { $this->quotes = array('id' => $this->code, 'module' => $this->title); $methods = array(); $size = sizeof($conwayQuote); $acc_string = (!isset($order->delivery['company'])||$order->delivery['company']==''?' Residential':''); $acc_string .= ($lift_gate?($acc_string?' &':'').' Lift Gate':''); for ($i=0; $i<$size; $i++) { list($type, $cost) = $conwayQuote[$i]; //print_r($cost); exit; $methods[] = array('id' => $type, 'title' => 'Conway'. $acc_string.' Shipping', 'cost' => ($cost + MODULE_SHIPPING_CONWAY_HANDLING)); } $this->quotes['methods'] = $methods; if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } } } else { $this->quotes = array('module' => $this->title, 'error' => MODULE_SHIPPING_CONWAY_TEXT_ERROR); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); return $this->quotes; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_CONWAY_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CONWAY Shipping', 'MODULE_SHIPPING_CONWAY_STATUS', 'True', 'Do you want to offer Con-way shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the CONWAY User ID', 'MODULE_SHIPPING_CONWAY_USERID', 'NONE', 'Enter the USERID assigned to you.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the CONWAY Password', 'MODULE_SHIPPING_CONWAY_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the CONWAY Customer #', 'MODULE_SHIPPING_CONWAY_ACCOUNT', 'NONE', 'Con-Way Customer #', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin ZipCode', 'MODULE_SHIPPING_CONWAY_ORIGIN_ZIP', 'NONE', 'Company Send From Zip', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fees', 'MODULE_SHIPPING_CONWAY_HANDLING', 'NONE', 'Pads Con-Way Shipping Cost', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_CONWAY_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_CONWAY_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_CONWAY_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_CONWAY_STATUS', 'MODULE_SHIPPING_CONWAY_USERID', 'MODULE_SHIPPING_CONWAY_PASSWORD','MODULE_SHIPPING_CONWAY_ACCOUNT','MODULE_SHIPPING_CONWAY_ORIGIN_ZIP', 'MODULE_SHIPPING_CONWAY_HANDLING', 'MODULE_SHIPPING_CONWAY_TAX_CLASS', 'MODULE_SHIPPING_CONWAY_ZONE', 'MODULE_SHIPPING_CONWAY_SORT_ORDER'); } function _setService($service) { $this->service = $service; } function _setWeight($pounds, $ounces=0) { $this->pounds = $pounds; $this->ounces = $ounces; } function _setContainer($container) { $this->container = $container; } function _setSize($size) { $this->size = $size; } function _setMachinable($machinable) { $this->machinable = $machinable; } function _getQuote() { global $order; global $cart; global $lift_gate; if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { $request = '<RateRequest USERID="' . MODULE_SHIPPING_CONWAY_USERID . '" PASSWORD="' . MODULE_SHIPPING_CONWAY_PASSWORD . '">'; $services_count = 0; $dest_zip = str_replace(' ', '', $order->delivery['postcode']); if ($order->delivery['country']['iso_code_2'] == 'US') $dest_zip = substr($dest_zip, 0, 5); $title = "Rating"; $requestType = "RateRequest"; $requestUrl = "https://www.Con-way.com/XMLj/X-Rate";; // replace the USERNAME and PASSWORD String values below with your Con-way username and password $username = MODULE_SHIPPING_CONWAY_USERID; $password = MODULE_SHIPPING_CONWAY_PASSWORD; // to get a customer-specific discount, replace the CUSTNMBR string below with your Con-way customer number, then uncomment the <CustNmbr> line below. $custNmbr = MODULE_SHIPPING_CONWAY_ACCOUNT; $today = date("m/d/y"); // array of input data //$myInput = $_GET; // If you don't pass data in as a GET variables, hard code them here: if(MODULE_SHIPPING_CONWAY_ORIGIN_ZIP=='') return array('error' => 'Please set Con-way Orign Zipcode.'); $myInput['origZip'] = MODULE_SHIPPING_CONWAY_ORIGIN_ZIP; $dest_zip = str_replace(' ', '', $order->delivery['postcode']); if ($order->delivery['country']['iso_code_2'] == 'US') $myInput['destZip'] = substr($dest_zip, 0, 5); else return array('error' => 'Destination is not contenental US.'); // array of elements you want to query from the XML Response $myElements = array('TotalCharge', 'Discount', 'TotalAccessorialCharges', 'NetCharge', 'TransitTime'); /* Build XML Request In actual use, you would probably populate the XML Request parameters (Weights, Classes, Zip Codes, etc.) from data submitted via an on-line order form or database. For this sample we will just hard code some dummy data. */ //$itemArray = array(); //Your commodity items, maximum of 4 - add as needed //$itemArray[] = array('class'=>'775', 'weight'=>'667'); //$itemArray[] = array('class'=>'100', 'weight'=>'555'); $accArray = array(); // Your accessorial services - add as needed //$accArray[] = "SSC"; // Sorting and Segregating //$accArray[] = "DNC"; // Order Notify Shipments //$accArray[] = "GUR"; // Guarantee of Delivery if(!isset($order->delivery['company'])||$order->delivery['company']=='') $accArray[] = "RSD"; // Destination Residential Delivery if($lift_gate) $accArray[] = "DLG"; // Lift Gate Service Delivery extract($myInput); $xmlPreItemRequest = "<RateRequest>" . "<OriginZip country=\"us\">$origZip</OriginZip>" . "<DestinationZip country=\"us\">$destZip</DestinationZip>"; // To get customer specific discount, uncomment this line: if($custNmbr) $xmlPreItemRequest .= "<CustNmbr shipcode=\"S\">$custNmbr</CustNmbr>"; $xmlPreItemRequest .= "<ChargeCode>P</ChargeCode>" . "<DiscountRate>82</DiscountRate>" . "<EffectiveDate>$today</EffectiveDate>"; $xmlPostItemRequest = ''; foreach ($accArray as $acc) { // Add accessorials to the XML Request $xmlPostItemRequest .= "<Accessorial>$acc</Accessorial>"; } $xmlPostItemRequest .= "</RateRequest>"; $total_shipping_price = 0; $products = $cart->get_products(); $xmlRequest = $xmlPreItemRequest; $item_count = 0; // You can't have more then 4 items quoted else it's more then a truck? $improperly_setup_product = false; $conway_product = false; // check if conway product exists foreach ($products as $p) { // Add commodity items to the XML Request $product_query = tep_db_query("SELECT products_weight, products_class FROM ".TABLE_PRODUCTS." WHERE products_id='".(int)$p['id']."'"); $product = tep_db_fetch_array($product_query); $class = $product['products_class']; // only check add products that have classes else it's not a Conway freight product! // also has to have a weight otherwise class is incorrect $weight = number_format($product['products_weight'], 0); if((int)$class>0 && $weight>0) { // indicates conway product $conway_product = true; $weight = str_replace(array('$',','),'',$weight); //$xmlRequest = $xmlPreItemRequest; for($z = 0; $z < $p['quantity']; $z++) { $xmlRequest .= "<Item>" . "<CmdtyClass>$class</CmdtyClass>" . "<Weight unit=\"lbs\">$weight</Weight>" . "</Item>"; $item_count++; } } // An incorrectly configured product with a class but no weight!!!! OMG! Bad admin, BAD! if((int)$class>0 && $weight==0) { mail(WEBSITE_DEVELOPER_EMAIL,'Improperly set Conway product #'.(int)$p['id'],"An imporperly priced item was found in the system while a customer was trying to order.\n\nProduct#".(int)$p['id'],'noreply@marineenginedepot.com'); $improperly_setup_product = true; } } if(!$conway_product) return array(array('conway', 0));; if($item_count >4) return array('error' => '<span style="color:#fd0000">Error!</span> You will have to split up your order as we cannot have more then 4 products shipped via Conway per order.'); $xmlRequest .= $xmlPostItemRequest; //echo htmlentities($xmlRequest); echo '<br><br>'; //Convert characters to proper format for HTTP POST $xmlRequest = urlencode($xmlRequest); $shipping_result = $this->getCNWQuote($xmlRequest); //echo htmlentities($shipping_result); exit; if($improperly_setup_product || round($shipping_result)<5) return array('error' => '<span style="color:#fd0000">Error!</span> Issue with Con-way shipping cost results.<br>This issue is with a product in your cart and has been reported. <br />Please <a href="contact_us.php">Contact Us</a> in regards to delivering the product to your above address.'); //echo $shipping_result; exit; if($shipping_result) $total_shipping_price += $shipping_result*$p['quantity']; else return array('error' => '<span style="color:#fd0000">Error!</span> Issue with Con-way shipping cost results.'); return array(array('conway', $total_shipping_price)); } else { return array('error' => '<span style="color:#fd0000">Error!</span> International Shipping Not Implemented in this Custom Module.'); } return ((sizeof($rates) > 0) ? $rates : false); } function getCNWQuote($url) { $requestUrl = "https://www.Con-way.com/XMLj/X-Rate"; $requestType = "RateRequest"; $username = ""; $password = ""; $urlConn = curl_init ($requestUrl); curl_setopt ($urlConn, CURLOPT_POST, 1); curl_setopt ($urlConn, CURLOPT_SSL_VERIFYPEER, false); // May be needed for SSL behind a firewall curl_setopt ($urlConn, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded")); curl_setopt ($urlConn, CURLOPT_USERPWD, $username.":".$password); curl_setopt ($urlConn, CURLOPT_POSTFIELDS, "$requestType=$url"); // Get the XML Response // prevent the buffer from being displayed ob_start(); curl_exec($urlConn); $url = ob_get_contents(); ob_end_clean(); curl_close($urlConn); // close the connection $xmlResponse = $url; if (strpos($xmlResponse, 'RATINGERROR') === true || strpos($xmlResponse, '<NetCharge currency="USD">') === false) { return true; } else { $start_pos = strpos($xmlResponse, '<NetCharge currency=') + 26; $string_len = strpos($xmlResponse, '</NetCharge>') - $start_pos; $shipping_price = str_replace(',', '', substr($xmlResponse, $start_pos, $string_len)); if (is_numeric($shipping_price)) { return $shipping_price; } else { return false; } } } } ?>
  3. Hello all.. I was wondering if any knows of a mod or just a simple code mod that would display a specific category items on the main page of the site instead of the newest items? thanks in advance Scott
  4. Hi all Having a problem with tny mce working with the categories.php in the admin. I have tested a seperate page to make sure I am connecting to the javascript which I am.. so the exact code in the categories header does not produce an advanced word editor? am I missing something do I need to change the main description text field to something else? Any help would be appreciated
  5. cyberfolli

    UPS rates upgrade

    Does anyone know how to adjust the rates to reflect the new UPS rates??
  6. cyberfolli

    Free Shipping per product

    Carl thanks for the advice I appreciate the time.. I will look into it and see how it goes. Scott
  7. cyberfolli

    Free Shipping per product

    I have found a couple that allow free shipping with 0 weight but nothing for 2.1 or 2.2 any ideas out there would be appreciated.. thanks
  8. cyberfolli

    Customers extra fields

    Great Contribution .. I ran into a problem with the customers page not showing up in the admin?? it doesn't give any errors just blank.. not sure what's up.. anyone have any Ideas. I went through the install file twice to double check and I seam to not have missed anything..
  9. I just installed Free Shipping by cat 1.3 and i can't find where in the admin to actually install and or turn it on. Does anyone have any experience with this module. i have all of the code and files changed and uploaded.. The Instructions say First note that module is turned off by default (first configuration value). turn it on to use. Maybe I am just having a brain fart but I can't find it.
  10. When I check out it keeps going to login page after it goes to authorize.net any solutions out there? I was told by authorize.net that OScommerce should assign it to come back to the correct page?
  11. Does anyone know how I can or if there is a module that can let customers pre order an item before it is available with out processing the credit card. It would allow the owners of the cart to see how many people would be interested in the product before the place a final order on the product. My pre order searches have come up with other topics etc. thanks in advance
×