public function displayColumn($column) { $post = $this->wp->getGlobalPost(); if ($post === null) { return; } /** @var \Jigoshop\Entity\Coupon $coupon */ $coupon = $this->couponService->find($post->ID); switch ($column) { case 'code': echo $coupon->getCode(); break; case 'type': echo $this->couponService->getType($coupon); break; case 'amount': echo ProductHelper::formatNumericPrice($coupon->getAmount()); break; case 'usage_limit': echo $coupon->getUsageLimit(); break; case 'usage': echo $coupon->getUsage(); break; case 'from': $from = $coupon->getFrom(); if ($from) { echo Formatter::date($from->getTimestamp()); } break; case 'to': $to = $coupon->getTo(); if ($to) { echo Formatter::date($to->getTimestamp()); } break; case 'is_individual': echo sprintf('<span class="glyphicon %s" aria-hidden="true"></span> <span class="sr-only">%s</span>', $coupon->isIndividualUse() ? 'glyphicon-ok' : 'glyphicon-remove', $coupon->isIndividualUse() ? __('Yes', 'jigoshop') : __('No', 'jigoshop')); break; } }
?> "> <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>
?> <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> <fieldset> <?php Forms::text(array('name' => 'jigoshop_coupon[usage_limit]', 'label' => __('Usage limit', 'jigoshop'), 'type' => 'number', 'description' => sprintf(__('Times used: %s', 'jigoshop'), $coupon->getUsage()), 'tip' => __('Control how many times this coupon may be used.', 'jigoshop'), 'placeholder' => 0, 'value' => $coupon->getUsageLimit())); ?> <?php Forms::checkbox(array('name' => 'jigoshop_coupon[individual_use]', 'label' => __('Individual use', 'jigoshop'), 'description' => __('Prevent other coupons from being used while this one is applied to the Cart.', 'jigoshop'), 'checked' => $coupon->isIndividualUse())); ?> <?php
</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>