issue #760 wishlist
This commit is contained in:
parent
4c2a0a08fc
commit
fdb6284856
|
|
@ -90,9 +90,9 @@ class OrderItemRepository extends Repository
|
|||
|
||||
$product = $orderItem->type == 'configurable' ? $orderItem->child->product : $orderItem->product;
|
||||
|
||||
if (! $product) {
|
||||
if (! $product)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$orderedInventory = $product->ordered_inventories()
|
||||
->where('channel_id', $orderItem->order->channel->id)
|
||||
|
|
@ -126,14 +126,15 @@ class OrderItemRepository extends Repository
|
|||
->where('channel_id', $orderItem->order->channel->id)
|
||||
->first();
|
||||
|
||||
if ($orderedInventory) {
|
||||
if (($qty = $orderedInventory->qty - $orderItem->qty_to_cancel) < 0) {
|
||||
$qty = 0;
|
||||
}
|
||||
if (! $orderedInventory)
|
||||
return ;
|
||||
|
||||
$orderedInventory->update([
|
||||
'qty' => $qty
|
||||
]);
|
||||
if (($qty = $orderedInventory->qty - $orderItem->qty_to_cancel) < 0) {
|
||||
$qty = 0;
|
||||
}
|
||||
|
||||
$orderedInventory->update([
|
||||
'qty' => $qty
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -42,11 +42,13 @@
|
|||
|
||||
{{-- Uncomment the line below for activating share links --}}
|
||||
{{-- @include('shop::products.sharelinks') --}}
|
||||
|
||||
@auth('customer')
|
||||
<a class="add-to-wishlist" href="{{ route('customer.wishlist.add', $product->id) }}">
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
|
@ -157,6 +159,17 @@
|
|||
zoomImage.data('zoom-image', $(this).data('zoom-image'));
|
||||
zoomImage.ezPlus();
|
||||
});
|
||||
|
||||
$(document).mousemove(function(event) {
|
||||
if ( (event.pageX - $('.product-hero-image').offset().left > 440 ) && (event.pageX - $('.product-hero-image').offset().left < 465) && (event.pageY - $('.product-hero-image').offset().top > 16) && (event.pageY - $('.product-hero-image').offset().top < 38)) {
|
||||
|
||||
$('.zoomContainer').attr('style', 'z-index: -1 !important');
|
||||
|
||||
} else {
|
||||
$('.zoomContainer').css({"position": "absolute", "top": "143px", "left"
|
||||
: "249px", "height": "480px", "width": "480px", "z-index": "999" });
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue