Accessing line items from Quotes

Hi all,

I am having trouble with what seems like a fairly simple problem, I want to access the line items attached to a quote and do some small operations on the products . I am using an after_save logic hook.

The logic hook does not appear to be retrieving the line items, however when using the same query manually it works as intended.

$sql = "SELECT * FROM aos_products_quotes WHERE parent_type = 'AOS_Quotes' AND parent_id = '".$quote->id."'";

  		$result = $bean->db->query($sql);

		while ($row = $bean->db->fetchByAssoc($result)) {
			
			//Get the product from the line item
			$product_id = $row['product_id'];
			$product = loadBean('AOS_Products');
			$product->retrieve($product_id);
}

If anyone has any thoughts I would be happy to hear them.

Sam