
55 Cal.Rptr.3d 243 (2007)
147 Cal.App.4th 1249
Hye Young YOO, Plaintiff and Respondent,
v.
Sue JHO, Defendant and Appellant.
No. B189586.
Court of Appeal of California, Second District, Division Three.
February 23, 2007.
*244 Gary A. Laff; and Lawrence P. House for Defendant and Appellant.
Park & Lim, Cerritos, S. Young Lim and Glyn E. Lewis, Cerritos, for Plaintiff and Respondent.
KLEIN, P.J.
Defendant and appellant Sue Jho (Jho) (hereafter, seller) appeals a judgment awarding $103,250 in damages to plaintiff and respondent Hye Young Yoo (Yoo) (hereafter, buyer) following a court trial.
The trial court, in an attempt to do equity, awarded partial rescission to the plaintiff. The essential issue presented is whether, due to the illegal object of the contract, i.e., the sale of a business dealing in counterfeit goods, the trial court erred in entertaining the action and in awarding any relief.
We conclude the illegal object of the contract precludes any recovery. Further, notwithstanding the failure of either party to raise the issue below, the trial court should have raised the issue of illegality on its own motion in order to dispose of the matter. "`"No principle of law is better settled than that a party to an illegal contract cannot come into a court of law and ask to have his illegal objects carried out."'" (Wong v. Tenneco, Inc. (1985) 39 Cal.3d 126, 135, 216 Cal.Rptr. 412, 702 P.2d 570.) In a case like the one before us, the law will leave the parties as *245 it finds them. Therefore, the judgment is reversed with directions.[1]

FACTUAL AND PROCEDURAL BACKGROUND

1. Pleadings.

On March 16, 2004, buyer filed a complaint against seller alleging causes of action for, inter alia, breach of contract and fraud. The action arose out of buyer's purchase of seller's business, P.K. Place, a retail store located in Cathedral City, for a price of $400,000. Buyer pled seller falsely represented the business had annual gross sales of $700,000 and annual net income of $500,000.
The operative first amended complaint also included causes of action for "rescission based on fraud" (eighth cause of action) and "rescission based on failure of consideration" (ninth cause of action). Buyer also sought attorney fees pursuant to an attorney fees provision in the business purchase agreement.
In addition to answering the complaint, seller filed a cross-complaint against buyer, seeking to recover, inter alia, $20,000 pursuant to an oral contract. Seller alleged that shortly before close of escrow, seller loaned buyer $20,000 to complete the purchase of the business and that buyer had refused to repay the loan.

2. Proceedings.

On September 21, 2005, the matter came on for trial. The evidence showed:
In July 2002, buyer learned from her Century 21 real estate agent, Mona Kwon (Kwon), that the subject business was for sale. The business was a boutique selling women's clothing and accessories and was located in a shopping center on Palm Canyon Drive.
From the outset, buyer was aware the business was substantially involved in the sale of counterfeit merchandise. On one of buyer's visits to the store before she bought the business, seller informed buyer that "about less than thirty percent" of the sales receipts came from counterfeit merchandise such as fake Louis Vuitton and Gucci bags. Buyer testified she asked seller, "Isn't this illegal?" and seller responded that "while she was in business, she had no problems."
Similarly, Kwon, buyer's agent, testified she informed buyer that the business sold counterfeit goods. According to Kwon, she informed buyer "that 30 percent of the sales volume . . . was based on counterfeit goods." Kwon testified buyer "was very interested in the counterfeits" and that buyer intended to continue selling counterfeit goods after she purchased the business.
On August 15, 2002, the parties entered into a contract for the purchase and sale of *246 the business for $400,000, with a 10-month escrow.
After purchasing the business, buyer moved it to a different location within the same shopping center. In January 2005, investigators came to the store and removed counterfeit merchandise. In June 2005, with business declining, buyer closed down the store.

3. Trial court's rulings.

