added Yasamin theme part

pull/49/head
A1Gard 1 month ago
parent a2e141bb52
commit 64c653163f

@ -0,0 +1,177 @@
<section id='ProductYasamin' >
<div class="row">
<div class="col-md-7">
<div id="yac-images">
@foreach($product->getMedia() as $media)
<div class="item">
<a href="{{$media->getUrl('product-image')}}" class="light-box"
data-gallery="yac-products">
<img src="{{$media->getUrl('product-image')}}" alt="{{$product->name}}">
</a>
</div>
@endforeach
</div>
</div>
<div class="col-md-5">
<nav aria-label="breadcrumb" class="pt-1 my-2">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{{homeUrl()}}">
{{config('app.name')}}
</a>
</li>
<li class="breadcrumb-item">
<a href="{{$product->category->webUrl()}}">
{{$product->category->name}}
</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
{{$product->name}}
</li>
</ol>
</nav>
<h1>
{{$product->name}}
</h1>
<div class="yac-product-data">
<rate-input xtitle="{{__("Rate")}}" xname="" :xvalue="{{$product->rate}}"></rate-input>
</div>
@if($product->sku != null && $product->sku != '')
<div class="yac-product-data">
<span>
{{__("SKU")}}:
</span>
<b class="float-end">
{{$product->sku}}
</b>
</div>
@endif
<div class="row text-center">
<div id="price" class="col">
{{$product->getPrice()}}
</div>
@if($product->hasDiscount())
<div id="price-old" class="col">
{{$product->oldPrice()}}
</div>
@endif
</div>
<br>
@if($product->quantities()->count()>0)
<quantities-add-to-card
:qz='@json($product->quantities)'
:props='@json(usableProp($product->category->props))'
currency="{{config('app.currency.symbol')}}"
card-link="{{ route('client.product-card-toggle',$product->slug) }}"
:translate='@json(['add-to-card' => __('Add to card')])'
@if($product->hasDiscount())
:discount='@json($product->activeDiscounts()->first())'
@endif
></quantities-add-to-card>
@else
<div class="text-center">
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-outline-primary add-to-card btn-lg">
<i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}}
</a>
</div>
@endif
<h4>
{{__("Description")}}
</h4>
<div class="p-3">
<div class="alert alert-info">
{{$product->excerpt}}
</div>
{!! $product->description !!}
@if($product->table != null || trim($product->table) != '')
{!! $product->table !!}
@endif
<table class="table table-striped table-striped">
<tr class="text-center">
<th class="w-50">
{{__("Item")}}
</th>
<th>
{{__("Value")}}
</th>
</tr>
@foreach($product->fullMeta() as $meta)
<tr>
<td>
<i class="{{$meta['data']->icon}}"></i>
&nbsp;
{{$meta['data']->label}}
</td>
<td class="text-center">
{!! $meta['human_value'] !!}
</td>
</tr>
@endforeach
</table>
@if(auth('customer')->check())
<form id="rating-form" method="post" data-url="{{route('client.rate')}}">
@csrf
<input type="hidden" name="rateable_id" value="{{$product->id}}">
<input type="hidden" name="rateable_type" value="{{\App\Models\Product::class}}">
@foreach($product->evaluations() as $e)
<rate-input xtitle="{{$e->title}}" xname="rate[{{ $e->id }}]" :xvalue="{{detectRateCustomer(\App\Models\Product::class,$product->id,$e->id)}}"></rate-input>
<hr>
@endforeach
<button class="btn btn-primary w-100">
<i class="ri-send-plane-line"></i>
</button>
</form>
@endif
</div>
@if($product->categories()->count() > 0)
<div class="yac-product-data">
<span>
{{__("Categories")}}:
</span>
@foreach($product->categories()->where('id','<>',$product->category->id)->get() as $cat)
<a href="{{$cat->webUrl()}}">
{{$cat->name}},
</a>
@endforeach
<a href="{{$product->category->webUrl()}}">
{{$product->category->name}}
</a>
</div>
@endif
@if($product->tags()->count() > 0)
<div class="yac-product-data">
<span>
{{__("Tags")}}:
</span>
@foreach($product->tags as $tag)
<a href="{{tagUrl($tag->slug)}}" class="tag me-2">
<i class="ri-price-tag-line"></i>
{{$tag->name}}
</a>
@endforeach
</div>
@endif
</div>
<div class="container-fluid">
<h3 class="mt-4">
{{__("Related products")}}
</h3>
<div id="rel-products" class="mb-2">
@foreach($product->category->products()->where('status',1)->limit(10)->get() as $p)
<div class="item">
@include(\App\Models\Area::where('name','product-grid')->first()->defPart(),['$product' => $p])
</div>
@endforeach
</div>
</div>
</div>
</section>

@ -0,0 +1,43 @@
import Lightbox from "bs5-lightbox";
import {tns} from "tiny-slider";
var YacRelativeSlider;
document.addEventListener('DOMContentLoaded',function () {
for (const el of document.querySelectorAll('.light-box')) {
el.addEventListener('click', Lightbox.initialize);
}
try {
YacRelativeSlider = tns({
container: '#rel-products',
items: 3,
autoplay: true,
autoplayButton: false,
// nextButton: false,
controls: false,
autoplayHoverPause: true,
mouseDrag: true,
gutter: 5,
slideBy: 1,
autoplayTimeout: 5000,
responsive:{
560:{
items: 1,
},
768:{
items: 2,
},
1000:{
items: 4,
},
1400:{
items: 5,
},
}
// speed:10000,
});
} catch {
}
});

@ -0,0 +1,10 @@
{
"name": "ProductYasamin",
"version": "1.0",
"author": "xStack",
"email": "xshop@xstack.ir",
"license": "GPL-3.0-or-later",
"url": "https:\/\/xstack.ir",
"author_url": "https:\/\/4xmen.ir",
"packages": []
}

@ -0,0 +1,21 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
class ProductYasamin
{
public static function onAdd(Part $part = null)
{
}
public static function onRemove(Part $part = null)
{
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,42 @@
#ProductYasamin {
// scss
h1{
font-size: 27px;
font-weight: 300;
}
#yac-images{
font-size: 0;
.item{
display: inline-block;
&:nth-child(3n+1) {
width: 100%;
}
&:nth-child(3n+2) ,&:nth-child(3n+3) {
width: 50%;
}
img{
width: 100%;
height: 45vh;
object-fit: cover;
}
}
}
.yac-product-data{
padding: 1rem 1.3rem;
.p-2{
padding: 0 !important;
}
}
#price, #old-price{
font-size: 27px;
font-size: 27px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

@ -8,6 +8,8 @@
img {
width: 100%;
height: 40vh;
object-fit: cover;
}
h3 {

Loading…
Cancel
Save