/** * 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)); }
?> <?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> <?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>