示例#1
0
 public function clear()
 {
     parent::clear();
     $this->promos = null;
     $this->loaded = false;
 }
示例#2
0
 /**
  * Empties the cart
  *
  * @author Jonathan Davis
  * @since 1.3
  *
  * @return void
  **/
 public function clear()
 {
     parent::clear();
     $this->shipped = array();
     $this->downloads = array();
     $this->recurring = array();
     // Clear the item registers
     $this->Totals = new OrderTotals();
 }
示例#3
0
 /**
  * Runs the shipping module calculations to populate the applicable shipping service rate options
  *
  * @author Jonathan Davis
  * @since 1.3
  *
  * @return void
  **/
 private function modules()
 {
     $Notices = ShoppErrorStorefrontNotices();
     $notices = $Notices->count();
     $services = array();
     // Run shipping module aggregate shipping calculations
     do_action_ref_array('shopp_calculate_shipping', array(&$services, ShoppOrder()));
     // No shipping options were generated, try fallback calculators for realtime rate failures
     if (empty($services) && $this->realtime) {
         do_action('shopp_calculate_fallback_shipping_init');
         do_action_ref_array('shopp_calculate_fallback_shipping', array(&$services, ShoppOrder()));
     }
     if (empty($services)) {
         return false;
     }
     // Still no rates, bail
     // Suppress new errors from shipping systems if there are services available
     $newnotices = $Notices->count() - $notices;
     if ($newnotices > 0) {
         $Notices->rollback($newnotices);
     }
     // Add all order shipping fees and item shipping fees
     foreach ($services as $service) {
         $service->amount += $this->fees($service);
     }
     parent::clear();
     $this->populate($services);
     // $this->sort('self::sort');
 }