classname.".cfg.php"); if ( $_SESSION['auth']['show_price_including_tax'] != 1 ) { $taxrate = 1; $order_total = $total + $tax_total; } else { $taxrate = $this->get_tax_rate() + 1; $order_total = $total; } //Charge minimum up to this value in cart $base_ship = FLEX_BASE_AMOUNT; //Flat rate shipping charge up to minimum value $flat_charge = FLEX_MIN_CHG; //Charge this percentage if cart value is greater than base amount $ship_rate_perc = (FLEX_SHIP_PERC / 100); //Flat rate handling fee $handling_fee = FLEX_HAND_FEE; if($order_total < $base_ship) { $flat_charge += $handling_fee; $flat_charge *= $taxrate; $shipping_rate_id = urlencode($this->classname."|STD|Standard Shipping under ".$base_ship."|".$flat_charge); $html = ""; $html .= "\n\n"; $html .= ""; $_SESSION[$shipping_rate_id] = 1; } else { $shipping_temp1 = ($order_total * $ship_rate_perc); $shipping_temp1 += ( $handling_fee * $taxrate ); $shipping_rate_id = urlencode($this->classname."|STD|Standard Shipping over ".$base_ship."|".$shipping_temp1); $html = ""; $html .= "\n\n"; $html .= ""; $_SESSION[$shipping_rate_id] = 1; } echo $html; return true; } function get_rate( &$d ) { $shipping_rate_id = $d["shipping_rate_id"]; $is_arr = explode("|", urldecode(urldecode($shipping_rate_id)) ); $order_shipping = $is_arr[3]; return $order_shipping; } function get_tax_rate() { /** Read current Configuration ***/ require_once(CLASSPATH ."shipping/".$this->classname.".cfg.php"); if( intval(FLEX_TAX_CLASS)== 0 ) return( 0 ); else { require_once( CLASSPATH. "ps_tax.php" ); $tax_rate = ps_tax::get_taxrate_by_id( intval(FLEX_TAX_CLASS) ); return $tax_rate; } } /* Validate this Shipping method by checking if the SESSION contains the key * @returns boolean False when the Shipping method is not in the SESSION */ function validate( $d ) { $shipping_rate_id = $d["shipping_rate_id"]; if( array_key_exists( $shipping_rate_id, $_SESSION )) { return true; } else { return false; } } /** * Show all configuration parameters for this Shipping method * @returns boolean False when the Shipping method has no configration */ function show_configuration() { global $VM_LANG; /** Read current Configuration ***/ require_once(CLASSPATH ."shipping/".$this->classname.".cfg.php"); ?>
| Charge flat shipping rate to this amount: | |||
| Minimum Shipping Charge: | |||
| Percentage to charge if total sale is over base: | |||
| Fixed Handling Charge: | |||
| _PHPSHOP_UPS_TAX_CLASS ?> | _PHPSHOP_UPS_TAX_CLASS_TOOLTIP) ?> |