resolve merge issue, add type hints in Cart helper function

This commit is contained in:
Annika Wolff 2020-02-21 08:36:52 +01:00
parent 623b7893a2
commit d50510a626
2 changed files with 38 additions and 34 deletions

View File

@ -785,7 +785,7 @@ class Cart
])->orderBy('tax_rate', 'desc')->get();
$item = $this->setItemTaxToZero($item);
if ($taxRates->count()) {
foreach ($taxRates as $rate) {
$haveTaxRate = false;
@ -822,11 +822,11 @@ class Cart
* @param CartItem $item
* @return CartItem
*/
protected function setItemTaxToZero($item) {
protected function setItemTaxToZero(CartItem $item): CartItem {
$item->tax_percent = 0;
$item->tax_amount = 0;
$item->base_tax_amount = 0;
return $item;
}

View File

@ -30,7 +30,8 @@
{{ __('shop::app.mail.invoice.summary') }}
</div>
<div style="display: flex;flex-direction: row;margin-top: 20px;justify-content: space-between;margin-bottom: 40px;">
<div
style="display: flex;flex-direction: row;margin-top: 20px;justify-content: space-between;margin-bottom: 40px;">
@if ($order->shipping_address)
<div style="line-height: 25px;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
@ -103,37 +104,41 @@
<table style="overflow-x: auto; border-collapse: collapse;
border-spacing: 0;width: 100%">
<thead>
<tr style="background-color: #f2f2f2">
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
</tr>
<tr style="background-color: #f2f2f2">
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
</tr>
</thead>
<tbody>
@foreach ($invoice->items as $item)
<tr>
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}" style="text-align: left;padding: 8px">
{{ $item->name }}
@foreach ($invoice->items as $item)
<tr>
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}"
style="text-align: left;padding: 8px">
{{ $item->name }}
@if (isset($item->additional['attributes']))
<div class="item-options">
@if (isset($item->additional['attributes']))
<div class="item-options">
@foreach ($item->additional['attributes'] as $attribute)
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
@endforeach
@foreach ($item->additional['attributes'] as $attribute)
<b>{{ $attribute['attribute_name'] }}
: </b>{{ $attribute['option_label'] }}</br>
@endforeach
</div>
@endif
</td>
</div>
@endif
</td>
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}" style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}
</td>
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}"
style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}
</td>
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}" style="text-align: left;padding: 8px">{{ $item->qty }}</td>
</tr>
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}"
style="text-align: left;padding: 8px">{{ $item->qty }}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
@ -156,14 +161,12 @@
</div>
@endif
@foreach (Webkul\Tax\Helpers\Tax::getTaxRatesWithAmount($refund, false) as $taxRate => $taxAmount)
<div>
<span id="taxrate-{{ core()->taxRateAsIdentifier($taxRate) }}">{{ __('shop::app.mail.order.tax') }} {{ $taxRate }} %</span>
<span id="taxamount-{{ core()->taxRateAsIdentifier($taxRate) }}" style="float: right;">
{{ core()->formatPrice($taxAmount, $order->order_currency_code) }}
<div>
<span>{{ __('shop::app.mail.order.tax') }}</span>
<span id="taxamount" style="float: right;">
{{ core()->formatPrice($invoice->tax_amount, $order->order_currency_code) }}
</span>
</div>
@endforeach
</div>
@if ($invoice->discount_amount > 0)
<div>
@ -182,7 +185,8 @@
</div>
</div>
<div style="margin-top: 65px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%">
<div
style="margin-top: 65px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%">
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!!
__('shop::app.mail.order.help', [