yf_shop__order_validate_delivery user module| File | plugins/shop/modules/shop/yf_shop__order_validate_delivery.class.php |
|---|---|
| Use | module('shop__order_validate_delivery'), URL ?object=shop__order_validate_delivery |
| Property | Default | Description |
|---|---|---|
| None declared in this class. | ||
None without a leading underscore.
_ hooks and helpers; not routable as page actionspublic function _order_validate_delivery()
Order validation.
public function _order_validate_delivery()
{
$_POST['exp_date'] = ($_POST['exp_date_mm'] ?? null) . ($_POST['exp_date_yy'] ?? null);
$force_ship_type = module('shop')->FORCE_GROUP_SHIP[module('shop')->USER_GROUP];
if ($force_ship_type) {
$_POST['ship_type'] = $force_ship_type;
}
if ( ! strlen(($_POST['ship_type'] ?? '')) || ! isset(module('shop')->_ship_types[$_POST['ship_type']])) {
_re('Shipping type required');
}
foreach ((array) module('shop')->_b_fields as $_field) {
if ( ! strlen(($_POST[$_field] ?? '')) && in_array($_field, module('shop')->_required_fields)) {
_re(t(str_replace('b_', 'Billing ', $_field)) . ' ' . t('is required'));
}
}
if (($_POST['email'] ?? null) != '' && ! common()->email_verify(($_POST['email'] ?? null))) {
_re('email not valid.');
}
}