• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Product SKU

General Discussion
4
10
907
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    RK REZA last edited by 5 Mar 2020, 05:01

    Can I change the SKU of product table from integer to string?
    Will there be any problem?

    I'm using Bagisto - 0.1.9

    1 Reply Last reply Reply Quote 0
    • V
      Vaishali Agarwal last edited by 5 Mar 2020, 07:54

      @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

      1 Reply Last reply Reply Quote 0
      • R
        RK REZA last edited by 5 Mar 2020, 11:35

        Thanks @Vaishali-Agarwal

        1 Reply Last reply Reply Quote 0
        • 5 months later
        • D
          Deepanjali last edited by 10 Aug 2020, 05:27

          Even though the sku is varchar, i cannot input a string in the sku space from the admin panel

          1 Reply Last reply Reply Quote 0
          • V
            Vaishali Agarwal last edited by 10 Aug 2020, 14:49

            @Deepanjali
            SKU accepts only valid characters are alphanumeric, as well as underscore (_) and dash(-), it doesn't allow spaces.

            D 1 Reply Last reply 13 Aug 2020, 04:45 Reply Quote 0
            • O
              otheriz last edited by 11 Aug 2020, 03:00

              @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 this

              return preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value);
              

              Only accept lowercase
              why not like

              return preg_match('/^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/', $value);
              

              so it accepts the uppercase also..

              1 Reply Last reply Reply Quote 0
              • V
                Vaishali Agarwal last edited by 11 Aug 2020, 15:58

                @otheriz
                Kindly check this https://github.com/bagisto/bagisto/issues/2805 , post your suggestion if according to you sku should be in caps.

                1 Reply Last reply Reply Quote 1
                • D
                  Deepanjali @Vaishali Agarwal last edited by 13 Aug 2020, 04:45

                  @Vaishali-Agarwal I'm entering a string 'H40' but it is showing invalid![alt text](832a5830-edfc-4bed-a46e-89b27a804475-image.png image url)

                  1 Reply Last reply Reply Quote 0
                  • V
                    Vaishali Agarwal last edited by 13 Aug 2020, 05:15

                    @Deepanjali
                    kindly add the sku in this format "h40" as capital letters are not allowed

                    D 1 Reply Last reply 13 Aug 2020, 09:13 Reply Quote 0
                    • D
                      Deepanjali @Vaishali Agarwal last edited by 13 Aug 2020, 09:13

                      @Vaishali-Agarwal Okay,Thank you!

                      1 Reply Last reply Reply Quote 0
                      7 out of 10
                      • First post
                        7/10
                        Last post