Product SKU
-
Can I change the SKU of product table from integer to string?
Will there be any problem?I'm using Bagisto - 0.1.9
-
@RK-REZA
SKU column in the product table is already in string
you can check here,
https://github.com/bagisto/bagisto/blob/v0.1.9/packages/Webkul/Product/src/Database/Migrations/2018_07_27_065727_create_products_table.php#L18 -
Thanks @Vaishali-Agarwal
-
Even though the sku is varchar, i cannot input a string in the sku space from the admin panel
-
@Deepanjali
SKU accepts only valid characters are alphanumeric, as well as underscore (_) and dash(-), it doesn't allow spaces. -
@RK-REZA or you can change this slug file
https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Core/src/Contracts/Validations/Slug.php@Vaishali-Agarwal
the default value of the 'SKU Check' is thisreturn preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value);
Only accept lowercase
why not likereturn preg_match('/^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/', $value);
so it accepts the uppercase also..
-
@otheriz
Kindly check this https://github.com/bagisto/bagisto/issues/2805 , post your suggestion if according to you sku should be in caps. -
@Vaishali-Agarwal I'm entering a string 'H40' but it is showing invalid![alt text]( image url)
-
@Deepanjali
kindly add the sku in this format "h40" as capital letters are not allowed -
@Vaishali-Agarwal Okay,Thank you!