base sync
This commit is contained in:
commit
4bfefd3a07
|
|
@ -245,7 +245,7 @@ return [
|
|||
Webkul\Sales\Providers\SalesServiceProvider::class,
|
||||
Webkul\Tax\Providers\TaxServiceProvider::class,
|
||||
Webkul\API\Providers\APIServiceProvider::class,
|
||||
Webkul\Discount\Providers\DiscountServiceProvider::class
|
||||
Webkul\Discount\Providers\DiscountServiceProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/admin.js": "/js/admin.js?id=f3dc175b3f211700d0fd",
|
||||
"/js/admin.js": "/js/admin.js?id=301713f31cb0ba5260b5",
|
||||
"/css/admin.css": "/css/admin.css?id=79d1d08f945a3e35e1c7"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@
|
|||
<td>{{ core()->formatBasePrice($item->base_discount_amount) }}</td>
|
||||
@endif
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}</td>
|
||||
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount - $item->base_total + $item->base_tax_amount) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@
|
|||
<td>{{ core()->formatBasePrice($item->base_discount_amount) }}</td>
|
||||
@endif
|
||||
|
||||
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}</td>
|
||||
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount - $item->base_discount_amount) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1167,6 +1167,9 @@ class Cart {
|
|||
'tax_percent' => $data['tax_percent'],
|
||||
'tax_amount' => $data['tax_amount'],
|
||||
'base_tax_amount' => $data['base_tax_amount'],
|
||||
'discount_percent' => $data['discount_percent'],
|
||||
'discount_amount' => $data['discount_amount'],
|
||||
'base_discount_amount' => $data['base_discount_amount'],
|
||||
'additional' => $data['additional'],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class Price extends AbstractProduct
|
|||
public function getVariantMinPrice($product)
|
||||
{
|
||||
static $price = [];
|
||||
$finalPrice = [];
|
||||
|
||||
if (array_key_exists($product->id, $price))
|
||||
return $price[$product->id];
|
||||
|
|
@ -70,22 +71,23 @@ class Price extends AbstractProduct
|
|||
$productId = $product->id;
|
||||
}
|
||||
|
||||
$variantSpecialPrice = $variantRegularPrice = [];
|
||||
$qb = ProductFlat::join('products', 'product_flat.product_id', '=', 'products.id')
|
||||
->where('products.parent_id', $productId);
|
||||
|
||||
foreach ($product->variants as $productVariant) {
|
||||
if ($this->haveSpecialPrice($productVariant)) {
|
||||
$variantSpecialPrice[] = $this->getSpecialPrice($productVariant);
|
||||
}
|
||||
$variantRegularPrice[] = $productVariant->price;
|
||||
$result = $qb
|
||||
->distinct()
|
||||
->selectRaw('IF( product_flat.special_price_from IS NOT NULL
|
||||
AND product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= product_flat.special_price_from
|
||||
AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS final_price')
|
||||
->where('product_flat.channel', core()->getCurrentChannelCode())
|
||||
->where('product_flat.locale', app()->getLocale())
|
||||
->get();
|
||||
|
||||
foreach ($result as $price) {
|
||||
$finalPrice[] = $price->final_price;
|
||||
}
|
||||
|
||||
if (count($variantSpecialPrice) > 1)
|
||||
if (min($variantSpecialPrice) < min($variantRegularPrice))
|
||||
return $price[$product->id] = min($variantSpecialPrice);
|
||||
|
||||
return $price[$product->id] = min($variantRegularPrice);
|
||||
|
||||
return $price[$product->id] = min($variantRegularPrice);
|
||||
return $price[$product->id] = min($finalPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/shop.js": "/js/shop.js?id=ad1039174ce2c81c8805",
|
||||
"/js/shop.js": "/js/shop.js?id=71f03d05d9690fe24784",
|
||||
"/css/shop.css": "/css/shop.css?id=0e57754dbdaba7c6eb76"
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=3cebf9d7b4dc56d1b407",
|
||||
"/js/ui.js": "/js/ui.js?id=97343143e38eeba34064",
|
||||
"/css/ui.css": "/css/ui.css?id=c846938a649c221ac297"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue