Skip to main content

Configuration Guide

This guide covers all configuration options available for the Order Item Image Module in your Magento 2 admin panel.

🎛️ Accessing Configuration

Step 1: Navigate to Configuration

  1. Log in to your Magento 2 admin panel
  2. Go to StoresConfiguration
  3. Scroll down to Jigar Extensions section
  4. Click on Order Item Image

Step 2: Configuration Scope

  • Default Config: Applies to all websites/stores
  • Website: Applies to specific website
  • Store View: Applies to specific store view

⚙️ General Settings

Enable Module

Path: Stores > Configuration > Jigar Extensions > Order Item Image > General Settings

SettingValueDescription
Enable ModuleYes/NoEnable or disable the entire module functionality
Debug ModeYes/NoEnable debug logging for troubleshooting

Image Settings

Path: Stores > Configuration > Jigar Extensions > Order Item Image > Image Settings

SettingValueDescription
Default Image SizeSmall (100px) / Medium (200px) / Large (300px)Default size for product images
Image Quality60% / 70% / 80% / 90% / 100%JPEG quality for generated images
Image FormatJPEG / PNG / WebPOutput format for images
Fallback ImageCustom pathDefault image when product image is missing

Example Configuration

// Example configuration values
'image_size' => 'medium',
'image_quality' => 80,
'image_format' => 'jpeg',
'fallback_image' => 'catalog/product/placeholder/default.jpg'

📧 Email Configuration

Order Confirmation Emails

Path: Stores > Configuration > Jigar Extensions > Order Item Image > Email Settings

SettingValueDescription
Enable for Order EmailsYes/NoShow product images in order confirmation emails
Email Image SizeSmall / Medium / LargeSpecific size for email images
Email Image PositionBefore Product Name / After Product NamePosition of image in email template
Include Product SKUYes/NoShow product SKU alongside image

Email Template Customization

<!-- Example email template modification -->
<tr>
<td class="product-image">
{{block class="Jigar\OrderItemImage\Block\Email\ProductImage"
product_id="{{var item.product_id}}"
size="medium"}}
</td>
<td class="product-name">{{var item.name}}</td>
</tr>

📄 Document Configuration

Invoice PDFs

Path: Stores > Configuration > Jigar Extensions > Order Item Image > Document Settings

SettingValueDescription
Enable for InvoicesYes/NoInclude product images in invoice PDFs
Invoice Image SizeSmall / Medium / LargeSize for invoice images
Invoice Image PositionLeft / Right / Above / BelowPosition relative to product details
Include Product OptionsYes/NoShow product options with image

Packing Slips

SettingValueDescription
Enable for Packing SlipsYes/NoInclude product images in packing slips
Packing Slip Image SizeSmall / Medium / LargeSize for packing slip images
Show Product DimensionsYes/NoInclude product dimensions with image

Credit Memos

SettingValueDescription
Enable for Credit MemosYes/NoInclude product images in credit memos
Credit Memo Image SizeSmall / Medium / LargeSize for credit memo images

🛒 Admin Interface Configuration

Order Grid

Path: Stores > Configuration > Jigar Extensions > Order Item Image > Admin Settings

SettingValueDescription
Enable in Order GridYes/NoShow product thumbnails in order grid
Grid Image SizeSmall (50px) / Medium (75px) / Large (100px)Size for grid thumbnails
Show Product CountYes/NoDisplay number of products in order
Enable Sorting by ProductYes/NoAllow sorting orders by product

Order Detail Pages

SettingValueDescription
Enable in Order DetailsYes/NoShow product images in order detail view
Detail Image SizeSmall / Medium / LargeSize for detail page images
Show Product GalleryYes/NoDisplay multiple product images
Enable Image ZoomYes/NoAllow image zoom on hover

🎨 Advanced Settings

Performance Optimization

Path: Stores > Configuration > Jigar Extensions > Order Item Image > Advanced Settings

SettingValueDescription
Enable Image CachingYes/NoCache generated images for better performance
Cache Lifetime1 hour / 6 hours / 1 day / 1 weekHow long to cache images
Lazy LoadingYes/NoLoad images only when needed
Image CompressionYes/NoCompress images to reduce file size

Custom Image Processing

SettingValueDescription
Custom Image ProcessorClass nameCustom image processing class
WatermarkYes/NoAdd watermark to images
Watermark ImageFile pathPath to watermark image
Watermark PositionTop-Left / Top-Right / Bottom-Left / Bottom-Right / CenterWatermark position

Example Advanced Configuration

// Advanced configuration example
'image_processing' => [
'cache_enabled' => true,
'cache_lifetime' => 86400, // 24 hours
'compression' => true,
'watermark' => [
'enabled' => true,
'image' => 'media/watermark/logo.png',
'position' => 'bottom-right'
]
]

🔧 Customization Options

Custom Image Sizes

You can define custom image sizes in your theme's view.xml:

<!-- app/design/frontend/YourTheme/default/etc/view.xml -->
<vars module="Jigar_OrderItemImage">
<var name="custom_image_sizes">
<var name="email_small">100</var>
<var name="email_medium">200</var>
<var name="email_large">300</var>
<var name="pdf_small">150</var>
<var name="pdf_medium">250</var>
<var name="pdf_large">350</var>
</var>
</vars>

Custom Templates

Create custom templates for different contexts:

// Custom email template block
class YourCompany\OrderItemImage\Block\Email\CustomProductImage extends \Jigar\OrderItemImage\Block\Email\ProductImage
{
public function getCustomImageUrl($productId)
{
// Custom image URL logic
return $this->getMediaUrl() . 'custom/' . $productId . '.jpg';
}
}

📊 Configuration Examples

E-commerce Store Configuration

General Settings:
Enable Module: Yes
Debug Mode: No

Image Settings:
Default Image Size: Medium
Image Quality: 80%
Image Format: JPEG
Fallback Image: catalog/product/placeholder/default.jpg

Email Settings:
Enable for Order Emails: Yes
Email Image Size: Medium
Email Image Position: Before Product Name
Include Product SKU: Yes

Document Settings:
Enable for Invoices: Yes
Invoice Image Size: Small
Enable for Packing Slips: Yes
Packing Slip Image Size: Small
Enable for Credit Memos: Yes

Admin Settings:
Enable in Order Grid: Yes
Grid Image Size: Small
Enable in Order Details: Yes
Detail Image Size: Medium

High-Performance Configuration

Advanced Settings:
Enable Image Caching: Yes
Cache Lifetime: 1 week
Lazy Loading: Yes
Image Compression: Yes
Custom Image Processor: YourCompany\OrderItemImage\Model\ImageProcessor

🚨 Troubleshooting Configuration

Common Configuration Issues

Issue 1: Images Not Showing in Emails

Problem: Product images not appearing in order emails

Solution:

  1. Check "Enable for Order Emails" setting
  2. Verify email template includes image block
  3. Clear email template cache
  4. Test with a new order

Issue 2: PDF Generation Errors

Problem: Errors when generating PDFs with images

Solution:

  1. Check "Enable for Invoices" setting
  2. Verify image paths are accessible
  3. Check file permissions
  4. Increase memory limit for PDF generation

Issue 3: Performance Issues

Problem: Slow loading due to image processing

Solution:

  1. Enable image caching
  2. Reduce image quality
  3. Use smaller image sizes
  4. Enable lazy loading

✅ Configuration Checklist

  • Module enabled in general settings
  • Image size and quality configured
  • Email settings configured
  • Document settings configured
  • Admin interface settings configured
  • Performance settings optimized
  • Custom templates created (if needed)
  • Configuration tested with sample orders

Next Steps: Learn about advanced features.