コード例 #1
0
ファイル: Order.php プロジェクト: forthrobot/inuvik
 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);
     }
 }
コード例 #2
0
ファイル: purchase.php プロジェクト: forthrobot/inuvik
 /**
  * Provides markup for an unorder list of discounts applied to the order
  *
  * @api `shopp('purchase.discount-list')`
  * @since 1.2
  *
  * @param string        $result  The output
  * @param array         $options The options
  * @param ShoppPurchase $O       The working object
  * @return string The discount list markup
  **/
 public static function discount_list($result, $options, $O)
 {
     $output = '';
     $discounts = $O->discounts();
     if (!empty($discounts)) {
         $output .= '<ul>';
         foreach ($discounts as $id => $Discount) {
             $output .= '<li>' . esc_html($Discount->name) . '</li>';
         }
         $output .= '</ul>';
     }
     return $output;
 }