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
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function haveDownloadableItems()
|
public function hasDownloadableItems()
|
||||||
{
|
{
|
||||||
foreach ($this->items as $item) {
|
foreach ($this->items as $item) {
|
||||||
if (stristr($item->type,'downloadable') !== false) {
|
if (stristr($item->type,'downloadable') !== false) {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class CartController extends Controller
|
||||||
|
|
||||||
$product = $this->productRepository->find($id);
|
$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();
|
return redirect()->back();
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class OnepageController extends Controller
|
||||||
|
|
||||||
$cart = Cart::getCart();
|
$cart = Cart::getCart();
|
||||||
|
|
||||||
if (! auth()->guard('customer')->check() && $cart->haveDownloadableItems())
|
if (! auth()->guard('customer')->check() && $cart->hasDownloadableItems())
|
||||||
return redirect()->route('customer.session.index');
|
return redirect()->route('customer.session.index');
|
||||||
|
|
||||||
Cart::collectTotals();
|
Cart::collectTotals();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue