diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 99b5ab612..3cb512ab4 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -1386,21 +1386,14 @@ }); if (addresses.length == 0) { - $('#addresses_err').show().html('{l s='You must add at least one address to process the order.'}'); $('#address_delivery, #address_invoice').hide(); $("#new_address").show(); - - //by webkul (if there is no address then order can not be created) - $("button[name=\"submitAddOrder\"]").attr("disabled", "disabled"); } else { $('#addresses_err').hide(); $("#new_address").hide(); $('#address_delivery, #address_invoice').show(); - - //by webkul - $("button[name=\"submitAddOrder\"]").removeAttr("disabled"); } /*Changed by webkul to make delivery and invoice addresses same*/ diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index fbca539bf..cc7cdfc34 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -271,14 +271,6 @@ abstract class PaymentModuleCore extends Module $order = new Order(); $order->product_list = $package['product_list']; - if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery') { - $address = new Address((int)$id_address); - $this->context->country = new Country((int)$address->id_country, (int)$this->context->cart->id_lang); - if (!$this->context->country->active) { - throw new PrestaShopException('The delivery address country is not active.'); - } - } - $carrier = null; if (!$this->context->cart->isVirtualCart() && isset($package['id_carrier'])) { $carrier = new Carrier((int)$package['id_carrier'], (int)$this->context->cart->id_lang); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 63a271ecd..334c2a361 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -960,39 +960,29 @@ class AdminOrdersControllerCore extends AdminController Context::getContext()->currency = new Currency((int)$cart->id_currency); Context::getContext()->customer = new Customer((int)$cart->id_customer); - $bad_delivery = false; - if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$cart->id_address_delivery)) - || !Address::isCountryActiveById((int)$cart->id_address_invoice)) { - if ($bad_delivery) { - $this->errors[] = Tools::displayError('This booking address country is not active.'); - } else { - $this->errors[] = Tools::displayError('This invoice address country is not active.'); - } - } else { - $employee = new Employee((int)Context::getContext()->cookie->id_employee); - $payment_module->validateOrder( - (int)$cart->id, - (int)$id_order_state, - $cart->getOrderTotal(true, Cart::BOTH), - $payment_module->displayName, - $this->l('Manual order -- Employee:').' '. - substr($employee->firstname, 0, 1).'. '.$employee->lastname, - array(), - null, - false, - $cart->secure_key - ); + $employee = new Employee((int)Context::getContext()->cookie->id_employee); + $payment_module->validateOrder( + (int)$cart->id, + (int)$id_order_state, + $cart->getOrderTotal(true, Cart::BOTH), + $payment_module->displayName, + $this->l('Manual order -- Employee:').' '. + substr($employee->firstname, 0, 1).'. '.$employee->lastname, + array(), + null, + false, + $cart->secure_key + ); - if (isset($this->context->cookie->id_cart)) { - unset($this->context->cookie->id_cart); - } - if (isset($this->context->cookie->id_guest)) { - unset($this->context->cookie->id_guest); - } + if (isset($this->context->cookie->id_cart)) { + unset($this->context->cookie->id_cart); + } + if (isset($this->context->cookie->id_guest)) { + unset($this->context->cookie->id_guest); + } - if ($payment_module->currentOrder) { - Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token.'&conf=3'); - } + if ($payment_module->currentOrder) { + Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token.'&conf=3'); } } else { $this->errors[] = Tools::displayError('You do not have permission to add this.');