Gift Certificate / Secret Code Question


  • Default avatar
    donald6    
     11 years ago
    0

    I installed the AWO Tracker, and created a menu to display the form to look up coupons. The feedback I am getting is that people would like to have their gift certificate balance automatically load when they are logged in. I understand that this is not possible now (Maybe a future function?)

    Without that capability, the thing that people would like to have is a more simple coupon code and not have to enter two codes (secret code) to look up the balance. I will be using the Gift Certificates as sort of a "pre-paid" gift function. For instance, Realtors will purchase a gift certificate for $100, and then have their administrative assistants send out thank-you gifts to their clients as they need them. They do not want to enter multiple complex codes each time to check their balance.

    Is there any way to control the coupon code that is generated when the gift certificate is purchased in the shopping cart? Also, is there a way to eliminate the need to enter the secret code on the lookup form?

    I understand that the more complex the code, the less likely someone has to guess the code, but my clients want quick ways to look up the balance.

    Thank You
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    You could upload your own codes if you do not like the automatically generated ones. Or you could alter the function that generates the codes. You can find this function in
    www/administrator/components/com_awocoupon/helpers/plgautogenerate.php, function generateCouponCode

    And yes, you could programatically disable the secret code in
    www/components/com_awotracker/models/coupon.php in function getcoupondetails is this:
    <?php
            $this
    ->_db->setQuery('SELECT id FROM #__awocoupon WHERE estore="'.$this->estore.'" AND coupon_code="'.$this->_db->getEscaped(@$post->coupon_code).'" AND passcode="'.$this->_db->getEscaped(@$post->passcode).'" AND published IN (1,-1)');
    ?>


    change it to this
    <?php
            $this
    ->_db->setQuery('SELECT id FROM #__awocoupon WHERE estore="'.$this->estore.'" AND coupon_code="'.$this->_db->getEscaped(@$post->coupon_code).'" AND published IN (1,-1)');
    ?>


    Then hide the field within the template.
  • Default avatar
    donald6    
     11 years ago
    0

    Thanks. I changed the length of the coupon code generator, and disabled the secret key. On the coupon code input form for the customer, it still has the field that says "secret key" with the input box and the astericks that says it's a required field. When I enter just the coupon code, it successfully brings up the coupon details.

    How would I change the form to hide the secret key input field?
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    You can edit the template, here is the file:
    www/components/com_awotracker/views/coupon/tmpl/default.php

    You can either edit it directly or copy it to
    www/templates/[your template]/html/com_awotracker/coupon/default.php

    Change
    <input type="text" name="passcode" value="<?php echo @$this->coupon_row->passcode;?>" />


    to a hidden field and put in a random value as such
    <input type="hidden" name="passcode" value="randomvalue" />


    And you can remove the label for it.