resolve exception, rename function haveDownloadableItems
This commit is contained in:
parent
a75f3dab51
commit
91d6586ad8
|
|
@ -120,7 +120,7 @@ class Cart extends Model implements CartContract
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function haveDownloadableItems()
|
||||
public function hasDownloadableItems()
|
||||
{
|
||||
foreach ($this->items as $item) {
|
||||
if (stristr($item->type,'downloadable') !== false) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class CartController extends Controller
|
|||
|
||||
$product = $this->productRepository->find($id);
|
||||
|
||||
return redirect()->route('shop.products.index', ['slug' => $product->url_key]);
|
||||
return redirect()->route('shop.productOrCategory.index', ['slug' => $product->url_key]);
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class OnepageController extends Controller
|
|||
|
||||
$cart = Cart::getCart();
|
||||
|
||||
if (! auth()->guard('customer')->check() && $cart->haveDownloadableItems())
|
||||
if (! auth()->guard('customer')->check() && $cart->hasDownloadableItems())
|
||||
return redirect()->route('customer.session.index');
|
||||
|
||||
Cart::collectTotals();
|
||||
|
|
|
|||
Loading…
Reference in New Issue