Skip to content

Commit

Permalink
Added special price and priceValidUntil to microdata (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyHoenderdaal authored Nov 14, 2023
1 parent ac2843c commit 2e47f70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resources/views/product/partials/microdata.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<div itemprop="offers" itemtype="https://schema.org/Offer" itemscope>
<meta itemprop="availability" content="https://schema.org/{{ $product->in_stock ? 'InStock' : 'OutOfStock' }}" />
<meta itemprop="priceCurrency" content="@config('currency/options/default')" />
<meta itemprop="price" content="{{ round($product->price, 2) }}" />
<meta itemprop="price" content="{{ round($product->special_price ?: $product->price, 2) }}" />
<meta itemprop="url" content="{{ url($product->url) }}" />
@if($product->special_to_date && $product->special_to_date > now()->toDateTimeString())
<meta itemprop="priceValidUntil" content="{{ $product->special_to_date }}" />
@endif
</div>

0 comments on commit 2e47f70

Please sign in to comment.