Configurable option on cart page

This commit is contained in:
jitendra 2018-10-01 12:07:32 +05:30
parent fa5473d168
commit f57e0c6720
3 changed files with 8 additions and 5 deletions

View File

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

View File

@ -17,7 +17,7 @@
"extra": {
"laravel": {
"providers": [
"Webkul\\Cart\\Providers\\ShippingServiceProvider"
"Webkul\\Shipping\\Providers\\ShippingServiceProvider"
],
"aliases": {}
}

View File

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