function createList not exists in Prestashop 1.4


  • Default avatar
    alessio    
     9 years ago
    0

    After i choose the payement error, the website give error:

    [Thu Dec 18 10:59:47 2014] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined method OrderDetail::createList() in MYWEBSITE > \modules\awocoupon\awocoupon.php on line 209, referer: http://eursshop.local/modules/cashondelivery/validation.php

    function createList not exists in your module or Prestashop 1.4

    What can i do to fix it???

    Thanks
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    That function does not exist in prestashop 1.4.

    Here is what you can do:
    in www/modules/awocoupon/awocoupon.php, around line 203 is this:

    <?php
    //clear out the order detail tax information
        
    $order_details awohelper::loadObjectList('SELECT id_order_detail FROM #__order_detail WHERE id_order='.(int)$order->id);
        foreach(
    $order_details as $row) {
            
    awohelper::query('DELETE FROM #__order_detail_tax WHERE id_order_detail='.(int)$row->id_order_detail);
        }
        
    awohelper::query('DELETE FROM #__order_detail WHERE id_order='.(int)$order->id);
    }

    # rebuild the order tax information
        
    $order_detail = new OrderDetail();
        
    $product_list $cart->getProducts();
        
    $order_state $order->getCurrentOrderState();
        
        
    // fix stock as it is updated again in createList
        
    foreach($product_list as $product) {
            if (
    $order_state != Configuration::get('PS_OS_CANCELED') && $order_state != Configuration::get('PS_OS_ERROR')) {
                if (!
    StockAvailable::dependsOnStock($product['id_product']))
                    
    $update_quantity StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], (int)$product['cart_quantity']);

                
    Product::updateDefaultAttribute($product['id_product']);
            }
        }
                    
        
    $order_detail->createList(
                    
    $order
                    
    $cart
                    
    $order_state
                    
    $product_list
                    
    $id_order_invoice=0,
                    
    $use_taxes true
                    
    $id_warehouse 0
                
    );
        
    //$order_detail->updateTaxAmount($order);
    }
    ?>


    Please delete those 2 sections. That should get rid of the error you are receiving.