Jump to content

lcwk86

Members
  • Content count

    28
  • Joined

  • Last visited

Profile Information

  • Real Name
    Lisa W.
  • Gender
    Female
  1. Yes - I have double checked that. Still keeps happening. LW
  2. Perhaps this question was already answered, but I can't seem to find it. I installed USPS_Methods_5.2.0_RateV4IntlRateV2 on oscommerce 2.2 RC2a. I am getting this message: An error occured with the USPS shipping calculations. If you would like to use USPS as your shipping method, please contact the store owner. I have my zipcode set under Admin-->config-->shipping/packaging The shipping method bullet points do not stay checked in the USPS methods shipping module. Any help appreciated. LW
  3. Not sure if my issue is the same... I have I have QTpro 4.6; not sure what SPPC 4 is? But my stock does not subtract if there are attributes. Total number subtracts. What is the solution? Thanks for any help. LW
  4. Thanks - I had overlooked that step. Individual Product Shipping doesn't work the way I expected anyway. Even when I choose another shipping method in check out, it still adds the amount I have entered in Individual Product shipping to the total.
  5. I installed Individual Product Shipping with success and then tried to install Individual Product Shipping Methods (PSM) but was pretty sure that the shipping.php file could be an issue because it did not look like a find/replace code edit. After install, PSM module did not show up in the admin/modules/shipping to install and I got the following error in the admin/category/product edit page: 1054 - Unknown column 'p.shipping_methods' in 'field list' select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.shipping_methods, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from products p, products_description pd where p.products_id = '40' and p.products_id = pd.products_id and pd.language_id = '1' Here's my catalog/includes/classes/shipping.php code with both add ons included - not sure how to combine: <?php /* $Id: shipping.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ class shipping { var $modules; // class constructor function shipping($module = '') { /// start indvship // global $language, $PHP_SELF; global $language, $PHP_SELF, $cart; // New to fix attributes bug $cart_products = $cart->get_products(); if (tep_not_null($cart_products)) { $real_ids = array(); foreach($cart_products as $prod){ $real_ids[] = tep_get_prid($prod['id']); } $sql = "SELECT products_ship_methods_id FROM ".TABLE_PRODUCTS_SHIPPING." WHERE products_id IN (".implode(',',$real_ids).") AND products_ship_methods_id IS NOT NULL AND products_ship_methods_id <> ''"; $query = mysql_query($sql); // End new bug fix $allow_mod_array = array(); while($rec = mysql_fetch_array($query)){ if(empty($allow_mod_array)) $startedempty = true; $methods_array = array(); $methods_array = explode(';',$rec['products_ship_methods_id']); if(!empty($methods_array)){ foreach($methods_array as $method){ $allow_mod_array[] = $method; } } if($startedempty){ $startedempty = false; }else{ $temp_array = array(); foreach($allow_mod_array as $val){ $temp_array[$val]++; } $allow_mod_array = array(); foreach($temp_array as $key => $val){ if($val > 1){ $allow_mod_array[] = $key; } } } } } // end indvship // PSM BEGIN (this is messy i know) global $cart; // New to fix attributes bug $cart_products = $cart->get_products(); $real_ids = array(); foreach($cart_products as $prod){ $real_ids[] = tep_get_prid($prod['id']); } $sql = "SELECT shipping_methods FROM ".TABLE_PRODUCTS." WHERE products_id IN (".implode(',',$real_ids).") AND shipping_methods IS NOT NULL AND shipping_methods <> ''"; $query = mysql_query($sql); // End new bug fix $allow_mod_array = array(); while($rec = mysql_fetch_array($query)){ if(empty($allow_mod_array)) $startedempty = true; $methods_array = array(); $methods_array = explode(';',$rec[shipping_methods]); if(!empty($methods_array)){ foreach($methods_array as $method){ $allow_mod_array[] = $method; } } if($startedempty){ $startedempty = false; }else{ $temp_array = array(); foreach($allow_mod_array as $val){ $temp_array[$val]++; } $allow_mod_array = array(); foreach($temp_array as $key => $val){ if($val > 1){ $allow_mod_array[] = $key; } } } } // PSM END if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) { $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); // start indvship if (tep_not_null($cart_products)) { $temp_array = $this->modules; $this->modules = array(); foreach($temp_array as $val){ if(mysql_num_rows($query)==0 || in_array(str_replace('.php','',$val),$allow_mod_array)) { $this->modules[] = $val; } } } // end indvship // PSM START $temp_array = $this->modules; $this->modules = array(); foreach($temp_array as $val){ if(mysql_num_rows($query)==0 || in_array(str_replace('.php','',$val),$allow_mod_array)) { $this->modules[] = $val; } } // PSM END $include_modules = array(); if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) { $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1))); } else { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); $include_modules[] = array('class' => $class, 'file' => $value); } } for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) { include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']); include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']); $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']; } } } function quote($method = '', $module = '') { global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes; $quotes_array = array(); if (is_array($this->modules)) { $shipping_quoted = ''; $shipping_num_boxes = 1; $shipping_weight = $total_weight; if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) { $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT; } else { $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100); } if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes $shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT); $shipping_weight = $shipping_weight/$shipping_num_boxes; } $include_quotes = array(); reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if (tep_not_null($module)) { if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) { $include_quotes[] = $class; } } elseif ($GLOBALS[$class]->enabled) { $include_quotes[] = $class; } } $size = sizeof($include_quotes); for ($i=0; $i<$size; $i++) { $quotes = $GLOBALS[$include_quotes[$i]]->quote($method); if (is_array($quotes)) $quotes_array[] = $quotes; } } return $quotes_array; } //start indvship function get_shiptotal() { global $cart, $order; $this->shiptotal = ''; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_not_null($products[$i]['products_ship_price'])) { $products_ship_price = $products[$i]['products_ship_price']; $products_ship_price_two = $products[$i]['products_ship_price_two']; $products_ship_zip = $products[$i]['products_ship_zip']; $qty = $products[$i]['quantity']; if(tep_not_null($products_ship_price) ||tep_not_null($products_ship_price_two)){ $this->shiptotal += ($products_ship_price); if ($qty > 1) { if (tep_not_null($products_ship_price_two)) { $this->shiptotal += ($products_ship_price_two * ($qty-1)); } else { $this->shiptotal += ($products_ship_price * ($qty-1)); } }/////////////NOT HERE <<------------ } } }// CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN/////////////move back here <<------------ if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) { if(INDIVIDUAL_SHIP_INCREASE > '0' || $this->shiptotal > '0') { $this->shiptotal *= INDIVIDUAL_SHIP_INCREASE; } else { $this->shiptotal += INDIVIDUAL_SHIP_INCREASE * $this->get_indvcount(); } return $this->shiptotal; // not sure why this is needed, but it now works correctly for home country - by Ed } else { $this->shiptotal *= 1; return $this->shiptotal; } } function get_indvcount() { global $cart; $this->indvcount = ''; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_not_null($products[$i]['products_ship_price'])) { $products_ship_price = $products[$i]['products_ship_price'];//} $products_ship_price_two = $products[$i]['products_ship_price_two']; if(is_numeric($products_ship_price)){ $this->indvcount += '1'; } } } return $this->indvcount; } // end indvship function cheapest() { if (is_array($this->modules)) { $rates = array(); reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $quotes = $GLOBALS[$class]->quotes; for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) { if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) { $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'], 'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')', 'cost' => $quotes['methods'][$i]['cost']); } } } } $cheapest = false; for ($i=0, $n=sizeof($rates); $i<$n; $i++) { if (is_array($cheapest)) { if ($rates[$i]['cost'] < $cheapest['cost']) { $cheapest = $rates[$i]; } } else { $cheapest = $rates[$i]; } } return $cheapest; } } } ?> Any help is appreciated. LW
  6. Also having this issue. If anyone can direct me to a helpful thread, I would appreciate it. LW
  7. Found it; installed QTPro 4.6.1 (SQL bugfix for broken stock levels on multiple-attribute products) available at http://addons.oscommerce.com/info/888
  8. Very nice contribution! Need help with same issue. I see an OUT OF STOCK message for an item with a particular attribute but ordering is allowed. In Configuration, "Check Stock Level" and "Subtract stock" is set to true; "Allow checkout" is set to false. In QT Pro, "Prevent adding stock to cart" is set to true. Has this been solved and if so, can someone direct me to the post(s)? Thanks, Lisa
  9. Wonderful! I just got back to this today and had no problems following your directions. Thanks for a great and easy to use contribution!
  10. I am jumping in here! I am looking to install this contribution and had a question about inserting the "store_mode.sql" How is that done? I am going to my site control panel and phpAdmin but not sure how to 'run' this as directed in the installation text. Sorry, completely new at this but willing to learn.. Thanks!
×