/** * Adds variable options to attribute field. * * @param Attribute|Attribute\Variable $attribute Attribute. */ public function addVariableAttributeOptions(Attribute $attribute) { if ($attribute instanceof Attribute\Variable) { /** @var $attribute Attribute|Attribute\Variable */ Forms::checkbox(array('name' => 'product[attributes][' . $attribute->getId() . '][is_variable]', 'id' => 'product_attributes_' . $attribute->getId() . '_variable', 'classes' => array('attribute-options'), 'label' => __('Is for variations?', 'jigoshop'), 'checked' => $attribute->isVariable(), 'size' => 6)); } }
/** * 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); } }
<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>
<?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>
<div class="tooltip-inline-input"> <textarea rows="<?php echo $rows; ?> " id="<?php echo $id; ?> " name="<?php echo $name; ?> " class="form-control <?php echo join(' ', $classes); ?> "<?php echo Forms::disabled($disabled); ?> ><?php echo $value; ?> </textarea> <?php if (!empty($description)) { ?> <span class="help-block"><?php echo $description; ?> </span> <?php } ?>
public function display() { Forms::text($this->getArgs()); }
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Entity\Product; /** * @var $product Product The product. */ ?> <fieldset> <?php Forms::text(array('name' => 'product[url]', 'label' => __('File path', 'jigoshop'), 'classes' => array('product-downloadable'), 'placeholder' => __('Enter file URL...', 'jigoshop'), 'value' => $product instanceof Product\Downloadable ? $product->getUrl() : '')); ?> <?php Forms::text(array('name' => 'product[limit]', 'type' => 'number', 'label' => __('Downloads limit', 'jigoshop'), 'description' => __('Leave empty for unlimited downloads.', 'jigoshop'), 'classes' => array('product-downloadable'), 'placeholder' => 0, 'value' => $product instanceof Product\Downloadable ? $product->getLimit() : '')); ?> </fieldset> <?php do_action('jigoshop\\product\\tabs\\downloads', $product);
Render::output('admin/product_attributes/option', array('id' => $id, 'option_id' => $option->getId(), 'option' => $option)); ?> <?php } ?> </tbody> <tfoot> <tr> <td> <?php Forms::text(array('name' => 'option_label', 'classes' => array('new-option-label'), 'placeholder' => __('New option label', 'jigoshop'))); ?> </td> <td> <?php Forms::text(array('name' => 'option_value', 'classes' => array('new-option-value'), 'placeholder' => __('New option value', 'jigoshop'))); ?> </td> <td> <button type="button" class="btn btn-default add-option"><span class="glyphicon glyphicon-plus"></span> <?php _e('Add', 'jigoshop'); ?> </button> </td> </tr> </tfoot> </table> </div> </td> </tr> <?php
<?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);
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Core\Options; /** * @var $class array Class to display */ ?> <tr> <td> <?php Forms::text(array('id' => 'tax_class_label_' . $class['class'], 'name' => Options::NAME . '[classes][label][]', 'value' => $class['label'], 'placeholder' => __('Tax class label', 'jigoshop'))); ?> </td> <td> <?php Forms::text(array('id' => 'tax_class_' . $class['class'], 'name' => Options::NAME . '[classes][class][]', 'value' => $class['class'], 'placeholder' => __('Tax class', 'jigoshop'))); ?> </td> <td class="vert-align"> <button type="button" class="remove-tax-class btn btn-default" title="<?php _e('Remove', 'jigoshop'); ?> "><span class="glyphicon glyphicon-remove"></span></button> </td> </tr>
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);
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Entity\Product; /** * @var $product Product The product. * @var $parent Product\Variable Parent of current variation.. * @var $variation Product\Variable\Variation The variation. */ ?> <fieldset class="product-downloadable<?php echo $product instanceof Product\Downloadable ? '' : ' not-active'; ?> "> <?php Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][url]', 'label' => __('File path', 'jigoshop'), 'classes' => array('product-downloadable', $product instanceof Product\Downloadable ? '' : 'not-active'), 'placeholder' => __('Enter file URL...', 'jigoshop'), 'size' => 11, 'value' => $product instanceof Product\Downloadable ? $product->getUrl() : '')); ?> <?php Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][limit]', 'type' => 'number', 'label' => __('Downloads limit', 'jigoshop'), 'description' => __('Leave empty for unlimited downloads.', 'jigoshop'), 'classes' => array('product-downloadable', $product instanceof Product\Downloadable ? '' : 'not-active'), 'placeholder' => 0, 'size' => 11, 'value' => $product instanceof Product\Downloadable ? $product->getLimit() : '')); ?> </fieldset>
<?php use Jigoshop\Admin\Helper\Forms; /** * @var $option \Jigoshop\Entity\Product\Attribute\Option Option to display. * @var $id int ID of the attribute. * @var $option_id int ID of the option. */ ?> <tr data-id="<?php echo $option_id; ?> "> <td> <?php Forms::text(array('name' => 'attributes[' . $id . '][options][' . $option_id . '][label]', 'classes' => array('option-label'), 'value' => $option->getLabel())); ?> </td> <td> <?php Forms::text(array('name' => 'attributes[' . $id . '][options][' . $option_id . '][value]', 'classes' => array('option-value'), 'value' => $option->getValue())); ?> </td> <td> <button type="button" class="remove-attribute-option btn btn-default" title="<?php _e('Remove', 'jigoshop'); ?> "><span class="glyphicon glyphicon-remove"></span></button> </td> </tr>
\Jigoshop\Helper\Render::output('admin/order/item/' . $item->getType(), array('order' => $order, 'item' => $item)); ?> <?php } ?> </tbody> <tfoot> <tr> <td colspan="3"><?php Forms::text(array('name' => 'new_item', 'id' => 'new-item', 'placeholder' => __('Search for products...', 'jigoshop'))); ?> </td> <td><button class="btn btn-primary" id="add-item"><?php _e('Add item', 'jigoshop'); ?> </button></td> <td class="text-right"><strong><?php _e('Product subtotal:', 'jigoshop'); ?> </strong></td> <td id="product-subtotal"><?php Forms::constant(array('name' => 'order[subtotal]', 'value' => Product::formatPrice($order->getProductSubtotal()))); ?> </td> <td></td> </tr> </tfoot> </table> </div> </div>
* @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)); ?> <?php } ?> </ul>
</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'))); ?> </fieldset> <?php do_action('jigoshop\\admin\\variation', $variation, $product); ?> </div> </div> </li>
</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>
* * @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 } ?> </ul> </div> </div> <?php Forms::constant(array('name' => 'order[subtotal]', 'id' => 'subtotal', 'label' => __('Subtotal', 'jigoshop'), 'placeholder' => 0.0, 'size' => 12, 'value' => Product::formatPrice($order->getSubtotal()))); ?> <?php Forms::text(array('name' => 'order[discount]', 'label' => sprintf(__('Discount (%s)', 'jigoshop'), Currency::symbol()), 'placeholder' => 0.0, 'value' => $order->getDiscount())); ?> <?php foreach ($tax as $class => $option) { ?> <?php Forms::constant(array('name' => 'order[tax][' . $class . ']', 'label' => $option['label'], 'placeholder' => 0.0, 'value' => $option['value'], 'size' => 12, 'classes' => array($orderTax[$class] > 0 ? '' : 'not-active'))); ?> <?php } ?> <?php Forms::constant(array('name' => 'order[total]', 'id' => 'total', 'label' => __('Total', 'jigoshop'), 'placeholder' => 0.0, 'size' => 12, 'value' => Product::formatPrice($order->getTotal()))); ?> <?php do_action('jigoshop\\admin\\order\\totalsBox\\after_total', $order); ?> </div> </div>
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Entity\Product; /** * @var $product Product The product. * @var $parent Product\Variable Parent of current variation.. * @var $variation Product\Variable\Variation The variation. */ ?> <fieldset class="product-external<?php echo $product instanceof Product\External ? '' : ' not-active'; ?> "> <?php Forms::text(array('name' => 'product[variation][' . $variation->getId() . '][product][url]', 'label' => __('Product URL', 'jigoshop'), 'classes' => array('product-external', $product instanceof Product\External ? '' : 'not-active'), 'placeholder' => __('Enter external product URL...', 'jigoshop'), 'size' => 11, 'value' => $product instanceof Product\External ? $product->getUrl() : '')); ?> </fieldset>
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'] . ']'; ?> " value="<?php echo $rule['id']; ?> " /> <button type="button" class="remove-tax-rule btn btn-default" title="<?php _e('Remove', 'jigoshop'); ?> "><span class="glyphicon glyphicon-remove"></span></button> </td>
/** @var Product\Saleable $product */ $enabled = $product->getSales()->isEnabled(); $price = $product->getSales()->getPrice(); if ($product->getSales()->getFrom()->getTimestamp() < time() && $product->getSales()->getTo()->getTimestamp() < time()) { $product->getSales()->getFrom()->setTimestamp(time()); $product->getSales()->getTo()->setTimestamp(time()); } $from = $product->getSales()->getFrom()->format('m/d/Y'); $to = $product->getSales()->getTo()->format('m/d/Y'); } ?> <fieldset> <?php Forms::checkbox(array('name' => 'product[sales_enabled]', 'id' => 'sales-enabled', 'label' => __('Put product on sale?', 'jigoshop'), 'checked' => $enabled)); ?> </fieldset> <fieldset class="schedule" style="<?php !$enabled and print 'display: none;'; ?> "> <h3><?php _e('Schedule', 'jigoshop'); ?> </h3> <?php Forms::text(array('name' => 'product[sales_price]', 'label' => __('Sale price', 'jigoshop'), 'value' => $price, 'placeholder' => __('15% or 19.99', 'jigoshop'))); Forms::daterange(array('id' => 'product_sales_date', 'name' => array('from' => 'product[sales_from]', 'to' => 'product[sales_to]'), 'id' => 'sales-range', 'label' => __('Sale date', 'jigoshop'), 'value' => array('from' => $from, 'to' => $to))); ?> </fieldset> <?php do_action('jigoshop\\product\\tabs\\sales', $product);
* @var $depth int Current category depth. * @var $value string Current category value. * @var $name string Category name. * @var $selected string Currently selected item. * @var $show_count bool Whether to show count of products in the category. * @var $count int Count of items in category. */ ?> <option class="level-<?php echo $depth; ?> " value="<?php echo $value; ?> " <?php echo Forms::selected($value, $selected); ?> > <?php echo str_repeat(' ', $depth * 3) . $name; ?> <?php if ($show_count) { ?> (<?php echo $count; ?> ) <?php } ?>
"><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>
<div class="tab-pane" id="billing-address"> <?php foreach ($billingFields as $field) { ?> <?php Forms::field($field['type'], $field); ?> <?php } ?> </div> <?php if (!$billingOnly) { ?> <div class="tab-pane" id="shipping-address"> <?php foreach ($shippingFields as $field) { ?> <?php Forms::field($field['type'], $field); ?> <?php } ?> </div> <?php } ?> </div> </div>
echo $count_name; ?> " type="checkbox" value="on" <?php echo Forms::checked($count, true); ?> /> <?php _e('Show product counts', 'jigoshop'); ?> </label> <br/> <label for="<?php echo $hierarchical_id; ?> "> <input class="checkbox" id="<?php echo $hierarchical_id; ?> " name="<?php echo $hierarchical_name; ?> " type="checkbox" value="on" <?php echo Forms::checked($hierarchical, true); ?> /> <?php _e('Show hierarchy', 'jigoshop'); ?> </label> </p>
<?php use Jigoshop\Admin\Helper\Forms; use Jigoshop\Entity\Product; /** * @var $product Product The product. */ ?> <fieldset class="<?php echo $product instanceof Product\External ? '' : 'not-active'; ?> "> <?php Forms::text(array('name' => 'product[external_url]', 'label' => __('Product URL', 'jigoshop'), 'classes' => array('product-external'), 'placeholder' => __('Enter external product URL...', 'jigoshop'), 'value' => $product instanceof Product\External ? $product->getUrl() : '')); ?> </fieldset>
<td class="id"><?php Forms::constant(array('name' => 'order[items][' . $id . '][id]', 'value' => $item->getProduct()->getId())); ?> </td> <td class="sku"><?php Forms::constant(array('name' => 'order[items][' . $id . '][sku]', 'value' => $item->getProduct()->getSku())); ?> </td> <td class="name"><?php Forms::constant(array('name' => 'order[items][' . $id . '][name]', 'value' => apply_filters('jigoshop\\template\\admin\\order\\item_title', $item->getName(), $item->getProduct(), $item))); ?> </td> <td class="price"><?php Forms::text(array('name' => 'order[items][' . $id . '][price]', 'value' => Product::formatNumericPrice($item->getPrice()))); ?> </td> <td class="quantity"><?php Forms::text(array('name' => 'quantity[' . $id . ']', 'value' => $item->getQuantity())); ?> </td> <td class="total"><?php Forms::constant(array('name' => 'order[items][' . $id . '][total]', 'value' => Product::formatPrice($item->getCost()))); ?> </td> <td class="actions"> <a href="" class="close remove"><span aria-hidden="true">×</span><span class="sr-only"><?php _e('Remove', 'jigoshop'); ?> </span></a> </td> </tr>
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);