Blank Page for Edit Gift Certs


  • Default avatar
    bkrupkin    
     11 years ago
    0

    I am using Joomla 1.5.15 and VirtueMart 1.1.4.

    I have AWOCoupon 1.5.1 installed.

    I have created several gift certificate products, but when i try to edit them, i get a blank page. When i try to create a new gift certificate, it also goes to a blank page.

    any ideas why?

  • Your avatar
    seyi    
     11 years ago
    0

    sounds like a mysql error. Can you go to global configuration and turn debug on then refresh the edit screen. do you see any database errors then?
  • Default avatar
    bkrupkin    
     11 years ago
    0

    With debug on, still just a blank page.
  • Your avatar
    seyi    
     11 years ago
    0

    ok, you must have a php error of some sort

    Access your files, probably through ftp, and go to www/administrator/components/com_awocoupon/admin.awocoupon.php. You should see the line
    <?php
    //ini_set("display_errors", 1); error_reporting(E_ALL);
    ?>


    Uncomment it
    <?php
    ini_set
    ("display_errors"1); error_reporting(E_ALL);
    ?>


    This should turn php debug on. And refresh the page.

    If you prefer I look at it, please send temp admin / ftp access via private message.
  • Default avatar
    bkrupkin    
     11 years ago
    0

    seems like a memory limit error:

    Fatal error: Allowed memory size of 141557760 bytes exhausted (tried to allocate 16777216 bytes)
  • Default avatar
    bkrupkin    
     11 years ago
    0

    could it be because i have too many products and it is trying to load the product list for which to apply the gift certificate? I have over 100K SKUs
  • Your avatar
    seyi    
     11 years ago
    0

    Indeed, that is definitely the problem.

    Here is a fix:

    in www/administrator/com_awocoupon/views/giftcertproduct/view.html.php, around line 34 is this
    <?php
            $document
    ->addStyleSheet(com_awocoupon_ASSETS.'/css/style.css');
    ?>


    Add this after it
    <?php
            $document
    ->addStyleSheet(com_awocoupon_ASSETS.'/css/jquery-ui-1.8.10.autocomplete.css');
            
    $document->addScript(com_awocoupon_ASSETS.'/js/jquery-1.6.4.min.js');
            
    $document->addScript(com_awocoupon_ASSETS.'/js/jquery-ui-1.8.10.autocomplete.min.js');
            
    $document->addScript(com_awocoupon_ASSETS.'/js/jquery.ui.autocomplete.ext.js');
            
    $document->addScript(com_awocoupon_ASSETS.'/js/coupon.js');
            
    $document->addScript(com_awocoupon_ASSETS.'/js/coupon_cumulative_value.js');
    ?>


    in www/administrator/com_awocoupon/views/giftcertproduct/tmpl/default.php, around line 11 is this
    <script language="javascript" type="text/javascript">


    add this after it
    var $j = jQuery.noConflict();  // added so jquery does not conflict with mootools

    $j(document).ready(function() {
        $j( "#product_id_search" )
            .autocomplete({
                source: function( request, response ) {
                    $j.getJSON( 
                        "<?php echo JURI::base(true); ?>/index.php", 
                        {option:"com_awocoupon", task:'ajax_elements', type:'product', tmpl:'component', no_html:1,term: request.term}, 
                        response 
                    );
                },
                minLength: 2,
                selectFirst: true,
                delay:0,
                select: function( event, ui ) { if(ui.item) document.adminForm.product_id.value = ui.item.id; }
            })
            .attr("parameter_id", document.adminForm.product_id.value)
            .bind("empty_value", function(event){ document.adminForm.product_id.value = ''; })
            .bind("check_user", function(event){ return; })
        ;
        
        if( typeof Joomla != 'undefined' ){
            Joomla.submitbutton = submitbutton;
        }
    });


    Then around line 85 is this
            <td><?php if(!empty($this->row->id)) echo $this->row->product_name.' ('.$this->row->product_sku.') <input type="hidden" name="product_id" value="'.$this->row->product_id.'" />'
                        else echo 
    $this->lists['productlist']; ?></td>


    replace with this
            <td><?php if(!empty($this->row->id)) echo $this->row->product_name.' ('.$this->row->product_sku.') <input type="hidden" name="product_id" value="'.$this->row->product_id.'" />'
                        else echo 
    '<input type="text" size="30" value="" id="product_id_search" class="inputbox ac_input"/>'?>
                        <input type="hidden" name="product_id" value="<?php echo $this->row->product_id?>" /></td>



    You can then type in the product and get a dropdown, instead of trying to load everything at once.
  • Default avatar
    bkrupkin    
     11 years ago
    0

    unfortunately, still same result after these fixes have been implemented
  • Your avatar
    seyi    
     11 years ago
    0

    then I have no idea. The only other thing you can do is start deleting items from the default.php page until it loads to figure out what is causing it to die.

    Also try commenting out these section of code in view.html.php
    <?php
            $states
    =array();
            
    $states[] = JHTML::_('select.option''''');
            foreach(
    $productlist as $key=>$value$states[] = JHTML::_('select.option'$value->product_id$value->product_name.' ('.$value->product_sku.')');
            
    $lists['productlist'] = JHTML::_('select.genericlist'$states'product_id''class="inputbox" style="width:147px;"''value''text'$row->product_id );        
    ?>


  • Default avatar
    bkrupkin    
     11 years ago
    0

    that did it!

    now, when i am trying to update and save an existing gift cert, i get the following:

    DB function failed with error number 1054
    Unknown column 'vendor_name' in 'field list' SQL=UPDATE `jos_awocoupon_giftcert_product` SET `product_id`='2100',`profile_id`='1',`coupon_value`='10.00000',`expiration_number`='1',`expiration_type`='year',`exclude_giftcert`='1',`vendor_name`=NULL,`vendor_email`=NULL,`published`='1' WHERE id='1'

    i checked this DB table and i do not have the columns for vendor_name and vendor_email. maybe they did not get created when i upgraded to 1.5.1?