Exemplo n.º 1
0
 public function on_start()
 {
     $this->currentCart = CartObject::getCurrentCart();
     $this->requireAsset('javascript', 'fs_stepper_js');
     $this->requireAsset('css', 'fs_stepper_css');
     $this->requireAsset('javascript', 'razor_js');
     $this->requireAsset('css', 'razor_css');
     // get all shipping methods enabled
     $shipping = new Shipping();
     $shipping_methods = $shipping->getMethods();
     $this->set('shipping_methods', $shipping_methods);
 }
Exemplo n.º 2
0
 public function available($order)
 {
     $enabled = Shipping::setting('enable_pickup_shipping');
     if (!$enabled) {
         return false;
     }
     return true;
 }
Exemplo n.º 3
0
 public function available($order)
 {
     $enabled = Shipping::setting('enable_free_shipping');
     if (!$enabled) {
         return false;
     }
     $minimumOrder = Shipping::setting('free_shipping_minimum_order');
     $orderTotal = $order->getSubtotal();
     if ($orderTotal >= $minimumOrder) {
         return true;
     }
     return false;
 }
Exemplo n.º 4
0
 public function install()
 {
     // stripe payment fields
     $field = new Field($this->pkg);
     $field->addSet('stripe_payment_settings', 'Stripe Payment Settings');
     $field->add('stripe_mode', 'Stripe Mode', 'select');
     $field->set('stripe_payment_settings');
     $field = new Field($this->pkg);
     $field->getByHandle('stripe_mode');
     $field->selectValue('Testing Mode');
     $field->selectValue('Live Mode');
     $field->add('stripe_test_secret_key', 'Test Secret Key');
     $field->set('stripe_payment_settings');
     $field->add('stripe_test_publishable_key', 'Test Publishable Key');
     $field->set('stripe_payment_settings');
     $field->add('stripe_live_secret_key', 'Live Secret Key');
     $field->set('stripe_payment_settings');
     $field->add('stripe_live_publishable_key', 'Live Publishable Key');
     $field->set('stripe_payment_settings');
     // stripe customer id
     $field = new Field($this->pkg, 'user');
     $field->addSet('stripe_customer', 'Stripe Customer');
     $field->add('stripe_customer_id', 'Stripe Customer ID');
     // checkout settings
     $field = new Field($this->pkg);
     $field->addSet('razor_general_settings', 'Razor General Settings');
     /*
     $field->add( 'collect_customer_addresses', 'Collect Customer Addresses', 'boolean' );
     $field->set( 'razor_general_settings' );
     $field->add( 'enable_anonymous_checkout', 'Enable Anonymous Checkout', 'boolean' );
     $field->set( 'razor_general_settings' );
     */
     $field->add('store_location', 'Store Location');
     $field->set('razor_general_settings');
     // shipping fields
     $shipping = new Shipping();
     $shipping->install_fields();
 }
Exemplo n.º 5
0
 public function calculateCost()
 {
     return Shipping::setting('flat_rate_shipping_cost_per_order');
 }
Exemplo n.º 6
0
 public function is_enabled()
 {
     return Shipping::setting('enable_shipping');
 }
Exemplo n.º 7
0
 protected function install_extensions()
 {
     $ext = new Extension();
     // product types
     $productType = new Product();
     $productType->installDefaultTypes();
     // payment methods
     $payment = new Payment();
     $payment->installDefaultMethods();
     // shipping methods
     $shipping = new Shipping();
     $shipping->installDefaultMethods();
 }