Merge branch 'bagisto/master' into fix-search-when-missing-term

This commit is contained in:
Florian Bosdorff 2020-06-05 08:13:11 +02:00
commit f17a3910f0
6 changed files with 44 additions and 5 deletions

View File

@ -2,6 +2,7 @@
return array (
'save' => 'Speichern',
'copy-of' => 'Kopie von',
'create' => 'Erstellen',
'update' => 'Update',
'delete' => 'Löschen',

View File

@ -2,6 +2,7 @@
return [
'save' => 'Save',
'copy-of' => 'Copy of',
'create' => 'Create',
'update' => 'Update',
'delete' => 'Delete',

View File

@ -85,10 +85,21 @@ class CartRuleController extends Controller
$copiedCartRule = $originalCartRule
->replicate()
->fill(['status' => 0]);
->fill([
'status' => 0,
'name' => __('admin::app.copy-of') . ' ' . $originalCartRule->name,
]);
$copiedCartRule->save();
foreach ($copiedCartRule->channels as $channel) {
$copiedCartRule->channels()->save($channel);
}
foreach ($copiedCartRule->customer_groups as $group) {
$copiedCartRule->customer_groups()->save($group);
}
return view($this->_config['view'], [
'cartRule' => $copiedCartRule,
]);

View File

@ -93,7 +93,7 @@ class Bundle extends AbstractType
ProductRepository $productRepository,
ProductAttributeValueRepository $attributeValueRepository,
ProductInventoryRepository $productInventoryRepository,
productImageRepository $productImageRepository,
ProductImageRepository $productImageRepository,
ProductBundleOptionRepository $productBundleOptionRepository,
ProductBundleOptionProductRepository $productBundleOptionProductRepository,
ProductImage $productImageHelper,

View File

@ -2,4 +2,4 @@
@section('title', __('Service Unavailable'))
@section('code', '503')
@section('message', __($exception->getMessage() ?: 'Service Unavailable'))
@section('message', __($exception->getMessage() ?: 'Srvice Unavailable'))

View File

@ -3,6 +3,7 @@
namespace Tests\Functional\CartRule;
use FunctionalTester;
use Illuminate\Support\Facades\DB;
use Webkul\CartRule\Models\CartRule;
class CartRuleCopyCest
@ -16,19 +17,44 @@ class CartRuleCopyCest
'status' => 1,
]);
$count = count(cartRule::all());
DB::table('cart_rule_channels')->insert([
'cart_rule_id' => $original->id,
'channel_id' => 1,
]);
DB::table('cart_rule_customer_groups')->insert([
'cart_rule_id' => $original->id,
'customer_group_id' => 1,
]);
$count = count(CartRule::all());
$I->amOnAdminRoute('admin.cart-rules.copy', ['id' => $original->id]);
$I->seeRecord(CartRule::class, [
'id' => $original->id + 1,
'status' => 0,
'name' => $original->name,
'name' => 'Copy of ' . $original->name,
]);
$I->assertCount($count + 1, CartRule::all());
$I->assertEquals(
DB::table('cart_rule_channels')
->pluck('cart_rule_id', 'channel_id')
->toArray(),
[1 => $original->id + 1]
);
$I->assertEquals(
DB::table('cart_rule_customer_groups')
->pluck('cart_rule_id', 'customer_group_id')
->toArray(),
[1 => $original->id + 1]
);
$I->seeResponseCodeIsSuccessful();
$I->seeCurrentRouteIs('admin.cart-rules.copy');
}
}