<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>
<?php use Jigoshop\Admin\Helper\Forms; /** * @var $coupon \Jigoshop\Entity\Coupon Currently displayed coupon. * @var $types array List of coupon types. * @var $paymentMethods array List of available payment methods. */ ?> <div class="jigoshop" data-id="<?php echo $coupon->getId(); ?> "> <fieldset> <?php Forms::constant(array('name' => 'jigoshop_coupon[code]', 'label' => __('Code', 'jigoshop'), 'description' => $coupon->getCode() ? '' : __('Will not appear until coupon is saved. This is the front end code for use on the Cart.', 'jigoshop'), 'value' => $coupon->getCode())); ?> </fieldset> <fieldset> <?php Forms::select(array('id' => 'jigoshop_coupon_type', 'name' => 'jigoshop_coupon[type]', 'label' => __('Type', 'jigoshop'), 'options' => $types, 'value' => $coupon->getType())); ?> <?php Forms::text(array('name' => 'jigoshop_coupon[amount]', 'label' => __('Amount', 'jigoshop'), 'type' => 'number', 'description' => __('Enter an amount e.g. 9.99.', 'jigoshop'), 'tip' => __('Amount this coupon is worth. If it is a percentage, just include the number without the percentage sign.', 'jigoshop'), 'placeholder' => \Jigoshop\Helper\Product::formatNumericPrice(0), 'value' => $coupon->getAmount())); ?> </fieldset> <fieldset> <?php Forms::daterange(array('id' => 'coupon_date', 'name' => array('from' => 'jigoshop_coupon[from]', 'to' => 'jigoshop_coupon[to]'), 'label' => __('Coupon date', 'jigoshop'), 'tip' => __('Choose between which dates this coupon is enabled. Leave empty for any date.', 'jigoshop'), 'placeholder' => __('Any date', 'jigoshop'), 'value' => array('from' => $coupon->getFrom() ? $coupon->getFrom()->format('m/d/Y') : '', 'to' => $coupon->getTo() ? $coupon->getTo()->format('m/d/Y') : ''))); ?> </fieldset>
\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>
/** * 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); } }
?> <?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>