/** @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);
<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 Forms::checkbox(array('name' => 'jigoshop_coupon[free_shipping]', 'label' => __('Free shipping', 'jigoshop'), 'description' => __('Show the Free Shipping method on the Checkout with this enabled.', 'jigoshop'), 'checked' => $coupon->isFreeShipping())); ?> </fieldset> <fieldset> <?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>