fix product associated optionnal data
This commit is contained in:
parent
64868010d4
commit
f30c6cff18
1 changed files with 12 additions and 12 deletions
|
|
@ -259,7 +259,7 @@ class ProductsController extends Controller
|
|||
$rangeId = $request->range_id;
|
||||
$taxRateId = $request->tax_rate_id;
|
||||
|
||||
$this->checkSlugExistsWithinRange($rangeId, $slug, $product->id, $request);
|
||||
$this->checkSlugExistsWithinRange($request, $rangeId, $slug, $product->id);
|
||||
|
||||
$this->manageProductImages($request->picture, $product, $request->picture_large);
|
||||
|
||||
|
|
@ -310,13 +310,13 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* Check if slug already exists, if so redirect
|
||||
*
|
||||
* @param integer $rangeId
|
||||
* @param string $slug
|
||||
* @param integer $productId
|
||||
* @param Request $request
|
||||
* @param Request $request
|
||||
* @param integer $rangeId
|
||||
* @param string $slug
|
||||
* @param integer|null $productId
|
||||
* @return \Illuminate\Http\RedirectResponse|void
|
||||
*/
|
||||
private function checkSlugExistsWithinRange(int $rangeId, string $slug, int $productId, Request $request)
|
||||
private function checkSlugExistsWithinRange(Request $request, int $rangeId, string $slug, int $productId = null)
|
||||
{
|
||||
// Check si le slug existe déjà dans cette gamme de produits.
|
||||
$slugExist = Product::where([
|
||||
|
|
@ -409,11 +409,11 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* sync tags to product
|
||||
*
|
||||
* @param array $tags
|
||||
* @param Product $product
|
||||
* @param array|null $tags
|
||||
* @param Product $product
|
||||
* @return void
|
||||
*/
|
||||
private function syncTags(array $tags, Product &$product)
|
||||
private function syncTags(array $tags = null, Product &$product)
|
||||
{
|
||||
if (!empty($tags)) {
|
||||
$arTagIds = array();
|
||||
|
|
@ -436,11 +436,11 @@ class ProductsController extends Controller
|
|||
/**
|
||||
* sync associated products to product
|
||||
*
|
||||
* @param string $prods
|
||||
* @param Product $product
|
||||
* @param string|null $prods
|
||||
* @param Product $product
|
||||
* @return void
|
||||
*/
|
||||
private function syncProduitsAssocies(string $prods, Product $product)
|
||||
private function syncProduitsAssocies(string $prods = null, Product $product)
|
||||
{
|
||||
if (!empty($prods)) {
|
||||
$productIds = explode(",", $prods);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue