Announcement

Collapse
No announcement yet.

SQL population of Discount

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SQL population of Discount

    2 tables in the database hold the cart level discounts.. "DiscountTriggers" and "Discounts". I can manually add rows to each with the common "nDiscountID" fields fine.

    We will be running a promotion which requires approx 10,000 unique coupon codes. I know this is not ideal but we have to provide unique codes for the campaign (this is a demand by the 3rd party to whom we are offering the deals - their customers redeem coupons and are generated a unique code when they have enough on the 3rd party website - the code is used on our site to get the deal). Reusing the same code is not an option.

    Couple of questions if anyone can help :

    1. is there a limit to the number of rows which can be added
    2. nSequence - is there are limit or is it simply incremental
    3. any suggestions on how to populate the codes via a query for both tables - I can get the unique codes in either Excel or a Database but admit to not having much experience with manipulating databases and don't fancy a weeks worth of copy and paste into the tables.

    Multisite v8.5.0


    Bikster
    SellerDeck Designs and Responsive Themes

    #2
    Point 3 is taken care of as the 3rd party are populating the tables

    If anyone knows if there is a limit to the number of codes and if nSequence is simply incremental that would be great.


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      I now have 3 offers with 10,000 coupon codes - as each needs a unique nID this makes 30,000 entries into "Discount" and "Discount Triggers" tables

      Any ideas on how this will stand up?


      Bikster
      SellerDeck Designs and Responsive Themes

      Comment


        #4
        Originally posted by jont View Post
        Any ideas on how this will stand up?
        Horizontal and frothing at the mouth is my guess, no way Jose, not on your nelly IMO.

        Comment


          #5
          They are populating the tables at the moment ... I am not expecting great things ... thankfully there are only about 250ish products on the site so not a massive site ... the discount code page is going to be heavier than the whole site put together


          Bikster
          SellerDeck Designs and Responsive Themes

          Comment


            #6
            Hi Jont,

            I put your questions to development and got the following answers:

            1. is there a limit to the number of rows which can be added
            no

            2. nSequence - is there are limit or is it simply incremental
            it just has to be unique for each row.

            I hope this helps.
            ********************
            Tracey
            SellerDeck

            Comment


              #7
              Great news - thanks for checking Tracey - much appreciated.


              Bikster
              SellerDeck Designs and Responsive Themes

              Comment


                #8
                Let us know what performance is like Jonty, i'm intrigued. I fancy the file to be huge and quite a long process to look up with that many entries, but hopefully I am wrong.

                Comment


                  #9
                  I hope you are too matey - it is one thing being able to store the data but another in keeping the site usable. I will update the thread once I have the blighters in place.


                  Bikster
                  SellerDeck Designs and Responsive Themes

                  Comment


                    #10
                    1058 coupon codes installed as a test - no performance hit as the weight on the .FIL file is not that much bigger in real world terms. Only another 29,000 to populate

                    Even v8.50 seems to be holding stable!


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      Aarrghh

                      The discount.fil has 6003 lines of coupon codes - the Actinic database is stable but slow but when simply adding a product to cart (no coupon involved yet) it returns the following browser error:

                      Error: Error loading configuration file ../acatalog/discounts.fil. (in cleanup) Out of memory during "large" request for 4198400 bytes, total sbrk() is 62808064 bytes at (eval 32) line 1.

                      Local discounts.fil is 3,257kb

                      Is there anything that can be tweaked in the .pl to overcome this?


                      Bikster
                      SellerDeck Designs and Responsive Themes

                      Comment


                        #12
                        i feel that you could.

                        can you reduce the data used for the coupons? perhaps use hex, instead of numbers?

                        you'd find less data is stored, cut down on everything.

                        the limitation will still happen eventually however.

                        Comment


                          #13
                          The coupon codes themselves are 8 digits and randomly generated by a 3rd party - these are integrated into their online system (buyers redeem coupons on carton to get points - there are 5 levels of points with 8,000 unique coupons in each level).

                          If I can't resolve under Actinic I think it will be a case of using 500 per level and strip and replace with new as redeemed... which will be fun!!!


                          Bikster
                          SellerDeck Designs and Responsive Themes

                          Comment


                            #14
                            i think you can get around this by creating 5 coupon codes.

                            you could then externally keep the codes, and when one of them is used, you could insert the corresponding actinic code into the coupon field.

                            this field should be hidden on the site type="hidden" if this happens, to stop people generally using one of the 5 features of the codes.

                            store your coupon codes in a simply mysql database and do some code trickery, to insert 1 of 5 codes ,depending on the usage of the code.

                            this, in effect, is a single use coupon system.

                            once a code is recognised and used, you'd ahve to remove it from the db. this stops people from using it again.

                            Comment


                              #15
                              if you like, i can write this system for you. (or at the very least, give it a jolly good go)

                              Comment

                              Working...
                              X