[Resolved] Finding product and customer


  • Default avatar
    Interi    
     14 years ago
    0

    Thank you for this great extension. I installed it today and decided to test it. It took me an hour to run a test though... The reason is the it was really difficult to find particular product that I needed in the list of 6000 products not in alphabetic order, same with particular customer.

    Is there any work around this? Also is there a way to add category to the coupon?

    Thank you again!
  • Your avatar
    seyi    
     14 years ago
    0

    the order of products/customers was an oversite on my part. the next version will be updated to order the product/customers in alphabetical order. And no, have not thought about adding categories. If there is a big enough demand for it, i will look into it.

    In the mean time, if you cant wait and have access to the code, you can make the modifications yourself. Here's how:

    In
    www/administrator/components/com_awocoupon/models/coupon.php

    change line 84
    <?php
    $query 
    'SELECT user_id,first_name,last_name FROM #__'.VM_TABLEPREFIX.'_user_info GROUP BY user_id';
    ?>


    to
    <?php
    $query 
    'SELECT user_id,first_name,last_name FROM #__'.VM_TABLEPREFIX.'_user_info GROUP BY user_id ORDER BY last_name, first_name, user_id';
    ?>


    and line 93
    <?php
    $query 
    'SELECT product_id,product_name FROM #__'.VM_TABLEPREFIX.'_product';
    ?>


    to
    <?php
    $query 
    'SELECT product_id,product_name FROM #__'.VM_TABLEPREFIX.'_product ORDER BY product_name,product_id';
    ?>





    in
    www/administrator/components/com_awocoupon/models/product.php

    change line 70
    <?php
    $sql 
    'SELECT v.product_id,v.product_name
             FROM #__'
    .VM_TABLEPREFIX.'_product v
             LEFT JOIN #__awocoupon_product c ON c.product_id=v.product_id AND c.coupon_id='
    .$this->_id.'
            WHERE c.product_id IS NULL'
    ;
    ?>


    to
    <?php
    $sql 
    'SELECT v.product_id,v.product_name
             FROM #__'
    .VM_TABLEPREFIX.'_product v
             LEFT JOIN #__awocoupon_product c ON c.product_id=v.product_id AND c.coupon_id='
    .$this->_id.'
            WHERE c.product_id IS NULL
            ORDER BY v.product_name, v.product_id'
    ;
    ?>




    in www/administrator/components/com_awocoupon/models/user.php

    change line 69
    <?php
    $sql 
    'SELECT v.user_id,v.first_name,v.last_name
             FROM #__'
    .VM_TABLEPREFIX.'_user_info v
             LEFT JOIN #__awocoupon_user c ON c.user_id=v.user_id AND c.coupon_id='
    .$this->_id.'
            WHERE c.user_id IS NULL
            GROUP BY v.user_id'
    ;
    ?>


    to
    <?php
    $sql 
    'SELECT v.user_id,v.first_name,v.last_name
             FROM #__'
    .VM_TABLEPREFIX.'_user_info v
             LEFT JOIN #__awocoupon_user c ON c.user_id=v.user_id AND c.coupon_id='
    .$this->_id.'
            WHERE c.user_id IS NULL
            GROUP BY v.user_id
            ORDER BY v.last_name, v.first_name, v.user_id'
    ;
    ?>
  • Default avatar
    kerper    
     14 years ago
    0

    I just want to say thank you for posting the hack prior to your release of a new version. I made the changes above and everything is now in proper order and MUCH more usable! I love this component. Adds functionality Virtuemart should have had in the first place!
  • Your avatar
    seyi    
     14 years ago
    0

    the ordering problem as been fixed in version 1.0.1.