/** * Returns list of default fields for shipping section. * * @param Address $address Address to fill values for. * * @return array Default fields. */ public function getDefaultShippingFields(Address $address) { return ProductHelper::getBasicShippingFields(array('first_name' => array('value' => $address->getFirstName(), 'columnSize' => 6), 'last_name' => array('value' => $address->getLastName(), 'columnSize' => 6), 'company' => array('value' => $address instanceof CompanyAddress ? $address->getCompany() : '', 'columnSize' => 12), 'address' => array('value' => $address->getAddress(), 'columnSize' => 12), 'country' => array('options' => Country::getAllowed(), 'value' => $address->getCountry(), 'columnSize' => 6), 'state' => array('type' => Country::hasStates($address->getCountry()) ? 'select' : 'text', 'options' => Country::getStates($address->getCountry()), 'value' => $address->getState(), 'columnSize' => 6), 'city' => array('value' => $address->getCity(), 'columnSize' => 6), 'postcode' => array('value' => $address->getPostcode(), 'columnSize' => 6))); }
\Jigoshop\Helper\Forms::text(array('name' => 'address[last_name]', 'label' => __('Last name', 'jigoshop'), 'value' => $address->getLastName())); ?> <?php \Jigoshop\Helper\Forms::text(array('name' => 'address[address]', 'label' => __('Address', 'jigoshop'), 'value' => $address->getAddress())); ?> <?php \Jigoshop\Helper\Forms::text(array('name' => 'address[city]', 'label' => __('City', 'jigoshop'), 'value' => $address->getCity())); ?> <?php \Jigoshop\Helper\Forms::text(array('name' => 'address[postcode]', 'label' => __('Postcode', 'jigoshop'), 'value' => $address->getPostcode())); ?> <?php \Jigoshop\Helper\Forms::field(Country::hasStates($address->getCountry()) ? 'select' : 'text', array('name' => 'address[state]', 'label' => __('State/province', 'jigoshop'), 'value' => $address->getState(), 'options' => Country::getStates($address->getCountry()))); ?> <?php \Jigoshop\Helper\Forms::select(array('name' => 'address[country]', 'label' => __('Country', 'jigoshop'), 'value' => $address->getCountry(), 'options' => Country::getAllowed())); ?> <?php \Jigoshop\Helper\Forms::text(array('name' => 'address[phone]', 'label' => __('Phone', 'jigoshop'), 'value' => $address->getPhone())); ?> <?php \Jigoshop\Helper\Forms::text(array('name' => 'address[email]', 'label' => __('Email', 'jigoshop'), 'value' => $address->getEmail())); ?> <a href="<?php echo $myAccountUrl; ?> " class="btn btn-default"><?php _e('Go back to My account', 'jigoshop'); ?> </a> <button class="btn btn-success pull-right" name="action" value="save_address"><?php
/** * @return array List of options to display on Shipping settings page. */ public function getOptions() { return array(array('name' => sprintf('[%s][enabled]', self::NAME), 'title' => __('Is enabled?', 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->options['enabled'], 'classes' => array('switch-medium')), array('name' => sprintf('[%s][title]', self::NAME), 'title' => __('Method title', 'jigoshop'), 'type' => 'text', 'value' => $this->getTitle()), array('name' => sprintf('[%s][type]', self::NAME), 'title' => __('Type', 'jigoshop'), 'type' => 'select', 'value' => $this->options['type'], 'options' => $this->types), array('name' => sprintf('[%s][is_taxable]', self::NAME), 'title' => __('Is taxable?', 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->options['is_taxable'], 'classes' => array('switch-medium')), array('name' => sprintf('[%s][cost]', self::NAME), 'title' => __('Cost', 'jigoshop'), 'type' => 'text', 'value' => $this->options['cost']), array('name' => sprintf('[%s][fee]', self::NAME), 'title' => __('Handling fee', 'jigoshop'), 'type' => 'text', 'value' => $this->options['fee']), array('name' => sprintf('[%s][available_for]', self::NAME), 'id' => 'flat_rate_available_for', 'title' => __('Available for', 'jigoshop'), 'type' => 'select', 'value' => $this->options['available_for'], 'options' => $this->availability), array('name' => sprintf('[%s][countries]', self::NAME), 'id' => 'flat_rate_countries', 'title' => __('Select countries', 'jigoshop'), 'type' => 'select', 'value' => $this->options['countries'], 'options' => Country::getAllowed(), 'multiple' => true, 'hidden' => $this->options['available_for'] == 'all')); }
/** * @return array List of options to display on Shipping settings page. */ public function getOptions() { return array(array('name' => sprintf('[%s][enabled]', self::NAME), 'title' => __('Is enabled?', 'jigoshop'), 'type' => 'checkbox', 'checked' => $this->options['enabled'], 'classes' => array('switch-medium')), array('name' => sprintf('[%s][title]', self::NAME), 'title' => __('Method title', 'jigoshop'), 'type' => 'text', 'value' => $this->getTitle()), array('name' => sprintf('[%s][minimum]', self::NAME), 'title' => __('Minimum cart value', 'jigoshop'), 'description' => __('Minimum cart value above which the Free Shipping method should be available.', 'jigoshop'), 'type' => 'text', 'value' => $this->options['minimum']), array('name' => sprintf('[%s][available_for]', self::NAME), 'id' => 'free_shipping_available_for', 'title' => __('Available for', 'jigoshop'), 'type' => 'select', 'value' => $this->options['available_for'], 'options' => $this->availability), array('name' => sprintf('[%s][countries]', self::NAME), 'id' => 'free_shipping_countries', 'title' => __('Select countries', 'jigoshop'), 'type' => 'select', 'value' => $this->options['countries'], 'options' => Country::getAllowed(), 'multiple' => true, 'hidden' => $this->options['available_for'] == 'all')); }
</ul> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> <?php _e('Select your destination', 'jigoshop'); ?> <button class="btn btn-default pull-right close" title="<?php _e('Close', 'jigoshop'); ?> "><span class="glyphicon glyphicon-remove"></span></button> </h3> </div> <div class="panel-body"> <?php \Jigoshop\Helper\Forms::select(array('name' => 'country', 'value' => $customer->getShippingAddress()->getCountry(), 'options' => Country::getAllowed())); ?> <?php \Jigoshop\Helper\Forms::hidden(array('id' => 'state', 'name' => 'state', 'value' => $customer->getShippingAddress()->getState())); ?> <?php if ($customer->getShippingAddress()->getCountry() && Country::hasStates($customer->getShippingAddress()->getCountry())) { ?> <?php \Jigoshop\Helper\Forms::select(array('id' => 'noscript_state', 'name' => 'state', 'value' => $customer->getShippingAddress()->getState(), 'options' => Country::getStates($customer->getShippingAddress()->getCountry()))); ?> <?php } else { ?> <?php \Jigoshop\Helper\Forms::text(array('id' => 'noscript_state', 'name' => 'state', 'value' => $customer->getShippingAddress()->getState()));
public function dataBox() { $post = $this->wp->getGlobalPost(); /** @var \Jigoshop\Entity\Order $order */ $order = $this->orderService->findForPost($post); $billingOnly = $this->options->get('shipping.only_to_billing'); $address = $order->getCustomer()->getBillingAddress(); $billingFields = $this->wp->applyFilters('jigoshop\\admin\\order\\billing_fields', ProductHelper::getBasicBillingFields(array('first_name' => array('value' => $address->getFirstName()), 'last_name' => array('value' => $address->getLastName()), 'company' => array('value' => $address instanceof Customer\CompanyAddress ? $address->getCompany() : ''), 'euvatno' => array('value' => $address instanceof Customer\CompanyAddress ? $address->getVatNumber() : ''), 'address' => array('value' => $address->getAddress()), 'city' => array('value' => $address->getCity()), 'postcode' => array('value' => $address->getPostcode()), 'country' => array('value' => $address->getCountry(), 'options' => Country::getAllowed()), 'state' => array('type' => Country::hasStates($address->getCountry()) ? 'select' : 'text', 'value' => $address->getState(), 'options' => Country::getStates($address->getCountry())), 'phone' => array('value' => $address->getPhone()), 'email' => array('value' => $address->getEmail())), $order)); $address = $order->getCustomer()->getShippingAddress(); $shippingFields = $this->wp->applyFilters('jigoshop\\admin\\order\\shipping_fields', ProductHelper::getBasicShippingFields(array('first_name' => array('value' => $address->getFirstName()), 'last_name' => array('value' => $address->getLastName()), 'company' => array('value' => $address instanceof Customer\CompanyAddress ? $address->getCompany() : ''), 'address' => array('value' => $address->getAddress()), 'city' => array('value' => $address->getCity()), 'postcode' => array('value' => $address->getPostcode()), 'country' => array('value' => $address->getCountry(), 'options' => Country::getAllowed()), 'state' => array('type' => Country::hasStates($address->getCountry()) ? 'select' : 'text', 'value' => $address->getState(), 'options' => Country::getStates($address->getCountry()))), $order)); $customers = $this->customerService->findAll(); Render::output('admin/order/dataBox', array('order' => $order, 'billingFields' => $billingFields, 'shippingFields' => $shippingFields, 'customers' => $customers, 'billingOnly' => $billingOnly)); }