Skip to content

Commit

Permalink
add description and image to detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidpeywasti committed Jun 7, 2019
1 parent 64573b7 commit 72b614b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/dca/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

$GLOBALS['TL_DCA']['tl_module']['palettes']['product_list'] = '{title_legend},name,headline,type;{catalog_legend},product_catalogs,product_categories,product_featured,product_detailModule,product_sortBy,numberOfItems,perPage,skipFirst;{template_legend},product_metaFields,customTpl;{product_legend},product_template,imgSize,product_list_Class,product_Class;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['product_detail'] = '{title_legend},name,headline,type;{catalog_legend},product_catalogs;{template_legend},product_metaFields,customTpl;{product_legend},product_template,imgSize;{related_legend},related_show,related_template,related_imgSize,product_list_Class,related_Class;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['product_detail'] = '{title_legend},name,headline,type;{catalog_legend},product_catalogs;{template_legend},product_metaFields,customTpl;{product_legend},product_template,imgSize,fullsize;{related_legend},related_show,related_template,related_imgSize,product_list_Class,related_Class;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';

/**
* Add fields to tl_module
Expand Down
10 changes: 5 additions & 5 deletions src/library/Frontend/Module/ModuleProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,9 @@ public function parseProduct($objProduct, $blnAddCategory=false, $strClass='', $
$arrProduct['size'] = $this->imgSize;
}
}

$arrProduct['singleSRC'] = $objModel->path;

$this->addImageToTemplate($objTemplate, $arrProduct, null, null, $objModel);


$arrProduct['singleSRC'] = $objModel->path;

// Link to the product detail if no image link has been defined
$picture = $objTemplate->picture;
unset($picture['title']);
Expand All @@ -178,6 +176,8 @@ public function parseProduct($objProduct, $blnAddCategory=false, $strClass='', $
$objTemplate->href = $objTemplate->link;
$objTemplate->linkTitle = \StringUtil::specialchars(sprintf($GLOBALS['TL_LANG']['MSC']['moreDetail'], $objProduct->title), true);

$this->addImageToTemplate($objTemplate, $arrProduct, null, null, $objModel);

}
}

Expand Down
10 changes: 4 additions & 6 deletions src/templates/product/product_full.html5
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,23 @@
<div class="rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span class="rateit ltr" itemprop="ratingValue" content="<?= $this->rating_value; ?>" data-rateit-value="<?= $this->rating_value; ?>" data-rateit-ispreset="true" data-rateit-readonly="true"></span>
<span class="ratingcount" itemprop="ratingCount" content="<?= $this->rating_count; ?>">(<?= $this->rating_count; ?> <?= $this->meta_vote_txt; ?>)</span>
<meta itemprop="bestRating" content="5">

<meta itemprop="bestRating" content="5">
</div>
</div>

<?php endif; ?>

<div class="column_2">
<div class="description" itemprop="description">
<?= $this->summary; ?>
<?= $this->summary; ?>
</div>
<?php if ($this->addImage): ?>
<?php $this->insert('image', $this->arrData); ?>
<?php endif; ?>
<?php endif; ?>
</div>


<?php if ($this->text): ?>
<div class="more_descripyion">
<div class="more_description">
<?= $this->text; ?>
</div>
<?php endif; ?>
Expand Down

0 comments on commit 72b614b

Please sign in to comment.