Configurable option on cart page
This commit is contained in:
parent
fa5473d168
commit
f57e0c6720
|
|
@ -368,10 +368,10 @@ class Cart {
|
|||
}
|
||||
|
||||
if($data['is_configurable'] == "true") {
|
||||
$this->canAddOrUpdate($parent->child->id, $parent->quantity);
|
||||
|
||||
$parent = $cart->items()->create($itemData['parent']);
|
||||
|
||||
$this->canAddOrUpdate($parent->child->id, $parent->quantity);
|
||||
|
||||
$itemData['child']['parent_id'] = $parent->id;
|
||||
|
||||
$cart->items()->create($itemData['child']);
|
||||
|
|
@ -503,7 +503,10 @@ class Cart {
|
|||
$data = [];
|
||||
|
||||
foreach($item->product->super_attributes as $attribute) {
|
||||
dd($item->child);
|
||||
dd($attribute->options);
|
||||
$option = $attribute->options()->where('id', $item->child->{$attribute->code})->first();
|
||||
|
||||
$data['attributes'][$attribute->code] = [
|
||||
'attribute_name' => $attribute->name,
|
||||
'option_label' => $option->label,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Cart\\Providers\\ShippingServiceProvider"
|
||||
"Webkul\\Shipping\\Providers\\ShippingServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@
|
|||
@if ($product->type == 'configurable')
|
||||
|
||||
<div class="summary">
|
||||
{{-- @foreach (cart::getItemAttributeOptionDetails($item) as $key => $option)
|
||||
@foreach (cart::getItemAttributeOptionDetails($item) as $key => $option)
|
||||
|
||||
{{ (!$key ? '' : ' , ') . $option['attribute_name'] . ' : ' . $option['option_label'] }}
|
||||
|
||||
@endforeach --}}
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue