CMS MADE SIMPLE FORGE

CGMyOrders

 

[#7789] Call to undefined method orders_ops::find_by_feu_id()

avatar
Created By: Beatrice Sheldrick (beattie)
Date Submitted: Fri Apr 06 19:32:12 -0400 2012

Assigned To: Robert Campbell (calguy1000)
Version: 1.0
CMSMS Version: 1.10.3
Severity: None
Resolution: None
State: Open
Summary:
Call to undefined method orders_ops::find_by_feu_id()
Detailed Description:
Today (7 April 2012) I upgraded all modules related to CGEcommerce using module
manager. The customer's order history page returns this error:

Fatal error: Call to undefined method orders_ops::find_by_feu_id() in
/home/domainuser/public_html/shop/modules/CGMyOrders/action.default.php on line
66

I uninstalled and reinstalled the CGMyOrders module but the error breaks the
page.


History

Comments
avatar
Date: 2012-04-24 05:37
Posted By: info andries (andriesinfoserv)

i can confirm this. 
php 5.4 
cgmyorder 1.0
cmsms 1.10.3
severity critical
      
avatar
Date: 2012-05-17 05:45
Posted By: Gianluca Savini (gianlucasavini)

Same for me here

Version CMS		1.10.3
CGExtensions		1.28.2
CGEcommerceBase		1.3.11
CGSimpleSmarty		1.5
CGPaymentGatewayBase		1.1
Orders		1.13.3
CGMyOrders		1.0
      
avatar
Date: 2012-06-10 18:17
Posted By: Prue Rowland (psy)

Yep, happened to me too.

Version CMS		1.10.3
CGExtensions		1.29.1
CGEcommerceBase		1.3.11
CGSimpleSmarty		1.5
CGPaymentGatewayBase		1.1
Orders		1.13.3
CGMyOrders		1.0

      
avatar
Date: 2012-06-10 18:18
Posted By: Prue Rowland (psy)

Correcton, the error message was slightly different.

Fatal error: Call to undefined method orders_ops::find_by_billing_email() in
/home/dou18539/public_html/modules/CGMyOrders/action.default.php on line 54


      
avatar
Date: 2012-07-04 10:58
Posted By: Mathieu Muths (airelibre) (airelibre)

Some functions seems to have been removed...

Temporary fix, copy : 


static public function find_by_billing_email($email,$limit = null,$offset =
null)
  {
    if( !$email ) return;

    $db = cmsms()->GetDb();
$query = 'SELECT id FROM '.cms_db_prefix().'module_orders WHERE
billing_email = ? ORDER BY modified_date';
    $list = null;
    if( $limit > 1 && $offset >= 0 )
      {
	$list = $db->SelectLimit($query,$limit,$offset,array($email));
      }
    else
      {
	$list = $db->GetCol($query,array($email));
      }
    return $list;
  }


  static public function find_by_feu_id($feu_uid,$limit = null,$offset = null)
  {
    if( $feu_uid <= 0 ) return;

    $db = cmsms()->GetDB();
$query = 'SELECT id FROM '.cms_db_prefix().'module_orders WHERE feu_user_id
= ? ORDER BY modified_date';
    if( $limit > 1 && $offset >= 0 )
      {
	$list = $db->SelectLimit($query,$limit,$offset,array($feu_uid));
      }
    else
      {
	$list = $db->GetCol($query,array($feu_uid));
      }
    return $list;
  }


  /**
   * Get a summary of order details.
   *
* @param mixed order_id.  Either an integer order id.. or an array of integer
order id's.
* @returns a hash of hashes... key of top level array is the order id...
members contain information about the order.
   */
  static public function get_summary($order_id)
  {
    $qparms = array();
$query = 'SELECT
O.id,O.invoice,O.status,I2.items,I1.weight,I1.total,(I1.total -
IFNULL(P1.paid,0)) AS amtdue,O.create_date,O.modified_date
              FROM '.cms_db_prefix().'module_orders O
LEFT JOIN (SELECT order_id, SUM(weight) AS
weight,SUM(GREATEST(COALESCE(master_price,0),quantity*unit_price))+SUM(quantity*COALESCE(discount,0))
                             AS total 
                             FROM '.cms_db_prefix().'module_orders_items 
                             GROUP BY order_id) 
                             AS I1 ON O.id = I1.order_id
                  LEFT JOIN (SELECT order_id, SUM(quantity) AS items 
                             FROM '.cms_db_prefix().'module_orders_items 
                             WHERE item_type = ? OR item_type = ?
                             GROUP BY order_id)
                             AS I2 ON O.id = I2.order_id
                  LEFT JOIN (SELECT order_id,SUM(amount) AS paid
                             FROM '.cms_db_prefix().'module_orders_payments
                             GROUP BY order_id)
                             AS P1 ON O.id = P1.order_id';
    $qparms[] = '0_product';
    $qparms[] = '1_service';

    if( is_array($order_id) )
      {
	$tmp = array();
	for( $i = 0; $i < count($order_id); $i++ )
	  {
	    if( $order_id[$i] > 0 ) $tmp[] = $order_id[$i];
	  }
	if( !is_array($tmp) || count($tmp) == 0 )
	  {
	    // nothing to query, so nuke the query var.
	    $query = '';
          }
	else
	  {
	    $query .= ' WHERE O.id IN ('.implode(',',$tmp).')';
	  }
      }
    else if( is_int($order_id) && $order_id > 0 )
      {
	$query .= ' WHERE O.id = ?';
	$qparms[] = $order_id;
      }
    else
      {
	// something wierd
	return;
      }

    if( !$query ) return;

    $db = cmsms()->GetDb();
    $tmp = $db->GetArray($query,$qparms);
    if( is_array($tmp) && count($tmp) )
      {
	$results = cge_array::to_hash($tmp,'id');
	return $results;
      }
  }


in Orders/lib/class.orders_ops.php
      
avatar
Date: 2012-12-16 19:20
Posted By: Toff. (toff)

Thanks Mathieu. Once again you saved the day ;)
(salut bisame !)