Cannot export


  • Default avatar
    valval    
     2 years ago
    0

    Having difficulty exporting coupon codes from awocoupon to a CSV file. After pressing the button to run the report, I get the Coupon list but when I click on the excel icon to download the CSV file it then just takes me to a blank page. No excel file is generated or downloaded. Help?

    As a side note, on the generated report page, when attempting to view more coupon codes at a time or move to different pages within the report, nothing happens. The page does not refresh or change.
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    Approximately how many coupons are you trying to export? It might be timing out due to the number of coupons.
  • Default avatar
    valval    
     2 years ago
    0

    That... would explain it. Let's just say there are quite a few. Like more than a couple hundred. - How do I overcome this timing out issue?
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    Is there no way you could filter the coupons using the filters in the reports to a more manageable site for exporitng? Are the coupons created with templates?

    The only other thing I can think of doing is manually editing the code to limit the number of coupons exported.
  • Default avatar
    valval    
     2 years ago
    0

    They are Groupon codes that were generated by Groupon and still active for products that need to be able to be redeemed. So I need to export them out of my current instance and over to my new site. How do I go about editing the code to limit the number of coupons exported?
  • Your avatar
    seyi    
     2 years ago
    0

    Ok, here is what you can do.
    in www/administrator/components/com_awocoupon/models/reports.php, around line 70 is this:
    <?php
            $sql 
    'SELECT *
                      FROM #__awocoupon
                     WHERE estore="'
    .AWOCOUPON_ESTORE.'"
                     '
    .(!empty($function_type) ? 'AND function_type="'.$function_type.'" ' '').'
                     '
    .(!empty($coupon_value_type) ? 'AND coupon_value_type="'.$coupon_value_type.'" ' '').'
                     '
    .(!empty($discount_type) ? 'AND discount_type="'.$discount_type.'" ' '').'
                     '
    .(!empty($template) ? 'AND template_id="'.$template.'" ' '').'
                     '
    .(!empty($published) ? 'AND published="'.$published.'" ' '')
                     ;
    ?>


    Right after that add this:
    <?php
    if($force_all$sql .= ' LIMIT 0,1000 ';
    ?>


    This will print the first 1000 coupons. To export from 1000 to 2000 you would use
    <?php
    if($force_all$sql .= ' LIMIT 1000,1000 ';
    ?>


    The first number is the starting index, and the second number is the number of items to export.