$state_name = $dbs->f("state_name");
	echo vmFormatAddress( array('name' => $db->f("first_name")." ".$db->f("last_name"),
        								'address_1' => $db->f("address_1"),
        								'address_2' => $db->f("address_2"),
        								'state' => $db->f("state"),
        								'state_name' => $state_name,
        								'zip' => $db->f("zip"),
        								'city' => $db->f("city"),
        								'country' => $db->f('country')
        							), true );
	
	echo "</td></tr>";
}

// Print out the Selected Shipping Method
if(!ps_checkout::noShippingMethodNecessary()) {

	echo '<tr><td valign="top"><strong>'.$VM_LANG->_('PHPSHOP_INFO_MSG_SHIPPING_METHOD') . ":</strong></td>";
	$rate_details = explode( "|", urldecode(urldecode(vmGet($_REQUEST,'shipping_rate_id'))) );
	echo '<td>';
	foreach( $rate_details as $k => $v ) {
		// thepisu: old sample data cointaned "&gt;" instead of ">"... 
		// so we don't have to make safe if "&gt;" is found
		if (strpos($v,"&gt;")===false) {
			$v = shopMakeHtmlSafe($v);
		}
		if( $k == 3 ) {
			echo $CURRENCY_DISPLAY->getFullValue( $v )."; ";
		} elseif( $k > 0 && $k < 4) {
			echo $v.'; ';
		}
示例#2
0
         } else {
             $discount_word = $VM_LANG->_('PHPSHOP_FEE');
         }
         $total -= $payment_discount;
         $payment_discount_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($payment_discount - $payment_discount * 2);
     }
     // COUPON DISCOUNT
     $coupon_display = '';
     if (PSHOP_COUPONS_ENABLE == '1' && @$_SESSION['coupon_redeemed'] == true) {
         $total -= $_SESSION['coupon_discount'];
         $coupon_discount_before = true;
         $coupon_display = "- " . $GLOBALS['CURRENCY_DISPLAY']->getFullValue($_SESSION['coupon_discount']);
     }
 }
 /* SHOW SHIPPING COSTS */
 if (!empty($shipping_rate_id) && !ps_checkout::noShippingMethodNecessary() && !is_null($ps_checkout->_SHIPPING)) {
     $shipping = true;
     $vars["weight"] = $weight_total;
     $shipping_total = round($ps_checkout->_SHIPPING->get_rate($vars), 5);
     $shipping_taxrate = $ps_checkout->_SHIPPING->get_tax_rate();
     // When the Shipping rate is shown including Tax
     // we have to extract the Tax from the Shipping Total
     if ($auth["show_price_including_tax"] == 1) {
         $shipping_tax = round($shipping_total - $shipping_total / (1 + $shipping_taxrate), 5);
     } else {
         $shipping_tax = round($shipping_total * $shipping_taxrate, 5);
     }
     $shipping_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($shipping_total);
 } else {
     $shipping_total = 0;
     $shipping_display = "";
示例#3
0
    /**
     * Called to validate the form values before the order is stored
     * 
     * @author gday
     * @author soeren
     * 
     * @param array $d
     * @return boolean
     */
    function validate_form(&$d)
    {
        global $VM_LANG, $PSHOP_SHIPPING_MODULES, $vmLogger;
        $db = new ps_DB();
        $auth = $_SESSION['auth'];
        $cart = $_SESSION['cart'];
        if (!$cart["idx"]) {
            $q = "SELECT order_id FROM #__{vm}_orders WHERE user_id='" . $auth["user_id"] . "' ";
            $q .= "ORDER BY cdate DESC";
            $db->query($q);
            $db->next_record();
            $d["order_id"] = $db->f("order_id");
            return False;
        }
        if (PSHOP_AGREE_TO_TOS_ONORDER == '1') {
            if (empty($d["agreed"])) {
                $vmLogger->warning($VM_LANG->_('PHPSHOP_AGREE_TO_TOS', false));
                return false;
            }
        }
        if (!ps_checkout::noShippingMethodNecessary()) {
            if (!$this->validate_shipping_method($d)) {
                return False;
            }
        }
        if (!$this->validate_payment_method($d, false)) {
            return false;
        }
        if (CHECK_STOCK == '1') {
            for ($i = 0; $i < $cart["idx"]; $i++) {
                $quantity_in_stock = ps_product::get_field($cart[$i]["product_id"], 'product_in_stock');
                $product_name = ps_product::get_field($cart[$i]["product_id"], 'product_name');
                if ($cart[$i]["quantity"] > $quantity_in_stock) {
                    $vmLogger->err('The Quantity for the Product "' . $product_name . '" in your Cart (' . $cart[$i]["quantity"] . ') exceeds the Quantity in Stock (' . $quantity_in_stock . '). 
												We are very sorry for this Inconvenience, but you you need to lower the Quantity in Cart for this Product.');
                    return false;
                }
            }
        }
        // calculate the unix timestamp for the specified expiration date
        // default the day to the 1st
        $expire_timestamp = @mktime(0, 0, 0, $_SESSION["ccdata"]["order_payment_expire_month"], 15, $_SESSION["ccdata"]["order_payment_expire_year"]);
        $_SESSION["ccdata"]["order_payment_expire"] = $expire_timestamp;
        return True;
    }
示例#4
0
 	<input type="image" name="delete" title="' . $VM_LANG->_('PHPSHOP_CART_DELETE') . '" src="' . VM_THEMEURL . 'images/remove_from_cart.png" alt="' . $VM_LANG->_('PHPSHOP_CART_DELETE') . '" align="middle" />
 </form>';
   }
   // End of for loop through the Cart
   vmRequest::setVar('zone_qty', $vars['zone_qty']);
   $total = $total_undiscounted = round($total, 5);
   $vars["total"] = $total;
   $subtotal_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($grandSubtotal);
   if (!empty($_POST["do_coupon"]) || in_array(strtolower($func), array('cartadd', 'cartupdate', 'cartdelete')) && !empty($_SESSION['coupon_redeemed'])) {
       /* process the coupon */
       require_once CLASSPATH . "ps_coupon.php";
       $vars["total"] = $total;
       ps_coupon::process_coupon_code($vars);
   }
   /* HANDLE SHIPPING COSTS */
   if (!empty($shipping_rate_id) && !ps_checkout::noShippingMethodNecessary()) {
       $shipping = true;
       $vars["weight"] = $weight_total;
       $shipping_total = round($ps_checkout->_SHIPPING->get_rate($vars), 5);
       $shipping_taxrate = $ps_checkout->_SHIPPING->get_tax_rate();
       // When the Shipping rate is shown including Tax
       // we have to extract the Tax from the Shipping Total
       if ($auth["show_price_including_tax"] == 1) {
           $shipping_tax = round($shipping_total - $shipping_total / (1 + $shipping_taxrate), 5);
       } else {
           $shipping_tax = round($shipping_total * $shipping_taxrate, 5);
       }
       $shipping_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($shipping_total);
   } else {
       $shipping_total = $shipping_taxrate = 0;
       $shipping_display = "";