Merge pull request #3718 from vishal-webkul/issue3564

Issue #3564 resolved
This commit is contained in:
Jitendra Singh 2020-08-13 15:42:04 +05:30 committed by GitHub
commit 4d00f4fcc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

View File

@ -194,6 +194,21 @@ return [
'type' => 'boolean',
],
],
], [
'key' => 'catalog.products.attribute',
'name' => 'admin::app.admin.system.attribute',
'sort' => 4,
'fields' => [
[
'name' => 'image_attribute_upload_size',
'title' => 'admin::app.admin.system.image-upload-size',
'type' => 'text',
], [
'name' => 'file_attribute_upload_size',
'title' => 'admin::app.admin.system.file-upload-size',
'type' => 'text',
]
],
], [
'key' => 'catalog.inventory',
'name' => 'admin::app.admin.system.inventory',

View File

@ -1262,6 +1262,9 @@ return [
'guest-checkout' => 'Guest Checkout',
'allow-guest-checkout' => 'Allow Guest Checkout',
'allow-guest-checkout-hint' => 'Hint: If turned on, this option can be configured for each product specifically.',
'attribute' => 'Attribute',
'image-upload-size' => 'Allowed Image Upload Size (in Kb)',
'file-upload-size' => 'Allowed File Upload Size (in Kb)',
'review' => 'Review',
'allow-guest-review' => 'Allow Guest Review',
'inventory' => 'Inventory',

View File

@ -91,6 +91,16 @@
array_push($validations, 'decimal');
}
if ($attribute->type == 'file') {
$retVal = (core()->getConfigData('catalog.products.attribute.file_attribute_upload_size')) ? core()->getConfigData('catalog.products.attribute.file_attribute_upload_size') : '2048' ;
array_push($validations, 'size:' . $retVal);
}
if ($attribute->type == 'image') {
$retVal = (core()->getConfigData('catalog.products.attribute.image_attribute_upload_size')) ? core()->getConfigData('catalog.products.attribute.image_attribute_upload_size') : '2048' ;
array_push($validations, 'size:' . $retVal . '|mimes:jpeg, bmp, png, jpg');
}
array_push($validations, $attribute->validation);
$validations = implode('|', array_filter($validations));