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

      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

        @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

          Thanks @Vaishali-Agarwal

          1 Reply Last reply Reply Quote 0
          • D
            Deepanjali last edited by

            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

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

              D 1 Reply Last reply Reply Quote 0
              • O
                otheriz last edited by

                @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

                  @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

                    @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

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

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        Deepanjali @Vaishali Agarwal last edited by

                        @Vaishali-Agarwal Okay,Thank you!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post