resolve exception, rename function haveDownloadableItems

This commit is contained in:
Annika Wolff 2020-01-15 11:53:48 +01:00
parent a75f3dab51
commit 91d6586ad8
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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();

View File

@ -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();