Coupon Code with up to 64 Characters


  • Default avatar
    virtualsoft    
     11 years ago
    0

    Joomla 2.5.6
    Virtuemart 2.0.8
    AwoCoupon Pro Version 2.1.3
    AwoAffiliate 2.1.1


    To be able to use coupon codes of up to 64 Characters I have modified this with PHPmyAdmin in the table jos_awocoupon from varchar(32) to varchar(64).

    After doing this modification everything works fine. But after a while it will automatically be set back to varchar(32) and all coupon codes with more than 32 characters will lose the excess characters.

    Some script in AwoCoupon is reversing my modification in the table jos_awocoupon limiting again the coupon codes to only have a maximum of 32 characters.

    Please let me know which files I do have to modify in order to make the change permanent.

    Hope you can help me to be able to use coupon codes of up to 64 characters.


    For your Info: I am going to use email id’s as coupon codes and occasionally there are email id's which contain more than 32 characters
  • Your avatar
    seyi    
     11 years ago
    0

    it probably happens every time you change a setting withing awocoupon->configuration screen as it alters the coupon code column.

    Take a look at the code within www/administrator/components/com_awocoupon/models/config.php
  • Default avatar
    virtualsoft    
     11 years ago
    0

    Hello Seyi,

    You were absolutely right. The change back to varchar 32 happened when I changed the option of "Case Sensitive Coupon Code" in awocoupon -> configuration.

    I changed the code in www/administrator/components/com_awocoupon/models/config.php in line 77 and 78:

    I changed the code as follows:

    from:

    ? 'ALTER TABLE `#__awocoupon` MODIFY `coupon_code` VARCHAR(32) NOT NULL DEFAULT ""'
    : 'ALTER TABLE `#__awocoupon` MODIFY `coupon_code` VARCHAR(32) BINARY NOT NULL DEFAULT ""'

    to:

    ? 'ALTER TABLE `#__awocoupon` MODIFY `coupon_code` VARCHAR(64) NOT NULL DEFAULT ""'
    : 'ALTER TABLE `#__awocoupon` MODIFY `coupon_code` VARCHAR(64) BINARY NOT NULL DEFAULT ""'

    Hope this will help others with the same problem.