-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move show_swatches check to only be around the super_attributes & thu…
…mbnail depends on selected options
- Loading branch information
Showing
3 changed files
with
49 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
<template {!! isset($slider) ? '' : 'slot="renderItem" slot-scope="{ item, count }"' !!}> | ||
<div class="my-0.5 w-full h-full shrink-0 snap-start px-0.5 sm:my-2 sm:px-2 sm:w-1/2 lg:w-1/3"> | ||
<div class="group relative flex flex-1 flex-col rounded border bg-white p-5" :key="item.entity_id"> | ||
@if (App::providerIsLoaded('Rapidez\Wishlist\WishlistServiceProvider')) | ||
<div class="group absolute right-0 top-0 z-10 p-2"> | ||
@include('rapidez::wishlist.button') | ||
</div> | ||
@endif | ||
<a :href="item.url | url" class="block"> | ||
<img | ||
v-if="item.thumbnail" | ||
:src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento/catalog/product' + item.thumbnail + '.webp'" | ||
class="mb-3 h-48 w-full rounded-t object-contain" :alt="item.name" :loading="config.category && count <= 4 ? 'eager' : 'lazy'" | ||
width="200" | ||
height="200" | ||
/> | ||
<x-rapidez::no-image v-else class="mb-3 h-48 rounded-t" /> | ||
<div class="px-2"> | ||
<div class="text-base font-medium">@{{ item.name }}</div> | ||
@if (!Rapidez::config('catalog/frontend/show_swatches_in_product_list', 1)) | ||
<div class="flex items-center space-x-2"> | ||
<div class="font-semibold">@{{ (item.special_price || item.price) | price }}</div> | ||
<div class="text-sm line-through" v-if="item.special_price">@{{ item.price | price }}</div> | ||
</div> | ||
@endif | ||
</div> | ||
</a> | ||
@includeWhen(Rapidez::config('catalog/frontend/show_swatches_in_product_list', 1), 'rapidez::listing.partials.item.addtocart') | ||
</div> | ||
<add-to-cart v-bind:product="item" v-slot="addToCart" v-cloak> | ||
<div class="group relative flex flex-1 flex-col rounded border bg-white p-5" :key="item.entity_id"> | ||
@if (App::providerIsLoaded('Rapidez\Wishlist\WishlistServiceProvider')) | ||
<div class="group absolute right-0 top-0 z-10 p-2"> | ||
@include('rapidez::wishlist.button') | ||
</div> | ||
@endif | ||
<a :href="item.url | url" class="block"> | ||
<img | ||
v-if="addToCart.currentThumbnail" | ||
:src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento/catalog/product' + addToCart.currentThumbnail + '.webp'" | ||
class="mb-3 h-48 w-full rounded-t object-contain" :alt="item.name" :loading="config.category && count <= 4 ? 'eager' : 'lazy'" | ||
width="200" | ||
height="200" | ||
/> | ||
<x-rapidez::no-image v-else class="mb-3 h-48 rounded-t" /> | ||
<div class="px-2"> | ||
<div class="text-base font-medium">@{{ item.name }}</div> | ||
@if (!Rapidez::config('catalog/frontend/show_swatches_in_product_list', 1)) | ||
<div class="flex items-center space-x-2"> | ||
<div class="font-semibold">@{{ (item.special_price || item.price) | price }}</div> | ||
<div class="text-sm line-through" v-if="item.special_price">@{{ item.price | price }}</div> | ||
</div> | ||
@endif | ||
</div> | ||
</a> | ||
@include('rapidez::listing.partials.item.addtocart') | ||
</div> | ||
</add-to-cart> | ||
</div> | ||
</template> |
34 changes: 16 additions & 18 deletions
34
resources/views/listing/partials/item/addtocart.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<add-to-cart v-bind:product="item" v-slot="addToCart" v-cloak> | ||
<form class="px-2 pb-2" v-on:submit.prevent="addToCart.add"> | ||
<div class="flex items-center space-x-2 mb-2"> | ||
<div class="font-semibold"> | ||
@{{ (addToCart.simpleProduct.special_price || addToCart.simpleProduct.price) | price }} | ||
</div> | ||
<div class="line-through text-sm" v-if="addToCart.simpleProduct.special_price"> | ||
@{{ addToCart.simpleProduct.price | price }} | ||
</div> | ||
<form class="px-2 pb-2" v-on:submit.prevent="addToCart.add"> | ||
<div class="flex items-center space-x-2 mb-2"> | ||
<div class="font-semibold"> | ||
@{{ (addToCart.simpleProduct.special_price || addToCart.simpleProduct.price) | price }} | ||
</div> | ||
<div class="line-through text-sm" v-if="addToCart.simpleProduct.special_price"> | ||
@{{ addToCart.simpleProduct.price | price }} | ||
</div> | ||
</div> | ||
|
||
<p v-if="!item.in_stock" class="text-red-600 text-xs"> | ||
@lang('Sorry! This product is currently out of stock.') | ||
</p> | ||
<div v-else> | ||
@include('rapidez::listing.partials.item.super_attributes') | ||
<p v-if="!item.in_stock" class="text-red-600 text-xs"> | ||
@lang('Sorry! This product is currently out of stock.') | ||
</p> | ||
<div v-else> | ||
@includeWhen(Rapidez::config('catalog/frontend/show_swatches_in_product_list', 1), 'rapidez::listing.partials.item.super_attributes') | ||
|
||
<x-rapidez::button.cart/> | ||
</div> | ||
</form> | ||
</add-to-cart> | ||
<x-rapidez::button.cart/> | ||
</div> | ||
</form> |