Changeset 423
- Timestamp:
- 05/12/08 18:28:15 (2 months ago)
- Files:
-
- 2.0/trunk/app/app_controller.php (modified) (6 diffs)
- 2.0/trunk/app/config/routes.php (modified) (1 diff)
- 2.0/trunk/app/controllers/account_controller.php (added)
- 2.0/trunk/app/controllers/categories_controller.php (modified) (2 diffs)
- 2.0/trunk/app/controllers/checkout_controller.php (added)
- 2.0/trunk/app/controllers/customer_addresses_controller.php (modified) (1 diff)
- 2.0/trunk/app/controllers/customers_controller.php (modified) (1 diff)
- 2.0/trunk/app/controllers/order_items_controller.php (modified) (2 diffs)
- 2.0/trunk/app/controllers/store_controller.php (modified) (5 diffs)
- 2.0/trunk/app/controllers/users_controller.php (modified) (2 diffs)
- 2.0/trunk/app/models/brand.php (modified) (1 diff)
- 2.0/trunk/app/models/category.php (modified) (1 diff)
- 2.0/trunk/app/models/country.php (modified) (1 diff)
- 2.0/trunk/app/models/customer.php (modified) (1 diff)
- 2.0/trunk/app/models/customer_address.php (modified) (1 diff)
- 2.0/trunk/app/models/order.php (modified) (1 diff)
- 2.0/trunk/app/models/order_payment.php (modified) (1 diff)
- 2.0/trunk/app/models/order_status.php (modified) (1 diff)
- 2.0/trunk/app/models/product.php (modified) (1 diff)
- 2.0/trunk/app/models/product_image.php (modified) (1 diff)
- 2.0/trunk/app/models/product_type.php (modified) (1 diff)
- 2.0/trunk/app/models/setting.php (modified) (1 diff)
- 2.0/trunk/app/models/shipping_rate.php (modified) (1 diff)
- 2.0/trunk/app/models/user.php (modified) (1 diff)
- 2.0/trunk/app/views/account (added)
- 2.0/trunk/app/views/account/index.ctp (added)
- 2.0/trunk/app/views/checkout (added)
- 2.0/trunk/app/views/checkout/confirm.ctp (added)
- 2.0/trunk/app/views/checkout/index.ctp (added)
- 2.0/trunk/app/views/checkout/payment.ctp (added)
- 2.0/trunk/app/views/checkout/thankyou.ctp (added)
- 2.0/trunk/app/views/customer_addresses/admin_add.ctp (modified) (1 diff)
- 2.0/trunk/app/views/customer_addresses/admin_edit.ctp (modified) (1 diff)
- 2.0/trunk/app/views/customer_addresses/admin_view.ctp (modified) (1 diff)
- 2.0/trunk/app/views/elements/store_mini_cart.ctp (modified) (1 diff)
- 2.0/trunk/app/views/layouts/admin.ctp (modified) (3 diffs)
- 2.0/trunk/app/views/layouts/admin_login.ctp (modified) (2 diffs)
- 2.0/trunk/app/views/layouts/default.ctp (modified) (1 diff)
- 2.0/trunk/app/views/layouts/store.ctp (modified) (2 diffs)
- 2.0/trunk/app/views/orders/admin_add.ctp (modified) (1 diff)
- 2.0/trunk/app/views/orders/admin_edit.ctp (modified) (1 diff)
- 2.0/trunk/app/views/orders/admin_view.ctp (modified) (1 diff)
- 2.0/trunk/app/views/store/cart.ctp (modified) (2 diffs)
- 2.0/trunk/app/views/store/checkout.ctp (deleted)
- 2.0/trunk/app/views/store/flypage.ctp (modified) (1 diff)
- 2.0/trunk/app/views/store/login.ctp (modified) (1 diff)
- 2.0/trunk/app/views/store/payment.ctp (deleted)
- 2.0/trunk/app/views/store/register.ctp (modified) (1 diff)
- 2.0/trunk/app/views/users/login.ctp (modified) (1 diff)
- 2.0/trunk/app/webroot/css/admin.css (modified) (3 diffs)
- 2.0/trunk/app/webroot/css/store.css (modified) (7 diffs)
- 2.0/trunk/app/webroot/img/phpshop.icon.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
2.0/trunk/app/app_controller.php
r418 r423 28 28 29 29 var $helpers = array('Html','Javascript'); 30 //var $uses = array('Setting');31 32 /* Enabling Json handler */33 var $components = array('RequestHandler');34 function setContent() {35 $this->RequestHandler->setContent('json', 'text/x-json');36 }37 30 38 31 /** … … 43 36 function beforeFilter() { 44 37 45 // Json setup46 $this->setContent();47 48 49 38 // load configuration settings and save them globally 50 39 … … 52 41 // PS_INSTALLED needs to be defined in database.php. this is done by the installer 53 42 if (defined('PS_INSTALLED')) { 43 54 44 App::import('Model', 'Setting'); 55 45 $setting =& new Setting(); … … 59 49 Configure::write($settings); 60 50 } 61 51 62 52 // request login if admin route 63 53 if (isset($this->params[Configure::read('Routing.admin')])) { 64 $this->check Session();54 $this->checkAdminSession(); 65 55 } 66 56 } 67 57 58 /** 59 * Called before every render. 60 * 61 */ 68 62 function beforeRender() { 69 63 … … 74 68 } 75 69 76 function checkSession() 70 71 /** 72 * Validation for admin users 73 */ 74 function checkAdminSession() 77 75 { 78 76 // If the session info hasn't been set... … … 85 83 else return true; 86 84 } 85 86 87 /** 88 * Customer validation 89 */ 90 function checkSession() 91 { 92 // If the session info hasn't been set... 93 if (!$this->Session->check('Customer')) 94 { 95 // Force the user to login 96 $this->redirect('/store/login'); 97 exit(); 98 } 99 } 87 100 } 88 101 ?> 2.0/trunk/app/config/routes.php
r395 r423 43 43 * developement. 44 44 */ 45 Router::connect('/tests', array('controller' => 'tests', 'action' => 'index'));45 // Router::connect('/tests', array('controller' => 'tests', 'action' => 'index')); 46 46 47 /**48 * Adding Json parser extension49 **/50 Router::parseExtensions('json');51 47 ?> 2.0/trunk/app/controllers/categories_controller.php
r409 r423 1 1 <?php 2 /* SVN FILE: $Id :$ */2 /* SVN FILE: $Id$ */ 3 3 /** 4 4 * … … 90 90 $this->redirect(array('action'=>'index')); 91 91 } 92 93 $category = $this->Category->read(null, $id); 94 if ($category['Category']['handle'] == 'home') { 95 $this->Session->setFlash(__('Category \'home\' must not be deleted.', true)); 96 $this->redirect(array('action'=>'index')); 97 } 92 98 if ($this->Category->del($id)) { 93 99 $this->Session->setFlash(__('Category deleted', true)); 2.0/trunk/app/controllers/customer_addresses_controller.php
r414 r423 52 52 } else { 53 53 $this->Session->setFlash(__('The CustomerAddress could not be saved. Please, try again.', true)); 54 $customer_id = $this->data['CustomerAddress']['customer_id']; 54 55 } 55 56 } 57 else { 58 $customer_id = $this->passedArgs['customer_id']; 59 } 56 60 57 $customer_id = $this->passedArgs['customer_id'];58 61 $this->set('customer_id', $customer_id); 59 62 2.0/trunk/app/controllers/customers_controller.php
r416 r423 92 92 } 93 93 } 94 95 94 } 96 95 ?> 2.0/trunk/app/controllers/order_items_controller.php
r414 r423 47 47 48 48 function admin_add($order_id=null) { 49 50 49 51 if (!empty($this->data)) { 50 52 $this->OrderItem->create(); … … 54 56 } else { 55 57 $this->Session->setFlash(__('The OrderItem could not be saved. Please, try again.', true)); 58 $order_id = $this->data['OrderItem']['order_id']; 56 59 } 57 60 } 61 else { 62 $order_id = $this->passedArgs['order_id']; 63 } 64 $this->set('order_id', $order_id); 58 65 59 66 $orderShipments = $this->OrderItem->OrderShipment->find('list'); 60 $order_id = $this->passedArgs['order_id'];61 $this->set('order_id', $order_id);62 67 $productItems = $this->ProductItem->find('list'); 63 68 $this->set(compact('orderShipments', 'productItems')); 2.0/trunk/app/controllers/store_controller.php
r416 r423 55 55 'Order', 56 56 'OrderItem', 57 'OrderStatus', 57 58 'Country', 58 59 'Zone', 59 'ShippingRate' 60 'ShippingRate', 61 'Customer', 62 'CustomerAddress' 60 63 ); 61 64 … … 64 67 * 65 68 */ 66 function index( ) {69 function index($category_handle=null) { 67 70 68 71 $this->redirect(array('action' => 'browse', 'home')); … … 141 144 $this->set('products', $this->Cart->get_contents()); 142 145 $this->set('cart_total', $this->Cart->cart_total()); 146 147 // turn off minicart 148 $this->set('mini_cart', true); 143 149 144 150 // set page title 145 151 $this->pageTitle = Configure::read('Store.name') . ' - ' . __('Shopping Cart', true); 146 152 } 147 148 /** 149 * Checkout method, saves the order, order_items, and initial status. 150 * 151 */ 152 function checkout() { 153 154 /** 155 * Ajax update of state select box 156 * 157 */ 158 function update_select_state() { 159 if (!empty($this->data['Customer']['billing_country_id']) || !empty($this->data['Customer']['shipping_country_id'])) { 160 $country_id = $this->data['Customer']['billing_country_id'] ? 161 $this->data['Customer']['billing_country_id'] : 162 $this->data['Customer']['shipping_country_id']; 163 $options = $this->Zone->find("list", array("country_id='$country_id'")); 164 $this->set('options', $options); 165 } 166 } 167 168 /** 169 * RequestActionable mini_cart action 170 * 171 */ 172 function mini_cart() { 173 174 $cart = array(); 175 $cart['cart_total'] = $this->Cart->cart_total(); 176 $cart['num_items'] = $this->Cart->num_items(); 177 178 $this->set('cart', $cart); 179 180 if(isset($this->params['requested'])) { 181 return $cart; 182 } 183 } 184 185 /** 186 * Returns threaded list of categories for navigation menu 187 * 188 * @return unknown 189 */ 190 function category_menu() { 191 192 $categories = $this->Category->find('all', 193 array('fields' => array('name', 'handle', 'lft', 'rght'), 'order' => 'lft ASC', 'conditions' => 'Category.active=1')); 194 195 if(isset($this->params['requested'])) { 196 return $categories; 197 } 198 $this->set('categories', $categories); 199 } 200 201 202 /** 203 * Gather customer information and create customer record. 204 */ 205 function register() { 153 206 154 207 // set page title 155 $this->pageTitle = Configure::read('Store.name') . ' - ' . __(' Checkout', true);208 $this->pageTitle = Configure::read('Store.name') . ' - ' . __('Register', true); 156 209 157 210 if (!$this->Session->read('Cart')) { … … 160 213 } 161 214 215 // get customer information 216 $registration = $this->Session->read('Registration'); 217 218 // build drop down lists 162 219 $this->set('countries', $this->Country->find("list")); 220 $this->set('states', $this->Zone->find("list")); 163 221 $this->set('cart_items', $this->Cart->get_contents()); 164 222 $this->set('cart_total', $this->Cart->cart_total()); … … 166 224 // save order 167 225 if (!empty($this->data)) { 226 227 $customer = $this->data; 228 229 // set email and password from previos page. 230 $customer['Customer']['email']= $registration['Customer']['email']; 231 $customer['Customer']['password']= $registration['Customer']['password']; 232 233 // need to resolve text versions of country and state 234 $state = $this->Zone->read(null, $customer['Customer']['billing_state_id']); 235 $customer['Customer']['zone_id'] = $customer['Customer']['billing_state_id']; 236 $customer['Customer']['country_id'] = $customer['Customer']['billing_country_id']; 168 237 169 // save order data170 $order = $this->data;171 172 238 // If shipping is the same as billing, let's copy it. 173 if ($order['Order']['copy']) { 174 $order['Order']['shipping_company'] = $order['Order']['billing_company']; 175 $order['Order']['shipping_last_name'] = $order['Order']['billing_last_name']; 176 $order['Order']['shipping_first_name'] = $order['Order']['billing_first_name']; 177 $order['Order']['shipping_phone'] = $order['Order']['billing_phone']; 178 $order['Order']['shipping_address_1'] = $order['Order']['billing_address_1']; 179 $order['Order']['shipping_address_2'] = $order['Order']['billing_address_2']; 180 $order['Order']['shipping_city'] = $order['Order']['billing_city']; 181 $order['Order']['shipping_country_id'] = $order['Order']['billing_country_id']; 182 $order['Order']['shipping_state_id'] = $order['Order']['billing_state_id']; 183 $order['Order']['shipping_zip'] = $order['Order']['billing_zip']; 184 } 185 $order['OrderItems'] = $this->Session->read('Cart'); 186 $this->Session->write('Order', $order); 187 188 // redirect to payment page 189 $this->redirect(array('action'=>'payment'), null, true); 239 if ($customer['Customer']['copy']) { 240 $customer['CustomerShipping']['shipping_company'] = $customer['Customer']['billing_company']; 241 $customer['CustomerShipping']['shipping_last_name'] = $customer['Customer']['billing_last_name']; 242 $customer['CustomerShipping']['shipping_first_name'] = $customer['Customer']['billing_first_name']; 243 $customer['CustomerShipping']['shipping_phone'] = $customer['Customer']['billing_phone']; 244 $customer['CustomerShipping']['shipping_address_1'] = $customer['Customer']['billing_address_1']; 245 $customer['CustomerShipping']['shipping_address_2'] = $customer['Customer']['billing_address_2']; 246 $customer['CustomerShipping']['shipping_city'] = $customer['Customer']['billing_city']; 247 $customer['CustomerShipping']['zone_id'] = $customer['Customer']['billing_state_id']; 248 $customer['CustomerShipping']['country_id'] = $customer['Customer']['billing_country_id']; 249 $customer['CustomerShipping']['shipping_zip'] = $customer['Customer']['billing_zip']; 250 } 251 else { 252 $customer['CustomerShipping']['shipping_company'] = $customer['Customer']['shipping_company']; 253 $customer['CustomerShipping']['shipping_last_name'] = $customer['Customer']['shipping_last_name']; 254 $customer['CustomerShipping']['shipping_first_name'] = $customer['Customer']['shipping_first_name']; 255 $customer['CustomerShipping']['shipping_phone'] = $customer['Customer']['shipping_phone']; 256 $customer['CustomerShipping']['shipping_address_1'] = $customer['Customer']['shipping_address_1']; 257 $customer['CustomerShipping']['shipping_address_2'] = $customer['Customer']['shipping_address_2']; 258 $customer['CustomerShipping']['shipping_city'] = $customer['Customer']['shipping_city']; 259 $customer['CustomerShipping']['country_id'] = $customer['Customer']['shipping_country_id']; 260 $customer['CustomerShipping']['zone_id'] = $customer['Customer']['billing_state_id']; 261 $customer['CustomerShipping']['shipping_zip'] = $customer['Customer']['shipping_zip']; 262 } 263 264 // validate order data 265 if ($this->Customer->save($customer['Customer'])) { 266 267 $customer_id = $this->Customer->id; 268 $customer['CustomerShipping']['customer_id'] = $customer_id; 269 if ($this->CustomerAddress->save($customer['CustomerShipping'])) { 190 270 191 } 271 // Record saved, redirect to payment page. 272 $customer = $this->Customer->read(null, $customer_id); 273 274 $this->Session->write('Customer', $customer); 275 $this->redirect(array('controller'=>'checkout', 'action'=>'index'), null, true); 276 277 } 278 else { 279 $this->Session->setFlash(__('There were errors processing your data. Please see below.', true)); 280 } 281 } 282 else { 283 $this->Session->setFlash(__('There were errors processing your data. Please see below.', true)); 284 } 285 } 286 287 } 288 289 /** 290 * login function 291 * 292 */ 293 function login() { 294 295 //Don't show the error message if no data has been submitted. 296 $this->set('error', false); 192 297 193 194 } 195 196 /** 197 * Payment method, part 2 of the checkout process: user selects shipping method and selects 198 * to process payment. 199 * 200 * Import to point out that taxes are calculated based on where products are shipping to. 201 * 202 */ 203 function payment() { 204 205 if (!$this->Session->read('Cart')) { 206 $this->Session->setFlash('Your shopping cart has expired.'); 207 $this->redirect(array('action'=>'index'), null, true); 208 } 298 // If a user has submitted form data: 299 if (!empty($this->data)) 300 { 301 // check if this is a login attempt. 302 if (!empty($this->data['Customer']['login'])) { 209 303 210 // get cart info 211 $this->set('cart_items', $this->Cart->get_contents()); 212 $this->set('cart_total', $this->Cart->cart_total()); 213 214 // get order info 215 $order = $this->Session->read('Order'); 216 217 218 // TAXES 219 220 $zone_tax = $this->Tax->zone_tax_total($order['Order']['shipping_state_id'], $this->Cart->cart_total()); 221 $country_tax = $this->Tax->country_tax_total($order['Order']['shipping_country_id'], $this->Cart->cart_total()); 222 223 // calculate taxes and total 224 $cart_total = $this->Cart->cart_total(); 225 $order_total = $cart_total + $country_tax + $zone_tax; 226 227 // assign totals 228 $this->set('country_tax', $country_tax); 229 $this->set('zone_tax', $zone_tax); 230 $this->set('order_total', $order_total); 231 232 // SHIPPING 233 234 // calculate shipping. 235 $cart_weight = $this->Cart->cart_weight(); 236 // lookup shipping rates for given weight 237 $conditions = array('start' => "< $cart_weight", 'end' => ">= $cart_weight", 'country_id' => $order['Order']['shipping_country_id']); 238 $shipping_rates = $this->ShippingRate->find('all', $conditions, null, 'price ASC'); 239 //build select list 240 foreach ($shipping_rates as $shipping_rate) { 241 $rates[$shipping_rate['ShippingRate']['id']] = $shipping_rate['ShippingRate']['name'] . " - " . $shipping_rate['ShippingRate']['price']; 242 } 243 $this->set('shipping_rates', $rates); 244 245 // save order 246 if (!empty($this->data)) { 247 248 $zone = $this->Zone->findById($order['Order']['billing_state_id']); 249 $order['Order']['billing_state'] = $zone['Zone']['code']; 250 $order['Order']['billing_country'] = $zone['Country']['iso_code_2']; 251 252 $zone = $this->Zone->findById($order['Order']['shipping_state_id']); 253 $order['Order']['shipping_state'] = $zone['Zone']['code']; 254 $order['Order']['shipping_country'] = $zone['Country']['iso_code_2']; 255 256 // save tax info to Order session 257 $order['Order']['subtotal'] = $cart_total; 258 // save shipping information to Order session 259 $shipping = $this->ShippingRate->findById($this->data['Payment']['shipping_rate']); 260 $shipping_total = $shipping['ShippingRate']['price']; 261 $order['Order']['shipping'] = $shipping_total; 262 263 $order['Order']['zone_tax'] = $zone_tax; 264 $order['Order']['country_tax'] = $country_tax; 265 266 $order['Order']['total'] = $cart_total + $zone_tax + $country_tax + $shipping_total; 267 268 $this->Session->write('Order', $order); 269 270 // HOOK for payment processor plugin redirect 271 $this->redirect('/paypal'); 272 273 /* 274 $order = $this->data; 275 $order['OrderItems'] = $this->Session->read('Cart'); 276 $this->Session->write('Order', $order); 277 278 // save the order_item data 279 $this->cleanUpFields(); 280 $this->OrderItem->create(); 281 if ($this->OrderItem->save($this->data)) { 282 $this->Session->setFlash('The OrderItem has been saved'); 283 $this->redirect(array('action'=>'index'), null, true); 284 } else { 285 $this->Session->setFlash('The OrderItem could not be saved. Please, try again.'); 286 } 287 */ 288 } 289 290 291 } 292 293 /** 294 * Ajax update of state select box 295 * 296 */ 297 function update_select_state() { 298 if (!empty($this->data['Order']['billing_country_id']) || !empty($this->data['Order']['shipping_country_id'])) { 299 $country_id = $this->data['Order']['billing_country_id'] ? 300 $this->data['Order']['billing_country_id'] : 301 $this->data['Order']['shipping_country_id']; 302 $options = $this->Zone->find("list", array("country_id='$country_id'")); 303 $this->set('options', $options); 304 } 305 } 306 307 /** 308 * RequestActionable mini_cart action 309 * 310 */ 311 function mini_cart() { 312 313 $cart = array(); 314 $cart['cart_total'] = $this->Cart->cart_total(); 315 $cart['num_items'] = $this->Cart->num_items(); 316 317 $this->set('cart', $cart); 318 319 if(isset($this->params['requested'])) { 320 return $cart; 321 } 322 } 323 324 /** 325 * Returns threaded list of categories for navigation menu 326 * 327 * @return unknown 328 */ 329 function category_menu() { 330 331 $categories = $this->Category->find('all', 332 array('fields' => array('name', 'handle', 'lft', 'rght'), 'order' => 'lft ASC', 'conditions' => 'Category.active=1')); 333 334 if(isset($this->params['requested'])) { 335 return $categories; 336 } 337 $this->set('categories', $categories); 338 } 304 // First, let's see if there are any users in the database 305 // with the username supplied by the user using the form: 306 307 $someone = $this->Customer->findByEmail($this->data['Customer']['login_email']); 308 309 // At this point, $someone is full of user data, or its empty. 310 // Let's compare the form-submitted password with the one in 311 // the database. 312 313 if(!empty($someone['Customer']['password']) && 314 $someone['Customer']['password'] == $this->data['Customer']['login_password']) { 315 316 // We do not want to store password in the session. 317 unset($someone['Customer']['login_password']); 318 $this->Session->write('Customer', $someone); 319 320 // login valid 321 if ($this->Session->check('Cart')) { 322 $this->redirect(array('controller'=>'checkout', 'action' => 'index')); 323 } 324 else { 325 $this->redirect(array('controller'=>'account','action' => 'index')); 326 } 327 328 } 329 // Else, they supplied incorrect data: 330 else { 331 $this->set('error', true); 332 } 333 } 334 else { 335 // not a login attempt, redirect to registration 336 $registration = $this->data; 337 $this->Session->write('Registration', $registration); 338 $this->redirect('register'); 339 } 340 } 341 } 342 343 /** 344 * logout 345 * 346 */ 347 function logout() { 348 349 // Redirect users to this action if they click on a Logout button. 350 // All we need to do here is trash the session information: 351 352 $this->Session->delete('Customer'); 353 $this->Session->delete('Cart'); 354 $this->Session->delete('Order'); 355 356 $this->Session->setFlash('You\'ve successfully logged out.'); 357 358 // And we should probably forward them somewhere, too... 359 360 $this->redirect('/'); 361 } 362 339 363 340 364 } 2.0/trunk/app/controllers/users_controller.php
r416 r423 86 86 function login() 87 87 { 88 $this->pageTitle = "Login"; 88 89 $this->layout = 'admin_login'; 89 90 … … 124 125 // to a landing page for the application. 125 126 126 $this->redirect('/admin/ settings/');127 $this->redirect('/admin/orders/'); 127 128 } 128 129 // Else, they supplied incorrect data: 2.0/trunk/app/models/brand.php
r409 r423 28 28 29 29 var $name = 'Brand'; 30 31 var $validate = array( 32 'name' => VALID_NOT_EMPTY, 33 'handle' => VALID_NOT_EMPTY, 34 ); 30 35 31 36 //The Associations below have been created with all possible keys, those that are not needed can be removed 2.0/trunk/app/models/category.php
r414 r423 31 31 32 32 var $validate = array( 33 'handle' => array( 34 VALID_NOT_EMPTY 35 ), 36 'name' => array( 37 VALID_NOT_EMPTY 38 ), 39 'active' => array( 40 VALID_NOT_EMPTY 41 ) 33 'handle' => VALID_NOT_EMPTY, 34 'name' => VALID_NOT_EMPTY, 35 'active' => VALID_NOT_EMPTY, 42 36 ); 43 37 2.0/trunk/app/models/country.php
r416 r423 29 29 var $name = 'Country'; 30 30 var $validate = array( 31 'name' => array( 32 VALID_NOT_EMPTY 33 ), 34 'iso_code_2' => array( 35 VALID_NOT_EMPTY 36 ), 37 'active' => array( 38 VALID_NOT_EMPTY 39 ) 31 'name' => VALID_NOT_EMPTY, 32 'iso_code_2' => VALID_NOT_EMPTY, 33 array( 34 'rule' => array('maxLength', 2) 35 ), 36 'iso_code_3' => VALID_NOT_EMPTY, 37 array( 38 'rule' => array('maxLength', 3) 39 ), 40 'active' => VALID_NOT_EMPTY, 40 41 ); 41 42 2.0/trunk/app/models/customer.php
r416 r423 41 41 'required' => true 42 42 ), 43 'billing_last_name' => array( 44 'rule' => 'alphaNumeric' 45 ), 46 'billing_first_name' => array( 47 'rule' => 'alphaNumeric' 48 ), 49 'billing_phone' => array( 50 'rule' => 'alphaNumeric' 51 ), 52 'billing_address_1' => array( 53 'rule' => 'alphaNumeric' 54 ), 55 'billing_city' => array( 56 'rule' => 'alphaNumeric' 57 ), 58 'zone_id' => array('_extract'), 59 'country_id' => array('_extract'), 60 'billing_zip' => array( 61 'rule' => array('postal', null, 'us') 62 ) 43 'billing_last_name' => VALID_NOT_EMPTY, 44 'billing_first_name' => VALID_NOT_EMPTY, 45 'billing_phone' => VALID_NOT_EMPTY, 46 'billing_address_1' => VALID_NOT_EMPTY,
