blank page when trying to create new coupon


  • Your avatar
    seyi    
     5 years ago
    0

    when i select the icon to create a new coupon, the resulting page is completely blank...just white page. what could be the cause of this? how do I fix?
  • Default avatar
    bkrupkin    
     5 years ago
    0

    ps....just upgraded to 1.4.1 pro version of awocoupon
  • Default avatar
    bkrupkin    
     5 years ago
    0

    does the number of products on my site have anything to do with how that page renders? i added over 10K new skus in the past few weeks. Not sure if this has anything to do with why the coupon creation page will not load.
  • Your avatar
    seyi    
     5 years ago
    0

    this might very well be the problem and the page is out of memory as it is trying to display all the products. If you could turn on errors, you would probably see a memory error. Do you get the same thing when you go to awocoupon->gift certificates->new?
  • Default avatar
    bkrupkin    
     5 years ago
    0

    no, gift certificates works just fine
  • Your avatar
    seyi    
     5 years ago
    0

    Ok, so its loading all the products there. We need to see what the error is, you will need fitp access for this:

    in www/administrator/components/com_awocoupon/admin.awocoupon.php, after <\?php

    enter this on the next line
    <?php
    ini_set
    ("display_errors"1); error_reporting(E_ALL);
    ?>


    then reload the page to see what the error is
  • Default avatar
    bkrupkin    
     5 years ago
    0

    when i paste this code, save and reload the page, now the entire awocoupon admin area is blank.
  • Your avatar
    seyi    
     5 years ago
    0

    did you copy just the coding part?
    ini_set("display_errors", 1); error_reporting(E_ALL);
  • Default avatar
    bkrupkin    
     5 years ago
    0

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1586037 bytes) in ../public_html/libraries/joomla/document/html/html.php on line 389
  • Default avatar
    bkrupkin    
     5 years ago
    0

    i am unable to allocate more memory in my php.ini file as my host controls that. I am on Rochen virtual dedicated server. What are my options to get the coupon create page to load without using so many resources?
  • Your avatar
    seyi    
     5 years ago
    0

    Are you planning on using product specific coupons? We could limit the load to something like the first 1000 products.
  • Default avatar
    bkrupkin    
     5 years ago
    0

    actually, all i really use are product specific coupons. what are your thoughts? can we load products in chunks of 1000 or 2000 instead of all by default? like, page 1, page 2, etc.

  • Default avatar
    bkrupkin    
     5 years ago
    0

    is this possible?
  • Your avatar
    seyi    
     5 years ago
    0

    not very easily, would require a complete rewrite of the add new coupon page.
  • Default avatar
    bkrupkin    
     5 years ago
    0

    hmmm....well, i dont remember seeing that there was a limitation to your product. "will only work with 1000 skus or less" Am willing to pay a bit extra to have it work the way we need to. Let me know. Otherwise, will have to try and find another solution to couponing
  • Your avatar
    seyi    
     5 years ago
    0

    No it did not. Just out of curiosity how many products do you have? I have a site that has over 10,000 products and it loads fine. Its just server limitations.

    Lets test something. Do you currently have any product coupons in awocoupon? If so, go to the coupon list, under the asset column, click on products, then click the new button. Do the products load on that screen?
  • Default avatar
    bkrupkin    
     5 years ago
    0

    currently do not have any coupons in there and due to our conversation, cannot create one :-(
  • Your avatar
    seyi    
     5 years ago
    0

    No worries, here is a solution, requires accessing the AwoCoupon files, and manipulating the url when you want to add a new coupon

    in
    www/administrator/components/com_awocoupon/models/coupon.php
    around line 162 is this:
    <?php
    $query 
    'SELECT product_id,product_name,product_sku,product_id as dd_id,CONCAT(product_name," (",product_sku,")") as dd_name
                FROM #__'
    .VM_TABLEPREFIX.'_product WHERE product_publish="Y" ORDER BY product_name,product_id';
                        
    ?>


    change it to this
    <?php
    $limit 
    = isset($_GET['p1']) && ctype_digit($_GET['p1'])
                ? 
    ' LIMIT '.$_GET['p1'].' '.(!empty($_GET['p2']) && ctype_digit($_GET['p2']) ? ', '.$_GET['p2'] : '')
                : 
    '';
    $query 'SELECT product_id,product_name,product_sku,product_id as dd_id,CONCAT(product_name," (",product_sku,")") as dd_name
                FROM #__'
    .VM_TABLEPREFIX.'_product WHERE product_publish="Y" ORDER BY product_name,product_id '.$limit;
    ?>


    Now from the dashboard, when you click the new icon, it takes you to a url such as this:
    administrator/index.php?option=com_awocoupon&view=coupon


    You can now manipulate that url to show as many products as you want. There are 2 variables, p1 and p2. If you enter just p1, then it limits to that number, if you enter p1 and p2, then p1 is the start and p2 is the limit. So for example

    administrator/index.php?option=com_awocoupon&view=coupon&p1=72

    will show the first 72 products

    administrator/index.php?option=com_awocoupon&view=coupon&p1=156&p2=500

    will show 500 products starting from product 156

  • Default avatar
    bkrupkin    
     5 years ago
    0

    thanks. this will work for now. please try and integrate multiple page option into next release if possible for product selection with 1000 products per page maybe