The trial court granted a motion by seller for nonsuit on buyer's cause of action for breach of contract.
At the conclusion of testimony, the court addressed the remaining causes of action in a lengthy discussion with counsel. In essence, the trial court ruled buyer was entitled to partial rescission and ordered seller to repay buyer $125,000 of the $400,000 purchase price.
The trial court stated: "This is a case where the court feels definitely much more like Solomon than a trier of fact. There came a point in the testimony of the individual parties that I felt that there was noticeable misstatements by both sides and struggled to find a consistent element of truth in the overall testimony, [¶] The part of me that really does want to do an equitable decision because I don't believe this is a case that warrants an all-or-nothing approach. . . ."
The trial court found for buyer on the eighth and ninth causes of action for rescission, stating: "I do believe the evidence is fairly convincing that plaintiff intended to sell counterfeit, obviously did sell counterfeit, and I believe the reasonable argument is that  the reasonable conclusion is that plaintiff in fact sold counterfeit from day one up to the time that she was caught. [¶] We now have two people that sell counterfeit goods. They have both been caught.[2] They both are such that I do think that there is unclean hands all around, but I don't think it makes me say zero. I don't have any insight or any additional wisdom to say what's the proper way to resolve this. I do think that the plaintiff must take on more of a burden for the decision to buy this business. I have not found any evidence that the defendant went out of their way to find plaintiff or found her to be in a weak position. [¶] At the outset, at least, plaintiff clearly entered into the decision to buy it, bought it knowing there was some counterfeit being sold and was clearly taking the risk. [¶] So as to the $400,000 purchase price, with the rescission, the business goes back to defendant. But I decide that the full $400,000 is not paid back to the plaintiff. $125,000 is to be paid by the defendant to the plaintiff. [¶] I candidly do not have a formula. I don't have anything other than as I indicated that more of the blame, if you will, for the overall situation lies with the plaintiff, and I think that anything more than $200,000 to be paid by the defendant would not be fair, and I think the most equitable way to resolve this, as I said, is that the business  the contract is rescinded or that the business goes back to the defendant, and defendant pays $125,000 to the plaintiff." (Italics added.)
On the cross-complaint, the trial court ruled seller was entitled to recover $21,750 against buyer.
Therefore, the trial court entered a net judgment in favor of buyer in the amount of $103,250.
The trial court also ruled there was no prevailing party and therefore neither party was entitled to attorney fees.
*247 On March 3, 2006, seller filed a timely notice of appeal from the judgment.

CONTENTIONS
Seller contends: the trial court erred in granting judgment in favor of the buyer on her eighth and ninth causes of action for rescission; the trial court erred in granting rescission because rescission was a factual and legal impossibility under the circumstances; the trial court erred in granting judgment in favor of the buyer for partial rescission of the contract; and the trial court erred in determining there was no prevailing party on the contract because the trial court had granted nonsuit in favor of seller on buyer's cause of action for breach of contract, making seller the prevailing party.

DISCUSSION

1. Due to the illegal object of the contract, the trial court erred in awarding any relief[3]
The trial court found "plaintiff [buyer] intended to sell counterfeit, obviously did sell counterfeit, and I believe the reasonable argument is that  the reasonable conclusion is that plaintiff in fact sold counterfeit from day one up to the time that she was caught."
This finding is amply supported by the evidence, including the testimony of the buyer as well as the testimony of Kwon, the buyer's agent. To reiterate, Kwon testified buyer "was very interested in the counterfeits" and that buyer intended to continue selling counterfeit goods after she purchased the business.
Thus, the evidence established both parties entered into the business purchase agreement with the knowledge that the business was substantially involved in the sale of counterfeit goods, and buyer specifically intended to continue selling such merchandise after taking over the business.
As indicated, "`"[n]o principle of law is better settled than that a party to an illegal contract cannot come into a court of law and ask to have his illegal objects carried out,"'" (Wong v. Tenneco, Inc., supra, 39 Cal.3d at p. 135, 216 Cal.Rptr. 412, 702 P.2d 570.) The courts "generally will not enforce an illegal bargain or lend their assistance to a party who seeks compensation for an illegal act." (Lewis Queen v. N.M. Ball Sons (1957) 48 Cal.2d 141, 150, 308 P.2d 713; accord Yuba Cypress Housing Partners, Ltd. v. Area Developers (2002) 98 Cal.App.4th 1077, 1082, 120 Cal.Rptr.2d 273 (Yuba); see, e.g., Bovard v. American Horse Enterprises, Inc. (1988) 201 Cal.App.3d 832, 837, 839-841, 247 Cal.Rptr. 340 [corporation predominantly produced paraphernalia used to smoke marijuana, making contract for sale of the corporation illegal and void]; Geffen v. Moss (1975) 53 Cal.App.3d 215, 225-227, 125 Cal.Rptr. 687 [contract to purchase the "good will" of a law practice invalid and unenforceable].)
The reason for judicial refusal to enforce a contract which has an illegal object "is not that the courts are unaware of possible injustice between the parties, and that the defendant may be left in possession of some benefit he should in good conscience turn over to the plaintiff, but that this consideration is outweighed by the importance of deterring illegal conduct. Knowing that they will receive no help from the courts and must trust completely to each other's good faith, the parties are less likely to enter an illegal arrangement in *248 the first place." (Lewis Queen v. N.M. Ball Sons, supra, 48 Cal.2d at p. 150, 308 P.2d 713; accord Yuba, supra, 98 Cal. App.4th at p. 1082, 120 Cal.Rptr.2d 273.)
In awarding partial rescission to buyer, the trial court apparently attempted to do equity by apportioning fault and awarding damages to buyer to the extent the business did not involve counterfeit goods. However, Civil Code section 1608 provides: "If any part of a single consideration for one or more objects, or of several considerations for a single object, is unlawful, the entire contract is void." (See, e.g., Bovard v. American Horse Enterprises, Inc., supra, 201 Cal.App.3d at p. 838, 247 Cal. Rptr. 340.) Here, irrespective of whether counterfeit goods accounted for 30 percent or 70 percent of sales receipts, the business was substantially involved in the sale of counterfeit goods, rendering the object of the business purchase agreement illegal.
Buyer also contends the business purchase agreement did not include a transfer of the store's inventory and therefore buyer was entitled to seek redress for her grievances in a court of law. The argument fails. Even assuming the sale of the business for $400,000 did not include a transfer of the store's inventory, the business was sold as a going concern. Included in the sale was the goodwill of the business, which included a customer base which patronized the store specifically because it carried contraband merchandise. Therefore, at least part of the consideration was unlawful, rendering the entire contract void. (Civ. Code, 1608.)
Under these circumstances, the parties were precluded from utilizing the court to enforce their illegal bargain.

