Added product id attribute to model

This commit is contained in:
jitendra 2019-04-16 16:37:52 +05:30
parent dd90e63ade
commit 7fc68c56ae
2 changed files with 10 additions and 5 deletions

View File

@ -285,4 +285,12 @@ class Product extends Model implements ProductContract
return new \Webkul\Product\Database\Eloquent\Builder($query);
}
/**
* Return the product id attribute.
*/
public function getProductIdAttribute()
{
return $image = $this->id;
}
}

View File

@ -1,6 +1,4 @@
@if (Route::currentRouteName() == "shop.products.index")
@include ('shop::products.add-to', ['product' => $product])
@else
@if ($product->type == "configurable")
<div class="cart-wish-wrap">
<a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">
@ -21,5 +19,4 @@
@include('shop::products.wishlist')
</div>
@endif
@endif
@endif