예제 #1
0
파일: checkout.php 프로젝트: sbeam/cshop
 } else {
     $fex->max_size = 20;
     $fex->add_element($colmap);
     if ($ACTION == OP_GET_SHIP_ADDR) {
         if (CSHOP_ALLOW_ANON_ACCOUNT and $auth->has_bypass_flag()) {
             $fex->add_element($user->get_anon_colmap());
         }
         if (!$cart->requires_shipping()) {
             // bypass shipping addr form if everything is not shippable
             $smarty->assign('skip_shipping_addr', true);
         }
         $op_new_ship = isset($_GET['op_add_ship']);
         $ship = cmClassFactory::getInstanceOf(CSHOP_CLASSES_SHIPMETHOD, $pdb);
         /* limits the country select if need be, depending on the ship method */
         if ($countrylist = $ship->get_avail_countries()) {
             $fex->set_elem_attrib('country', 'limit_to', $countrylist);
         }
         if (empty($errs) && !$op_new_ship and $shipping = $user->fetchShippingAddr()) {
             $smarty->assign('has_shipping', true);
             $fex->add_element('shipping_addr_id', array(null, 'hidden', $shipping['id']));
             // set the shipto name to the customers name if available
             if (empty($shipping['name']) and isset($userinfo['cust_name'])) {
                 $shipping['name'] = $userinfo['cust_name'];
             }
             $fex->elem_vals = $shipping;
             // set defaults for the shipping addr here
         }
         if (isset($auth->auth['first_time'])) {
             // its a new user
             $smarty->assign('is_new_user', true);
             unset($auth->auth['first_time']);