20-02-2026
This commit is contained in:
parent
a8b395e20d
commit
a00c42e770
252 changed files with 28785 additions and 8907 deletions
|
|
@ -2,25 +2,27 @@
|
|||
|
||||
namespace App\Http\Controllers\Portal;
|
||||
|
||||
use Auth;
|
||||
use Yard;
|
||||
use Request;
|
||||
use Validator;
|
||||
use App\Services\Shop;
|
||||
use App\Services\Util;
|
||||
use App\Models\Product;
|
||||
use App\Models\UserAbo;
|
||||
use App\Services\AboHelper;
|
||||
use App\Models\ShoppingUser;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Services\UserService;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Models\ShoppingUser;
|
||||
use App\Models\UserAbo;
|
||||
use App\Models\UserAboItem;
|
||||
use App\Repositories\AboRepository;
|
||||
use App\Services\AboHelper;
|
||||
use App\Services\AboItemHistoryService;
|
||||
use App\Services\AboOrderCart;
|
||||
use App\Services\Shop;
|
||||
use App\Services\UserService;
|
||||
use App\Services\Util;
|
||||
use Auth;
|
||||
use Request;
|
||||
use Yard;
|
||||
|
||||
class AboController extends Controller
|
||||
{
|
||||
private $instance = 'subscription';
|
||||
|
||||
private $yard;
|
||||
|
||||
/**
|
||||
|
|
@ -34,12 +36,11 @@ class AboController extends Controller
|
|||
$this->yard = Yard::instance($this->instance);
|
||||
}
|
||||
|
||||
|
||||
public function myAbo()
|
||||
{
|
||||
$user = Auth::guard('customers')->user();
|
||||
|
||||
if (!$user->shopping_user_id) {
|
||||
|
||||
if (! $user->shopping_user_id) {
|
||||
return view('portal.abo.my_abo_create', [
|
||||
'user' => $user,
|
||||
'no_shopping_user' => true,
|
||||
|
|
@ -49,30 +50,304 @@ class AboController extends Controller
|
|||
|
||||
$shopping_user = ShoppingUser::findOrFail($user->shopping_user_id);
|
||||
$user_abo = UserAbo::where('email', $shopping_user->billing_email)
|
||||
->where('status', '>', 1)
|
||||
->first();
|
||||
->where('status', '>', 1)
|
||||
->first();
|
||||
|
||||
return $user_abo
|
||||
? view('portal.abo.my_abo', ['user_abo' => $user_abo])
|
||||
: view('portal.abo.my_abo_create', [
|
||||
if (! $user_abo) {
|
||||
return view('portal.abo.my_abo_create', [
|
||||
'shopping_user' => $shopping_user,
|
||||
'step' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->checkPortalPermission($user_abo);
|
||||
|
||||
$view = 'portal';
|
||||
|
||||
// Init Yard und Customer-Detail
|
||||
AboOrderCart::initYard($user_abo);
|
||||
$customer_detail = AboOrderCart::getCustomerDetail();
|
||||
AboOrderCart::makeOrderYard($user_abo);
|
||||
|
||||
return view('portal.abo.my_abo', [
|
||||
'user_abo' => $user_abo,
|
||||
'customer_detail' => $customer_detail,
|
||||
'view' => $view,
|
||||
'comp_products' => [],
|
||||
'isAdmin' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function update($view, $id)
|
||||
{
|
||||
$data = Request::all();
|
||||
$user_abo = UserAbo::findOrFail($id);
|
||||
$this->checkPortalPermission($user_abo);
|
||||
$isAddOnlyMode = AboHelper::isAddOnlyMode($user_abo, $view);
|
||||
|
||||
if (isset($data['action'])) {
|
||||
if ($data['action'] === 'abo_update_settings') {
|
||||
$user_abo = UserAbo::findOrFail($data['id']);
|
||||
$this->checkPortalPermission($user_abo);
|
||||
$aboRepository = new AboRepository;
|
||||
$aboRepository->setModel($user_abo);
|
||||
$aboRepository->update($data);
|
||||
|
||||
return redirect(route('portal.my_subscriptions'));
|
||||
}
|
||||
|
||||
if (Request::ajax()) {
|
||||
$message = false;
|
||||
|
||||
// addProduct
|
||||
if ($data['action'] === 'addProduct') {
|
||||
if ($product = Product::find($data['product_id'])) {
|
||||
if ($UserAboItem = UserAboItem::where('user_abo_id', $user_abo->id)->where('product_id', $product->id)->where('comp', 0)->first()) {
|
||||
$qtyBefore = $UserAboItem->qty;
|
||||
$UserAboItem->qty = $UserAboItem->qty + 1;
|
||||
$UserAboItem->save();
|
||||
AboItemHistoryService::logProductAdded($user_abo, $UserAboItem, $qtyBefore, $view);
|
||||
} else {
|
||||
$newItem = UserAboItem::create([
|
||||
'user_abo_id' => $user_abo->id,
|
||||
'product_id' => $product->id,
|
||||
'comp' => 0,
|
||||
'qty' => 1,
|
||||
'status' => 1,
|
||||
]);
|
||||
AboItemHistoryService::logProductAdded($user_abo, $newItem, 0, $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// updateCart
|
||||
if ($data['action'] === 'updateCart') {
|
||||
if (isset($data['product_id']) && $product = Product::find($data['product_id'])) {
|
||||
if (isset($data['order_item_id']) && $UserAboItem = UserAboItem::find($data['order_item_id'])) {
|
||||
if (isset($data['qty'])) {
|
||||
$qtyBefore = $UserAboItem->qty;
|
||||
$qty = (int) $data['qty'];
|
||||
$qty = $qty < 1 ? 1 : $qty;
|
||||
$qty = $qty > 100 ? 100 : $qty;
|
||||
if ($isAddOnlyMode && $qty < $UserAboItem->qty) {
|
||||
$qty = $UserAboItem->qty;
|
||||
}
|
||||
$UserAboItem->qty = $qty;
|
||||
$UserAboItem->save();
|
||||
AboItemHistoryService::logQtyChanged($user_abo, $UserAboItem, $qtyBefore, $qty, $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// removeFromCart
|
||||
if ($data['action'] === 'removeFromCart') {
|
||||
if ($isAddOnlyMode) {
|
||||
return response()->json([
|
||||
'response' => false,
|
||||
'message' => __('abo.error_add_only_no_remove'),
|
||||
], 403);
|
||||
}
|
||||
if (! isset($data['product_id']) || ! ($product = Product::find($data['product_id']))) {
|
||||
$message = __('abo.product_not_found');
|
||||
}
|
||||
if (! isset($data['order_item_id']) || ! ($userAboItem = UserAboItem::find($data['order_item_id']))) {
|
||||
$message = __('abo.abo_item_not_found');
|
||||
}
|
||||
$has_basis_product = $this->checkNeedBasisProduct($user_abo, $product, $data['order_item_id']);
|
||||
if (! $has_basis_product) {
|
||||
$message = __('abo.need_basis_product');
|
||||
}
|
||||
if (! $message) {
|
||||
AboItemHistoryService::logProductRemoved($user_abo, $userAboItem, $view);
|
||||
$userAboItem->delete();
|
||||
$user_abo->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
// updateCompProduct
|
||||
if ($data['action'] === 'updateCompProduct') {
|
||||
if ($UserAboItem = UserAboItem::where('user_abo_id', $user_abo->id)->where('comp', $data['comp_num'])->first()) {
|
||||
$oldProduct = $UserAboItem->product;
|
||||
$UserAboItem->product_id = $data['comp_product_id'];
|
||||
$UserAboItem->save();
|
||||
$UserAboItem->load('product');
|
||||
AboItemHistoryService::logCompProductChanged($user_abo, $UserAboItem, $oldProduct, $UserAboItem->product, $view);
|
||||
} else {
|
||||
$newItem = UserAboItem::create([
|
||||
'user_abo_id' => $user_abo->id,
|
||||
'product_id' => $data['comp_product_id'],
|
||||
'comp' => $data['comp_num'],
|
||||
'qty' => 1,
|
||||
'status' => 1,
|
||||
]);
|
||||
AboItemHistoryService::logProductAdded($user_abo, $newItem, 0, $view);
|
||||
}
|
||||
}
|
||||
|
||||
AboOrderCart::initYard($user_abo);
|
||||
AboOrderCart::makeOrderYard($user_abo);
|
||||
AboOrderCart::checkNumOfCompProducts($user_abo);
|
||||
|
||||
$error_message = $message ? $message : false;
|
||||
$html_cart = view('admin.abo._order_abo_show', ['user_abo' => $user_abo, 'error_message' => $error_message, 'add_only_mode' => $isAddOnlyMode])->render();
|
||||
$html_comp = view('user.order.comp_product', $data)->render();
|
||||
|
||||
$amount = $user_abo->getFormattedAmount();
|
||||
|
||||
return response()->json(['response' => true, 'data' => $data, 'html_cart' => $html_cart, 'html_comp' => $html_comp, 'amount' => $amount]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable($user_abo_id)
|
||||
{
|
||||
$user_abo = UserAbo::findOrFail($user_abo_id);
|
||||
$this->checkPortalPermission($user_abo);
|
||||
|
||||
$show_on_ids = ['12', '13'];
|
||||
$query = Product::select('products.*')
|
||||
->where('active', true)
|
||||
->where(function ($q) use ($show_on_ids) {
|
||||
foreach ($show_on_ids as $id) {
|
||||
$q->orWhereJsonContains('show_on', $id);
|
||||
}
|
||||
})
|
||||
->orderByRaw(
|
||||
"CASE
|
||||
WHEN JSON_CONTAINS(show_on, ?, '$') THEN 1
|
||||
WHEN JSON_CONTAINS(show_on, ?, '$') THEN 2
|
||||
ELSE 3 END",
|
||||
[$show_on_ids[0], isset($show_on_ids[1]) ? $show_on_ids[1] : $show_on_ids[0]]
|
||||
);
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('add_card', function (Product $product) {
|
||||
$tax_free = Yard::instance('shopping')->getUserTaxFree();
|
||||
$price = $product->getFormattedPriceWith($tax_free, false, Yard::instance('shopping')->getUserCountry());
|
||||
|
||||
return '<button type="button" class="btn btn-sm btn-md-extra btn-secondary add-product-basket" data-product-id="'.$product->id.'" data-product-name="'.e($product->getLang('name')).'" data-product-price="'.$price.' €">
|
||||
<strong>€ '.$price.'</strong> +<span class="ion ion-md-cart"></span>
|
||||
</button>';
|
||||
})
|
||||
->addColumn('picture', function (Product $product) {
|
||||
if (count($product->images)) {
|
||||
return '<img class="img-fluid img-extra" alt="" src="'.route('product_image', [$product->images->first()->slug]).'">';
|
||||
}
|
||||
|
||||
return '';
|
||||
})
|
||||
->addColumn('name', function (Product $product) {
|
||||
return '<strong>'.$product->getLang('name').'</strong><br>'.get_abo_type_badge_by_product($product);
|
||||
})
|
||||
->addColumn('points', function (Product $product) {
|
||||
return '<span class="no-line-break">'.$product->getFormattedPoints().'</span>';
|
||||
})
|
||||
->addColumn('price_net', function (Product $product) {
|
||||
return '<span class="no-line-break">'.$product->getFormattedPriceWith(true, false, Yard::instance('shopping')->getUserCountry()).' €</span>'.'<span class="no-line-break">'.$product->getFormattedPriceCurrencyWith(true, true, Yard::instance('shopping')->getUserCountry()).'</span>';
|
||||
})
|
||||
->addColumn('price_gross', function (Product $product) {
|
||||
return '<span class="no-line-break">'.$product->getFormattedPriceWith(false, false, Yard::instance('shopping')->getUserCountry()).' €</span>'.'<span class="no-line-break">'.$product->getFormattedPriceCurrencyWith(true, true, Yard::instance('shopping')->getUserCountry()).'</span>';
|
||||
})
|
||||
->addColumn('action', function (Product $product) {
|
||||
return '<button class="btn btn-default btn-sm icon-btn md-btn-flat product-tooltip" title="details" data-modal="modal-lg"
|
||||
data-toggle="modal" data-target="#modals-load-content" data-id="'.$product->id.'" data-route="'.route('portal.loading_modal').'"
|
||||
data-action="user-order-show-product" data-view="customer"><i class="ion ion-md-eye"></i></button>';
|
||||
})
|
||||
->filterColumn('product', function ($query, $keyword) {
|
||||
if ($keyword != '') {
|
||||
$query->where('name', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->orderColumn('name', 'name $1')
|
||||
->orderColumn('product', 'name $1')
|
||||
->orderColumn('number', 'number $1')
|
||||
->orderColumn('points', 'points $1')
|
||||
->orderColumn('price_net', 'price_net $1')
|
||||
->orderColumn('price_gross', 'price_gross $1')
|
||||
->orderColumn('contents_total', 'contents_total $1')
|
||||
->orderColumn('weight', 'weight $1')
|
||||
->rawColumns(['add_card', 'points', 'product', 'name', 'quantity', 'picture', 'price_net', 'price_gross', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function modalLoad()
|
||||
{
|
||||
$data = Request::all();
|
||||
$ret = '';
|
||||
|
||||
if (isset($data['action'])) {
|
||||
if ($data['action'] === 'abo-add-product') {
|
||||
$user_abo = UserAbo::find($data['id']);
|
||||
$this->checkPortalPermission($user_abo);
|
||||
$ret = view('user.abo.modal_abo_show_products', compact('data', 'user_abo'))->render();
|
||||
}
|
||||
if ($data['action'] === 'abo_update_settings') {
|
||||
$user_abo = UserAbo::find($data['id']);
|
||||
$this->checkPortalPermission($user_abo);
|
||||
$route = route('user_abos_update', [$data['view'], $user_abo->id]);
|
||||
$ret = view('admin.abo.modal_abo_update', compact('user_abo', 'data', 'route'))->render();
|
||||
}
|
||||
if ($data['action'] === 'user-order-show-product') {
|
||||
$product = Product::find($data['id']);
|
||||
$ret = view('admin.modal.show_product', compact('product', 'data'))->render();
|
||||
}
|
||||
}
|
||||
|
||||
if (Request::ajax()) {
|
||||
return response()->json(['response' => $data, 'html' => $ret, 'status' => true]);
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
public function checkNeedBasisProduct($user_abo, $product, $order_item_id)
|
||||
{
|
||||
if (AboHelper::getAboShowOn($product) !== 'base') {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($user_abo->user_abo_items as $user_abo_item) {
|
||||
if ($user_abo_item->id == $order_item_id) {
|
||||
continue;
|
||||
}
|
||||
if ($user_abo_item->comp) {
|
||||
continue;
|
||||
}
|
||||
if (AboHelper::getAboShowOn($user_abo_item->product) === 'base') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function checkPortalPermission($user_abo)
|
||||
{
|
||||
$user = Auth::guard('customers')->user();
|
||||
if (! $user || ! $user->shopping_user_id) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
$shopping_user = ShoppingUser::find($user->shopping_user_id);
|
||||
if (! $shopping_user || $user_abo->email !== $shopping_user->billing_email) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
}
|
||||
|
||||
public function myAboCreate($step)
|
||||
{
|
||||
$user = Auth::guard('customers')->user();
|
||||
|
||||
if (!$user->shopping_user_id) {
|
||||
|
||||
if (! $user->shopping_user_id) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$shopping_user = ShoppingUser::findOrFail($user->shopping_user_id);
|
||||
$data = $this->prepareAboCreateData($shopping_user, $step);
|
||||
if(isset($data['checkout_url'])){
|
||||
if (isset($data['checkout_url'])) {
|
||||
return redirect($data['checkout_url']);
|
||||
}
|
||||
|
||||
return view('portal.abo.my_abo_create', $data);
|
||||
}
|
||||
|
||||
|
|
@ -81,16 +356,16 @@ class AboController extends Controller
|
|||
$data = [
|
||||
'shopping_user' => $shopping_user,
|
||||
'basis_products' => Product::where('active', true)
|
||||
->whereJsonContains('show_on', ['12'])
|
||||
->orderBy('pos', 'ASC')
|
||||
->get(),
|
||||
->whereJsonContains('show_on', ['12'])
|
||||
->orderBy('pos', 'ASC')
|
||||
->get(),
|
||||
'upgrade_products' => Product::where('active', true)
|
||||
->whereJsonContains('show_on', ['13'])
|
||||
->orderBy('pos', 'ASC')
|
||||
->get(),
|
||||
->whereJsonContains('show_on', ['13'])
|
||||
->orderBy('pos', 'ASC')
|
||||
->get(),
|
||||
'step' => 0,
|
||||
];
|
||||
if(Request::get('action') == 'back') {
|
||||
if (Request::get('action') == 'back') {
|
||||
$step = $step - 2;
|
||||
}
|
||||
|
||||
|
|
@ -110,14 +385,14 @@ class AboController extends Controller
|
|||
case 3:
|
||||
UserService::setInstance($this->instance);
|
||||
UserService::initCustomerYard($shopping_user, 'abo-ot-customer');
|
||||
if(Request::get('action') == 'next'){
|
||||
if (!$this->checkBasisProduct()) {
|
||||
if (Request::get('action') == 'next') {
|
||||
if (! $this->checkBasisProduct()) {
|
||||
$data['error'] = __('abo.abo_error_basis_product');
|
||||
$data['step'] = 2;
|
||||
} else {
|
||||
$data['step'] = 3;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$data['step'] = 3;
|
||||
}
|
||||
break;
|
||||
|
|
@ -128,12 +403,12 @@ class AboController extends Controller
|
|||
$data['step'] = 4;
|
||||
break;
|
||||
case 5:
|
||||
//chekout verarbeiten
|
||||
// chekout verarbeiten
|
||||
UserService::setInstance($this->instance);
|
||||
UserService::initCustomerYard($shopping_user, 'abo-ot-customer');
|
||||
if(Request::get('action') == 'checkout'){
|
||||
//checkout verarbeiten
|
||||
if (!$this->preCheckCheckout()) {
|
||||
if (Request::get('action') == 'checkout') {
|
||||
// checkout verarbeiten
|
||||
if (! $this->preCheckCheckout()) {
|
||||
$data['error'] = __('abo.abo_error_basis_product');
|
||||
$data['step'] = 4;
|
||||
} else {
|
||||
|
|
@ -152,8 +427,8 @@ class AboController extends Controller
|
|||
private function initYard($shopping_user)
|
||||
{
|
||||
$delivery_country = $shopping_user->getDeliveryCountry(true);
|
||||
|
||||
if (!$delivery_country) {
|
||||
|
||||
if (! $delivery_country) {
|
||||
abort(404, 'No delivery country found, please edit your personal data.');
|
||||
}
|
||||
|
||||
|
|
@ -164,55 +439,55 @@ class AboController extends Controller
|
|||
Shop::initUserShopLang($delivery_country, $this->instance);
|
||||
}
|
||||
|
||||
private function preCheckCheckout(){
|
||||
private function preCheckCheckout()
|
||||
{
|
||||
$result = false;
|
||||
//alle inhlate des warenkorb
|
||||
// alle inhlate des warenkorb
|
||||
$cartItems = $this->yard->content();
|
||||
foreach($cartItems as $item){
|
||||
if(in_array(12, $item->options->show_on)){
|
||||
foreach ($cartItems as $item) {
|
||||
if (in_array(12, $item->options->show_on)) {
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function checkBasisProduct()
|
||||
{
|
||||
$data = Request::all();
|
||||
$result = false;
|
||||
|
||||
if (!isset($data['base_product_qty'])) {
|
||||
if (! isset($data['base_product_qty'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($data['base_product_qty'] as $product_id => $quantity) {
|
||||
$product = Product::find($product_id);
|
||||
|
||||
if (!$product || intval($quantity) <= 0) {
|
||||
|
||||
if (! $product || intval($quantity) <= 0) {
|
||||
continue;
|
||||
}
|
||||
$result = true;
|
||||
$this->addProductToCart($product, $quantity);
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function upgradeProductToCart(){
|
||||
private function upgradeProductToCart()
|
||||
{
|
||||
$data = Request::all();
|
||||
$result = false;
|
||||
|
||||
if (!isset($data['upgrade_product_qty'])) {
|
||||
if (! isset($data['upgrade_product_qty'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($data['upgrade_product_qty'] as $product_id => $quantity) {
|
||||
$product = Product::find($product_id);
|
||||
|
||||
if (!$product) {
|
||||
|
||||
if (! $product) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +501,7 @@ class AboController extends Controller
|
|||
private function addProductToCart($product, $quantity)
|
||||
{
|
||||
// Suche nach dem Produkt im Warenkorb
|
||||
$cartItems = $this->yard->search(function($item) use ($product) {
|
||||
$cartItems = $this->yard->search(function ($item) use ($product) {
|
||||
return $item->id === $product->id;
|
||||
});
|
||||
|
||||
|
|
@ -235,13 +510,14 @@ class AboController extends Controller
|
|||
foreach ($cartItems as $item) {
|
||||
$this->yard->remove($item->rowId);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$image = $product->images->first()->slug ?? '';
|
||||
$price = $product->getPriceWith(
|
||||
$this->yard->getUserTaxFree(),
|
||||
false,
|
||||
$this->yard->getUserTaxFree(),
|
||||
false,
|
||||
$this->yard->getUserCountry()
|
||||
);
|
||||
|
||||
|
|
@ -265,7 +541,7 @@ class AboController extends Controller
|
|||
'points' => $product->points,
|
||||
'no_commission' => $product->no_commission,
|
||||
'no_free_shipping' => $product->no_free_shipping,
|
||||
'show_on' => $product->show_on
|
||||
'show_on' => $product->show_on,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -274,15 +550,15 @@ class AboController extends Controller
|
|||
$this->yard->reCalculateShippingPrice();
|
||||
}
|
||||
|
||||
|
||||
private function processCheckout(){
|
||||
private function processCheckout()
|
||||
{
|
||||
$user_shop = Util::getUserShop();
|
||||
if(!$user_shop){
|
||||
if (! $user_shop) {
|
||||
$user_shop = Util::getDefaultUserShop();
|
||||
}
|
||||
do {
|
||||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
} while (ShoppingInstance::where('identifier', $identifier)->count());
|
||||
|
||||
$data = [];
|
||||
$data['is_from'] = 'shopping';
|
||||
|
|
@ -291,7 +567,7 @@ class AboController extends Controller
|
|||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment' => 1, //Customer Shop Payment
|
||||
'payment' => 1, // Customer Shop Payment
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => $this->yard->getShippingCountryId(),
|
||||
'language' => \App::getLocale(),
|
||||
|
|
@ -299,13 +575,14 @@ class AboController extends Controller
|
|||
'back' => url()->previous(),
|
||||
|
||||
]);
|
||||
|
||||
|
||||
$this->yard->store($identifier);
|
||||
//add to DB
|
||||
$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
|
||||
if(strpos($path, 'https') === false){
|
||||
// add to DB
|
||||
$path = route('checkout.checkout_card', ['identifier' => $identifier]);
|
||||
if (strpos($path, 'https') === false) {
|
||||
$path = str_replace('http', 'https', $path);
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue