issue #760 wishlist

This commit is contained in:
rahul shukla 2019-04-05 16:54:09 +05:30
parent 4c2a0a08fc
commit fdb6284856
2 changed files with 26 additions and 12 deletions

View File

@ -56,7 +56,7 @@ class OrderItemRepository extends Repository
$totalInvoiced += $invoiceItem->total;
$baseTotalInvoiced += $invoiceItem->base_total;
$taxInvoiced += $invoiceItem->tax_amount;
$baseTaxInvoiced += $invoiceItem->base_tax_amount;
}
@ -70,7 +70,7 @@ class OrderItemRepository extends Repository
$orderItem->total_invoiced = $totalInvoiced;
$orderItem->base_total_invoiced = $baseTotalInvoiced;
$orderItem->tax_amount_invoiced = $taxInvoiced;
$orderItem->base_tax_amount_invoiced = $baseTaxInvoiced;
@ -90,14 +90,14 @@ 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)
->first();
if ($orderedInventory) {
$orderedInventory->update([
'qty' => $orderedInventory->qty + $orderItem->qty_ordered
@ -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
]);
}
}

View File

@ -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>