public function meta(ShoppPurchase $Purchase) { // Save the discounts applied if ($this->Discounts->count() > 0) { $Purchase->discounts($this->Discounts); } // Save the taxes applied $TotalTaxes = $this->Cart->Totals->entry('tax'); if (!empty($TotalTaxes)) { $Purchase->taxes($TotalTaxes); } // Save new user registration with order if (!$this->Customer->exists()) { $Purchase->registration($this->Customer, $this->Billing, $this->Shipping); } }