2. The trial court should have raised the issue of illegality on its own motion.

Neither party raised the issue of illegality below and in ruling on the matter, the trial court simply attempted to adjust the equities as between the parties. However, the evidence at trial put the issue of illegality squarely before the trial court. In order to prevent the judicial system from lending its assistance to a party who sought to obtain the benefit of an illegal bargain (Wong v. Tenneco, Inc., supra, 39 Cal.3d at p. 135, 216 Cal.Rptr.' 412, 702 P.2d 570; Lewis Queen v. N.M. Ball Sons, supra, 48 Cal.2d at p. 150, 308 P.2d 713), the trial court should have raised the issue of illegality on its own motion in order to dispose of the matter.

3. Illegality of contract also precludes enforcement of attorney fee provision therein.

The fact seller obtained nonsuit on the sole contract claim does not entitle seller to attorney fees pursuant to the attorney fee provision in the purchase agreement.
Ordinarily, "[w]hen a defendant obtains a simple, unqualified victory by defeating the only contract claim in the action, [Civil Code] section 1717 entitles the successful defendant to recover reasonable attorney fees incurred in defense of that claim if the contract contained a provision for attorney fees. The trial court has no discretion to deny attorney fees to the defendant in this situation by finding that there was no party prevailing on the contract." (Hsu v. Abbara (1995) 9 Cal.4th 863, 877, 39 Cal. Rptr.2d 824, 891 P.2d 804.)
However, this rule has no application here. Because the instant business purchase agreement is not legally enforceable due to its illegal object, "there is no need for a mutual right to attorney fees since neither party can enforce the agreement." (Yuba, supra, 98 Cal.App.4th at p. 1082, 120 Cal.Rptr.2d 273.)


*249 DISPOSITION
The judgment is reversed with directions to enter a new judgment denying any relief to either party. The parties shall bear their respective costs and attorney fees on appeal.
We concur: CROSKEY and KITCHING, JJ.
NOTES
[1]  This court takes judicial notice of the fact that counterfeit goods cause significant losses to manufacturers and retailers and deprive state and local governments of much needed tax revenue. (Evid.Code, §§ 452, subd. (g), 459.) Global piracy disproportionately hurts Los Angeles because so many of the firms that make the originals are concentrated here. A just-released report by the Los Angeles County Economic Development Corporation estimates that bootleg DVDs, CDs, prescription drugs and other merchandise such as designer handbags cost nine industries in Los Angeles County more than 100,000 jobs and about $5.2 billion in lost sales in 2005, with the motion picture industry and the recording industry sustaining the heaviest losses. (A False Bargain: The Los Angeles County Economic Consequence of Counterfeit Products, available online at http://w ww.laedc.org/consulting/reports.html# piracy [as of Feb. 22, 2007]; Los Angeles Times, Feb. 16, 2007, Business section, p. C1, columns 1-4.)
[2]  The record reflects that on November 7, 2001, seller pled no contest to five counts of sale of counterfeit mark (Pen.Code § 350, subd. (a)(2)) and was placed on five years probation.
[3]  Prior to oral argument, in accordance with Government Code section 68081, we notified the parties of our concerns in this regard and received supplemental briefing.
