Skip to content

Commit

Permalink
add vote
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidpeywasti committed Jun 7, 2019
1 parent 09ec255 commit 3e5bbb4
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
1 change: 1 addition & 0 deletions src/languages/en/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
$GLOBALS['TL_LANG']['MSC']['brand_text'] = 'Brand';
$GLOBALS['TL_LANG']['MSC']['sku_text'] = 'SKU';
$GLOBALS['TL_LANG']['MSC']['status_text'] = 'Status';
$GLOBALS['TL_LANG']['MSC']['vote_text'] = 'vote';

$GLOBALS['TL_LANG']['MSC']['relateds_headline'] = 'Related products';
3 changes: 3 additions & 0 deletions src/languages/fa/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@
$GLOBALS['TL_LANG']['MSC']['PreSale'] = 'پیش فروش';
$GLOBALS['TL_LANG']['MSC']['SoldOut'] = 'تمام';

$GLOBALS['TL_LANG']['MSC']['vote_text'] = 'رای';


2 changes: 2 additions & 0 deletions src/library/Frontend/Module/ModuleProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public function parseProduct($objProduct, $blnAddCategory=false, $strClass='', $
$objTemplate->meta_sku_txt = $GLOBALS['TL_LANG']['MSC']['sku_text'];
$objTemplate->meta_status_txt = $GLOBALS['TL_LANG']['MSC']['status_text'];

$objTemplate->meta_vote_txt = $GLOBALS['TL_LANG']['MSC']['vote_text'];

$objTemplate->hasMetaFields = !empty($arrMeta);
$objTemplate->timestamp = $objProduct->date;
$objTemplate->datetime = date('Y-m-d\TH:i:sP', $objProduct->date);
Expand Down
93 changes: 45 additions & 48 deletions src/templates/product/product_full.html5
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,59 @@
<?php if ($this->hasMetaFields): ?>

<div class="meta">
<div class="info">
<div class="info">

<time datetime="<?= $this->datetime; ?>"><?= $this->date; ?></time>
<?php if($this->meta_brand): ?>
<span class="brand"><?= $this->meta_brand_txt; ?>: <span itemprop="brand"><?= $this->meta_brand; ?></span></span>
<?php endif; ?>
<?php if($this->meta_model): ?>
<span class="model"><?= $this->meta_model_txt; ?>: <span><?= $this->meta_model; ?></span></span>
<?php endif; ?>
<?php if($this->meta_sku): ?>
<span class="sku"><?= $this->meta_sku_txt; ?>: <span itemprop="sku"><?= $this->meta_sku; ?></span></span>
<?php endif; ?>
<?php if($this->meta_global_ID): ?>
<span class="global_ID"><?= $this->meta_global_ID_txt; ?>: <span itemprop="<?= $this->meta_global_ID[unit]; ?>"><?= $this->meta_global_ID[value]; ?></span></span>
<?php endif; ?>
</div>
<time datetime="<?= $this->datetime; ?>"><?= $this->date; ?></time>
<?php if($this->meta_brand): ?>
<span class="brand"><?= $this->meta_brand_txt; ?>: <span itemprop="brand"><?= $this->meta_brand; ?></span></span>
<?php endif; ?>
<?php if($this->meta_model): ?>
<span class="model"><?= $this->meta_model_txt; ?>: <span><?= $this->meta_model; ?></span></span>
<?php endif; ?>
<?php if($this->meta_sku): ?>
<span class="sku"><?= $this->meta_sku_txt; ?>: <span itemprop="sku"><?= $this->meta_sku; ?></span></span>
<?php endif; ?>
<?php if($this->meta_global_ID): ?>
<span class="global_ID"><?= $this->meta_global_ID_txt; ?>: <span itemprop="<?= $this->meta_global_ID[unit]; ?>"><?= $this->meta_global_ID[value]; ?></span></span>
<?php endif; ?>
</div>

<div class="offers" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php if($this->meta_price): ?>
<?= $this->meta_price_txt; ?>:
<span itemprop="price" content="<?= $this->meta_price[value]; ?>"><?= number_format($this->meta_price[value]); ?></span>
<span itemprop="priceCurrency" content="<?= $this->meta_price[unit]; ?>"><?= $this->meta_price[symbol]; ?></span>
<?php endif; ?>
<?php if($this->meta_availability): ?>
<span class="availability"> (<link itemprop="availability" href="http://schema.org/<?= $this->meta_availability; ?>"><?= $this->meta_availability_txt; ?>) </span>
<?php endif; ?>
<?php if($this->meta_buy): ?>
<span class="buy">
<a itemprop="url" href="<?= $this->url ?>" class="hyperlink_txt" title="<?= $this->linkTitle ?>" <?php if($this->target): ?> target="_blank" rel="nofollow" <?php endif; ?> >
<?php if($this->titleText): ?>
<?= $this->titleText ?>
<?php else: ?>
<?= $this->url ?>
<?php endif; ?>
</a>
</span>
<?php endif; ?>
</div>
<div class="offers" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php if($this->meta_price): ?>
<?= $this->meta_price_txt; ?>:
<span itemprop="price" content="<?= $this->meta_price[value]; ?>"><?= number_format($this->meta_price[value]); ?></span>
<span itemprop="priceCurrency" content="<?= $this->meta_price[unit]; ?>"><?= $this->meta_price[symbol]; ?></span>
<?php endif; ?>
<?php if($this->meta_availability): ?>
<span class="availability"> (<link itemprop="availability" href="http://schema.org/<?= $this->meta_availability; ?>"><?= $this->meta_availability_txt; ?>) </span>
<?php endif; ?>
<?php if($this->meta_buy): ?>
<span class="buy">
<a itemprop="url" href="<?= $this->url ?>" class="hyperlink_txt" title="<?= $this->linkTitle ?>" <?php if($this->target): ?> target="_blank" rel="nofollow" <?php endif; ?> >
<?php if($this->titleText): ?>
<?= $this->titleText ?>
<?php else: ?>
<?= $this->url ?>
<?php endif; ?>
</a>
</span>
<?php endif; ?>
</div>

<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>
<meta itemprop="bestRating" content="5">
<meta itemprop="ratingCount" content="<?= $this->rating_count; ?>">
</div>
<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">

</div>
</div>

<?php endif; ?>

<?php if($this->url): ?>

<?php endif; ?>

<?php if ($this->text): ?>
<div itemprop="description">
<?= $this->text; ?>
</div>
<div itemprop="description">
<?= $this->text; ?>
</div>
<?php endif; ?>

<?php if ($this->enclosure): ?>
Expand Down

0 comments on commit 3e5bbb4

Please sign in to comment.