<fieldset> <?php Forms::text(array('name' => 'jigoshop_coupon[order_total_minimum]', 'label' => __('Order total minimum', 'jigoshop'), 'type' => 'number', 'description' => __('Set the required minimum subtotal for this coupon to be valid on an order.', 'jigoshop'), 'placeholder' => __('No minimum', 'jigoshop'), 'value' => $coupon->getOrderTotalMinimum())); ?> <?php Forms::text(array('name' => 'jigoshop_coupon[order_total_maximum]', 'label' => __('Order total maximum', 'jigoshop'), 'type' => 'number', 'description' => __('Set the required maximum subtotal for this coupon to be valid on an order.', 'jigoshop'), 'placeholder' => __('No maximum', 'jigoshop'), 'value' => $coupon->getOrderTotalMaximum())); ?> </fieldset> <fieldset> <?php Forms::text(array('name' => 'jigoshop_coupon[products]', 'label' => __('Include products', 'jigoshop'), 'description' => __('Control which products this coupon can apply to. If this is left blank it will have effect on all of the products.', 'jigoshop'), 'value' => join(',', $coupon->getProducts()))); ?> <?php Forms::text(array('name' => 'jigoshop_coupon[excluded_products]', 'label' => __('Excluded products', 'jigoshop'), 'description' => __('Control which products this coupon cannot be applied to.', 'jigoshop'), 'value' => join(',', $coupon->getExcludedProducts()))); ?> </fieldset> <fieldset> <?php Forms::text(array('name' => 'jigoshop_coupon[categories]', 'label' => __('Include categories', 'jigoshop'), 'description' => __('Control which categories this coupon can apply to. If this is left blank it will have effect on all of the products.', 'jigoshop'), 'value' => join(',', $coupon->getCategories()))); ?> <?php Forms::text(array('name' => 'jigoshop_coupon[excluded_categories]', 'label' => __('Excluded categories', 'jigoshop'), 'description' => __('Control which categories this coupon cannot be applied to.', 'jigoshop'), 'value' => join(',', $coupon->getExcludedCategories()))); ?> </fieldset> <fieldset> <?php Forms::select(array('name' => 'jigoshop_coupon[payment_methods]', 'label' => __('Payment methods', 'jigoshop'), 'description' => __('Control which payment methods are allowed for this coupon to be effective.', 'jigoshop'), 'multiple' => true, 'value' => $coupon->getPaymentMethods(), 'options' => $paymentMethods)); ?> </fieldset> </div>
"><span class="glyphicon glyphicon-remove"></span></button> <button type="button" class="toggle btn btn-default pull-right" title="<?php _e('Expand', 'jigoshop'); ?> "><span class="glyphicon glyphicon-collapse-down"></span></button> </h4> <div class="list-group-item-text"<?php $active == false and print ' style="display: none"'; ?> > <fieldset> <div class="col-sm-6"> <?php \Jigoshop\Admin\Helper\Forms::number(array('label' => __('User Id', 'jigoshop'), 'name' => sprintf('%s[%s][user_id]', $name, $index), 'value' => $userId, 'min' => 1000000000, 'max' => 9999999999, 'placeholder' => __('User Id', 'jigoshop'), 'classes' => array('user-id'))); ?> <div class="col-xs-12"> <a href="#" class="btn btn-default pull-right generate">Generate</a> </div> </div> <div class="col-sm-6"> <?php \Jigoshop\Admin\Helper\Forms::text(array('label' => __('Key', 'jigoshop'), 'name' => sprintf('%s[%s][key]', $name, $index), 'type' => 'text', 'value' => $key, 'placeholder' => __('Key', 'jigoshop'), 'classes' => array('key'))); ?> <?php \Jigoshop\Admin\Helper\Forms::select(array('label' => __('Permissions', 'jigoshop'), 'name' => sprintf('%s[%s][permissions]', $name, $index), 'type' => 'select', 'value' => $permissions, 'description' => __('Leave all to set all permissions.', 'jigoshop'), 'multiple' => true, 'options' => $availablePermissions)); ?> </div> </fieldset> </div> </li>
/** * Displays field according to definition. * * @param array $field Field parameters. * * @return string Field output to display. */ public function displayField(array $field) { switch ($field['type']) { case 'user_defined': // Workaround for PHP pre-5.4 echo call_user_func($field['display'], $field); break; case 'text': Forms::text($field); break; case 'number': Forms::number($field); break; case 'select': Forms::select($field); break; case 'checkbox': Forms::checkbox($field); break; case 'constant': Forms::constant($field); break; case 'textarea': Forms::textarea($field); break; default: $this->wp->doAction('jigoshop\\admin\\settings\\form_field\\' . $field['type'], $field); } }
* * @param $options mixed List of options. * @return bool */ $isHidden = function ($options) use($product) { return $options['visible'] !== true && !in_array($product->getType(), $options['visible']); }; ?> <div class="jigoshop" data-id="<?php echo $product->getId(); ?> "> <div id="messages"></div> <div class="form-horizontal"> <?php Forms::select(array('id' => 'product-type', 'name' => 'product[type]', 'label' => __('Product type', 'jigoshop'), 'options' => $types, 'value' => $product->getType(), 'size' => 10)); ?> <ul class="jigoshop_product_data nav nav-tabs" role="tablist"> <?php foreach ($menu as $id => $options) { ?> <li class="<?php echo $id; $id == $current_tab and print ' active'; $isHidden($options) and print ' not-active'; ?> "> <a href="#<?php echo $id; ?> " data-toggle="tab"><?php
<?php /** * @var $email \Jigoshop\Entity\Email Currently displayed email. * @var $emails array List of registered emails. */ ?> <div class="jigoshop" data-id="<?php echo $email->getId(); ?> "> <?php echo \Jigoshop\Admin\Helper\Forms::text(array('name' => 'jigoshop_email[subject]', 'label' => __('Subject', 'jigoshop'), 'value' => $email->getSubject())); ?> <?php echo \Jigoshop\Admin\Helper\Forms::select(array('id' => 'jigoshop_email_actions', 'name' => 'jigoshop_email[actions]', 'label' => __('Actions', 'jigoshop'), 'multiple' => true, 'placeholder' => __('Select action...', 'jigoshop'), 'options' => $emails, 'value' => $email->getActions())); ?> </div>
?> </button> <button class="btn btn-block btn-danger remove_variation_image<?php !Product::hasFeaturedImage($product) and print ' not-active'; ?> "><?php _e('Remove image', 'jigoshop'); ?> </button> </div> <div class="col-md-10"> <fieldset> <?php Forms::select(array('name' => 'product[variation][' . $variation->getId() . '][product][type]', 'classes' => array('variation-type'), 'label' => __('Type', 'jigoshop'), 'value' => $product->getType(), 'options' => $allowedSubtypes, 'size' => 11)); Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][regular_price]', 'label' => __('Price', 'jigoshop'), 'placeholder' => __('Price not announced', 'jigoshop'), 'value' => $product->getPrice(), 'size' => 11)); Forms::select(array('name' => 'product[variation][' . $variation->getId() . '][product][tax_classes]', 'label' => __('Tax classes', 'jigoshop'), 'multiple' => true, 'value' => $variation->getProduct()->getTaxClasses(), 'options' => $taxClasses, 'classes' => array($product->isTaxable() ? '' : 'not-active'), 'size' => 11)); ?> </fieldset> <fieldset> <?php Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][sku]', 'label' => __('SKU', 'jigoshop'), 'value' => $product->getSku(), 'placeholder' => $variation->getParent()->getId() . ' - ' . $variation->getId(), 'size' => 11)); Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][brand]', 'label' => __('Brand', 'jigoshop'), 'value' => $product->getBrand(), 'size' => 11)); Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][gtin]', 'label' => __('GTIN', 'jigoshop'), 'tip' => 'Global Trade Item Number', 'value' => $product->getGtin(), 'size' => 11)); Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][mpn]', 'label' => __('MPN', 'jigoshop'), 'tip' => 'Manufacturer Part Number', 'value' => $product->getMpn(), 'size' => 11)); ?> </fieldset> <fieldset> <?php Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][stock_stock]', 'label' => __('Stock', 'jigoshop'), 'value' => $product->getStock()->getStock(), 'size' => 11)); Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][sales_price]', 'label' => __('Sale price', 'jigoshop'), 'value' => $product->getSales()->getPrice(), 'placeholder' => ProductHelper::formatNumericPrice(0), 'size' => 11)); Forms::daterange(array('id' => 'product_variation_' . $variation->getId() . '_product_sales_date', 'name' => array('from' => 'product[variation][' . $variation->getId() . '][product][sales_from]', 'to' => 'product[variation][' . $variation->getId() . '][product][sales_to]'), 'label' => __('Sale date', 'jigoshop'), 'value' => array('from' => $product->getSales()->getFrom()->format('m/d/Y'), 'to' => $product->getSales()->getTo()->format('m/d/Y')), 'size' => 11, 'startDate' => $product->getSales()->getFrom()->format('m/d/Y'), 'endDate' => $product->getSales()->getTo()->format('m/d/Y')));
public function display() { Forms::select($this->getArgs()); }
Forms::select(array('id' => 'tax_rule_class_' . $rule['id'], 'name' => Options::NAME . '[rules][class][' . $rule['id'] . ']', 'value' => $rule['class'], 'options' => $classes, 'placeholder' => __('Tax class', 'jigoshop'))); ?> </td> <td> <?php Forms::checkbox(array('id' => 'tax_rule_compound_' . $rule['id'], 'name' => Options::NAME . '[rules][compound][' . $rule['id'] . ']', 'checked' => $rule['is_compound'])); ?> </td> <td> <?php Forms::text(array('id' => 'tax_rule_rate_' . $rule['id'], 'name' => Options::NAME . '[rules][rate][' . $rule['id'] . ']', 'value' => $rule['rate'], 'placeholder' => __('Tax rate', 'jigoshop'))); ?> </td> <td> <?php Forms::select(array('id' => 'tax_rule_country_' . $rule['id'], 'name' => Options::NAME . '[rules][country][' . $rule['id'] . ']', 'classes' => array('tax-rule-country'), 'value' => $rule['country'], 'options' => $countries)); ?> </td> <td> <?php Forms::text(array('id' => 'tax_rule_states_' . $rule['id'], 'name' => Options::NAME . '[rules][states][' . $rule['id'] . ']', 'classes' => array('tax-rule-states'), 'placeholder' => _x('Write the state', 'admin_taxing', 'jigoshop'), 'value' => is_array($rule['states']) ? join(',', $rule['states']) : $rule['states'])); ?> </td> <td> <?php Forms::text(array('id' => 'tax_rule_postcodes_' . $rule['id'], 'name' => Options::NAME . '[rules][postcodes][' . $rule['id'] . ']', 'classes' => array('tax-rule-postcodes'), 'value' => is_array($rule['postcodes']) ? join(',', $rule['postcodes']) : $rule['postcodes'], 'placeholder' => __('Postcodes', 'jigoshop'))); ?> </td> <td class="vert-align"> <input type="hidden" name="<?php echo Options::NAME . '[rules][id][' . $rule['id'] . ']';
?> <!-- TODO: Maybe a filter to show/hide insignificant data? --> </ul> <noscript> <div class="alert alert-danger" role="alert"><?php _e('<strong>Warning</strong> Order panel will not work properly without JavaScript.', 'jigoshop'); ?> </div> </noscript> <div class="tab-content form-horizontal"> <div class="tab-pane active" id="order"> <?php Forms::select(array('name' => 'jigoshop_order[status]', 'label' => __('Order status', 'jigoshop'), 'value' => $order->getStatus(), 'options' => Status::getStatuses())); ?> <?php Forms::select(array('name' => 'jigoshop_order[customer]', 'label' => __('Customer', 'jigoshop'), 'value' => $order->getCustomer() ? $order->getCustomer()->getId() : '', 'options' => $customers)); ?> <?php Forms::textarea(array('name' => 'post_excerpt', 'label' => __("Customer's note", 'jigoshop'), 'value' => $order->getCustomerNote())); ?> </div> <div class="tab-pane" id="billing-address"> <?php foreach ($billingFields as $field) { ?> <?php Forms::field($field['type'], $field); ?> <?php } ?>
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Helper\Render; /** * @var $product \Jigoshop\Entity\Product The product. * @var $availableAttributes array List of available attributes. * @var $attributes array List of attributes attached to current product. */ ?> <div class="form-inline"> <?php Forms::select(array('placeholder' => __('Select attribute...', 'jigoshop'), 'name' => 'new_attribute', 'id' => 'new-attribute', 'options' => $availableAttributes, 'value' => false)); ?> <button type="button" class="btn btn-default pull-right" id="add-attribute"><span class="glyphicon glyphicon-plus"></span> <?php _e('Add', 'jigoshop'); ?> </button> <?php Forms::text(array('placeholder' => __('Enter attribute name...', 'jigoshop'), 'name' => 'new_attribute_label', 'id' => 'new-attribute-label', 'value' => '', 'classes' => array('not-active'))); ?> <div class="clear"></div> </div> <ul id="product-attributes" class="list-group clearfix"> <?php foreach ($attributes as $attribute) { /** @var $attribute \Jigoshop\Entity\Product\Attribute */ ?> <?php Render::output('admin/product/box/attributes/attribute', array('attribute' => $attribute));
</tbody> <tfoot> <tr> <td> <?php Forms::text(array('name' => 'label', 'id' => 'attribute-label', 'placeholder' => __('New attribute label', 'jigoshop'))); ?> </td> <td> <?php Forms::text(array('name' => 'slug', 'id' => 'attribute-slug', 'placeholder' => __('New attribute slug', 'jigoshop'))); ?> </td> <td> <?php Forms::select(array('name' => 'type', 'id' => 'attribute-type', 'options' => $types)); ?> </td> <td> <button type="button" class="btn btn-default" id="add-attribute"><span class="glyphicon glyphicon-plus"></span> <?php _e('Add', 'jigoshop'); ?> </button> </td> </tr> </tfoot> </table> </form> </div> </div>
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Entity\Product; /** * @var $product Product The product. * @var $taxClasses array Available tax classes. */ ?> <fieldset> <?php Forms::checkbox(array('name' => 'product[is_taxable]', 'id' => 'is_taxable', 'label' => __('Is taxable?', 'jigoshop'), 'checked' => $product->isTaxable())); Forms::select(array('name' => 'product[tax_classes]', 'id' => 'tax_classes', 'label' => __('Tax classes', 'jigoshop'), 'multiple' => true, 'value' => $product->getTaxClasses(), 'options' => $taxClasses, 'classes' => array($product->isTaxable() ? '' : 'not-active'))); ?> </fieldset> <?php do_action('jigoshop\\product\\tabs\\advanced', $product);
echo $id; ?> "> <td> <?php Forms::text(array('name' => 'attributes[' . $id . '][label]', 'classes' => array('attribute-label'), 'value' => $attribute->getLabel())); ?> </td> <td> <?php Forms::text(array('name' => 'attributes[' . $id . '][slug]', 'classes' => array('attribute-slug'), 'value' => $attribute->getSlug())); ?> </td> <td> <?php Forms::select(array('name' => 'attributes[' . $id . '][type]', 'classes' => array('attribute-type'), 'value' => $attribute->getType(), 'options' => $types)); ?> </td> <td> <?php if ($attribute->getType() != Attribute\Text::TYPE) { ?> <button type="button" class="configure-attribute btn btn-default"><?php _e('Configure', 'jigoshop'); ?> </button> <?php } ?> <button type="button" class="remove-attribute btn btn-default" title="<?php _e('Remove', 'jigoshop');
<?php foreach ($attribute->getOptions() as $option) { /** @var $option Attribute\Option */ ?> <?php Forms::checkbox(array('name' => 'product[attributes][' . $attribute->getId() . '][options]', 'id' => 'product_attributes_' . $attribute->getId() . '_option_' . $option->getId(), 'classes' => array('attribute-' . $attribute->getId()), 'label' => $option->getLabel(), 'value' => apply_filters('jigoshop\\template\\admin\\product\\attribute\\multiselect\\value', $option->getId(), $attribute, $option), 'multiple' => true, 'checked' => in_array($option->getId(), $attribute->getValue()))); ?> <?php } ?> <?php break; case Attribute\Select::TYPE: ?> <div class="panel-body"><?php Forms::select(array('name' => 'product[attributes][' . $attribute->getId() . ']', 'classes' => array('attribute-' . $attribute->getId()), 'value' => apply_filters('jigoshop\\template\\admin\\product\\attribute\\select\\value', $attribute->getValue(), $attribute), 'options' => Product::getSelectOption($attribute->getOptions()), 'size' => 12)); ?> </div><?php break; case Attribute\Text::TYPE: ?> <div class="panel-body"><?php Forms::text(array('name' => 'product[attributes][' . $attribute->getId() . ']', 'classes' => array('attribute-' . $attribute->getId(), $attribute->isLocal() ? 'local' : ''), 'value' => apply_filters('jigoshop\\template\\admin\\product\\attribute\\text\\value', $attribute->getValue(), $attribute), 'size' => 12)); ?> </div><?php break; } ?> </div> </div> </li>
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Entity\Product; use Jigoshop\Entity\Product\Attributes\StockStatus; /** * @var $product Product The product. */ $stock = $product instanceof Product\Purchasable ? $product->getStock() : new StockStatus(); ?> <fieldset> <?php Forms::checkbox(array('name' => 'product[stock_manage]', 'id' => 'stock-manage', 'label' => __('Manage stock?', 'jigoshop'), 'checked' => $stock->getManage())); Forms::select(array('name' => 'product[stock_status]', 'id' => 'stock-status', 'label' => __('Status', 'jigoshop'), 'value' => $stock->getStatus(), 'options' => array(StockStatus::IN_STOCK => __('In stock', 'jigoshop'), StockStatus::OUT_STOCK => __('Out of stock', 'jigoshop')), 'classes' => array($stock->getManage() ? 'not-active' : ''))); ?> </fieldset> <fieldset class="stock-status" style="<?php !$stock->getManage() and print 'display: none;'; ?> "> <?php Forms::number(array('name' => 'product[stock_stock]', 'label' => __('Items in stock', 'jigoshop'), 'value' => $stock->getStock(), 'min' => 0)); ?> <?php Forms::select(array('name' => 'product[stock_allow_backorders]', 'label' => __('Allow backorders?', 'jigoshop'), 'value' => $stock->getAllowBackorders(), 'options' => array(StockStatus::BACKORDERS_FORBID => __('Do not allow', 'jigoshop'), StockStatus::BACKORDERS_NOTIFY => __('Allow, but notify customer', 'jigoshop'), StockStatus::BACKORDERS_ALLOW => __('Allow', 'jigoshop')))); ?> </fieldset> <?php do_action('jigoshop\\product\\tabs\\stock', $product);
use Jigoshop\Helper\Currency; use Jigoshop\Helper\Product as ProductHelper; /** * @var $product Product The product. */ ?> <fieldset> <?php Forms::text(array('name' => 'product[regular_price]', 'label' => __('Price', 'jigoshop') . ' (' . Currency::symbol() . ')', 'placeholder' => __('Price not announced', 'jigoshop'), 'classes' => array('product-simple', $product instanceof Product\Purchasable ? '' : 'not-active'), 'value' => $product instanceof Product\Purchasable ? $product->getRegularPrice() : 0)); Forms::text(array('name' => 'product[sku]', 'label' => __('SKU', 'jigoshop'), 'value' => $product->getSku(), 'placeholder' => $product->getId())); Forms::text(array('name' => 'product[brand]', 'label' => __('Brand', 'jigoshop'), 'value' => $product->getBrand())); Forms::text(array('name' => 'product[gtin]', 'label' => __('GTIN', 'jigoshop'), 'tip' => 'Global Trade Item Number', 'value' => $product->getGtin())); Forms::text(array('name' => 'product[mpn]', 'label' => __('MPN', 'jigoshop'), 'tip' => 'Manufacturer Part Number', 'value' => $product->getMpn())); ?> </fieldset> <fieldset> <?php Forms::text(array('name' => 'product[size_weight]', 'label' => __('Weight', 'jigoshop') . ' (' . ProductHelper::weightUnit() . ')', 'value' => $product->getSize()->getWeight())); Forms::text(array('name' => 'product[size_length]', 'label' => __('Length', 'jigoshop') . ' (' . ProductHelper::dimensionsUnit() . ')', 'value' => $product->getSize()->getLength())); Forms::text(array('name' => 'product[size_width]', 'label' => __('Width', 'jigoshop') . ' (' . ProductHelper::dimensionsUnit() . ')', 'value' => $product->getSize()->getWidth())); Forms::text(array('name' => 'product[size_height]', 'label' => __('Height', 'jigoshop') . ' (' . ProductHelper::dimensionsUnit() . ')', 'value' => $product->getSize()->getHeight())); ?> </fieldset> <fieldset> <?php Forms::select(array('name' => 'product[visibility]', 'label' => __('Visibility', 'jigoshop'), 'options' => array(Product::VISIBILITY_PUBLIC => __('Catalog & Search', 'jigoshop'), Product::VISIBILITY_CATALOG => __('Catalog Only', 'jigoshop'), Product::VISIBILITY_SEARCH => __('Search Only', 'jigoshop'), Product::VISIBILITY_NONE => __('Hidden', 'jigoshop')), 'value' => $product->getVisibility())); Forms::checkbox(array('name' => 'product[featured]', 'label' => __('Featured?', 'jigoshop'), 'checked' => $product->isFeatured(), 'description' => __('Enable this option to feature this product', 'jigoshop'))); ?> </fieldset> <?php do_action('jigoshop\\product\\tabs\\general', $product);