public function displayColumn($column) { $post = $this->wp->getGlobalPost(); if ($post === null) { return; } /** @var Product | Product\Variable $product */ $product = $this->productService->find($post->ID); switch ($column) { case 'thumbnail': echo ProductHelper::getFeaturedImage($product, Options::IMAGE_THUMBNAIL); break; case 'price': echo ProductHelper::getPriceHtml($product); break; case 'featured': echo ProductHelper::isFeatured($product); break; case 'type': echo $this->type->getType($product->getType())->getName(); break; case 'sku': echo $this->getVariableAdditionalInfo($product, 'sku'); break; case 'stock': echo $this->getVariableAdditionalInfo($product, 'stock'); break; case 'creation': $timestamp = strtotime($post->post_date); echo Formatter::date($timestamp); if ($product->isVisible()) { echo '<br /><strong>' . __('Visible in', 'jigoshop') . '</strong>: '; switch ($product->getVisibility()) { case ProductEntity::VISIBILITY_SEARCH: echo __('Search only', 'jigoshop'); break; case ProductEntity::VISIBILITY_CATALOG: echo __('Catalog only', 'jigoshop'); break; case ProductEntity::VISIBILITY_PUBLIC: echo __('Catalog and search', 'jigoshop'); break; } } break; } }
$url = apply_filters('jigoshop\\cart\\product_url', get_permalink($product->getId()), $key); // TODO: Support for "Prices includes tax" $price = $showWithTax ? $item->getPrice() + $item->getTax() / $item->getQuantity() : $item->getPrice(); ?> <tr data-id="<?php echo $key; ?> " data-product="<?php echo $product->getId(); ?> "> <td class="product-thumbnail"><a href="<?php echo $url; ?> "><?php echo Product::getFeaturedImage($product, 'shop_tiny'); ?> </a></td> <td class="product-name"> <a href="<?php echo $url; ?> "><?php echo apply_filters('jigoshop\\template\\shop\\checkout\\product_title', $product->getName(), $product, $item); ?> </a> <?php echo Product::getVariation($variation, $item); ?> <?php do_action('jigoshop\\template\\shop\\checkout\\after_product_title', $product, $item);
/** * Renders images section of product page. * * @param $product \Jigoshop\Entity\Product The product to render data for. */ public function productImages($product) { $imageClasses = apply_filters('jigoshop\\product\\image_classes', array('featured-image'), $product); $featured = ProductHelper::getFeaturedImage($product, Options::IMAGE_LARGE); $featuredUrl = ProductHelper::hasFeaturedImage($product) ? $this->wp->wpGetAttachmentUrl($this->wp->getPostThumbnailId($product->getId())) : ''; $thumbnails = $this->productService->getAttachments($product, Options::IMAGE_THUMBNAIL)['gallery']; Render::output('shop/product/images', array('product' => $product, 'featured' => $featured, 'featuredUrl' => $featuredUrl, 'thumbnails' => is_array($thumbnails) ? $thumbnails : array(), 'imageClasses' => $imageClasses)); }
if ($title) { echo $before_title . $title . $after_title; } ?> <ul class="product_list_widget recently_viewed_products"> <?php foreach ($products as $product) { /** @var $product \Jigoshop\Entity\Product */ ?> <li> <a href="<?php echo $product->getLink(); ?> "> <?php echo Product::getFeaturedImage($product, Options::IMAGE_TINY); ?> <span class="js_widget_product_title"><?php echo $product->getName(); ?> </span> </a> <span class="js_widget_product_price"><?php echo Product::getPriceHtml($product); ?> </span> </li> <?php } ?> </ul>
echo $before_title . $title . $after_title; } if (!$cart->isEmpty()) { ?> <ul class="cart_list"> <?php foreach ($cart->getItems() as $item) { /** @var $item \Jigoshop\Entity\Order\Item */ ?> <li> <a href="<?php echo $item->getProduct()->getLink(); ?> "> <?php echo Product::getFeaturedImage($item->getProduct(), Options::IMAGE_TINY); ?> <span class="js_widget_product_title"><?php echo $item->getProduct()->getName(); ?> </span> </a> <?php echo Product::getItemData($item); ?> <span class="js_widget_product_price"><?php echo $item->getQuantity() . ' × ' . Product::formatPrice($item->getPrice()); ?> </span> </li> <?php
"> <?php do_action('jigoshop\\shop\\list\\product\\before_thumbnail', $product); ?> <?php if (Product::isOnSale($product)) { ?> <span class="on-sale"><?php echo apply_filters('jigoshop\\shop\\list\\product\\sale_text', __('Sale!', 'jigoshop'), $product); ?> </span> <?php } ?> <?php echo Product::getFeaturedImage($product, Options::IMAGE_SMALL); ?> </a> <a href="<?php echo $product->getLink(); ?> "> <?php do_action('jigoshop\\shop\\list\\product\\before_title', $product); ?> <strong><?php echo $product->getName(); ?> </strong> <?php do_action('jigoshop\\shop\\list\\product\\after_title', $product);
<?php foreach ($attributes as $attribute) { /** @var $attribute Attribute */ $value = $variation->getAttribute($attribute->getId()); ?> <?php Forms::select(array('name' => 'product[variation][' . $variation->getId() . '][attribute][' . $attribute->getId() . ']', 'classes' => array('variation-attribute'), 'placeholder' => $attribute->getLabel(), 'value' => $value !== null ? $value->getValue() : '', 'options' => ProductHelper::getSelectOption($attribute->getOptions(), sprintf(__('Any of %s', 'jigoshop'), $attribute->getLabel())), 'size' => 12)); ?> <?php } ?> </h4> <div class="list-group-item-text row clearfix"> <div class="col-md-2"> <?php echo Product::getFeaturedImage($product, \Jigoshop\Core\Options::IMAGE_SMALL); ?> <button class="btn btn-block btn-default set_variation_image"><?php _e('Set image', 'jigoshop'); ?> </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>