Exemplo n.º 1
0
 public function on_start()
 {
     $this->requireAsset('css', 'razor_css');
     $this->set('pageTitle', 'Payment Type Settings');
     // load fields
     $fieldHandles = array('stripe_mode', 'stripe_test_secret_key', 'stripe_test_publishable_key', 'stripe_live_secret_key', 'stripe_live_publishable_key');
     $fields = array();
     foreach ($fieldHandles as $fieldHandle) {
         $f = new Field();
         $field = $f->getByHandle($fieldHandle);
         $fields[] = $field;
     }
     $this->fields = $fields;
 }
Exemplo n.º 2
0
 public function on_start()
 {
     $this->requireAsset('css', 'razor_css');
     $this->set('pageTitle', 'Razor Commerce Settings');
     // load fields
     $fieldHandles = array('store_location');
     $fields = array();
     foreach ($fieldHandles as $fieldHandle) {
         $f = new Field();
         $field = $f->getByHandle($fieldHandle);
         $fields[] = $field;
     }
     $this->fields = $fields;
 }
Exemplo n.º 3
0
 public function on_start()
 {
     $this->requireAsset('css', 'razor_css');
     $this->set('pageTitle', 'Shipping Settings');
     $this->shipping = new ShippingClass();
     // load fields
     $fieldHandles = array('enable_shipping', 'enable_flat_rate_shipping', 'flat_rate_shipping_cost_per_order', 'enable_free_shipping', 'free_shipping_minimum_order', 'enable_pickup_shipping', 'pickup_shipping_location');
     $fields = array();
     foreach ($fieldHandles as $fieldHandle) {
         $f = new Field();
         $field = $f->getByHandle($fieldHandle);
         $fields[] = $field;
     }
     $this->fields = $fields;
 }
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 get_field()
 {
     $fields = array('first_name', 'last_name', 'phone', 'billing_address', 'shipping_address');
     $fieldJSON = array();
     foreach ($fields as $handle) {
         $field = new Field(false, 'user');
         $fieldJSON[$handle] = $field->getByHandle($handle);
     }
     print json_encode($fieldJSON);
     exit;
 }
Exemplo n.º 6
0
 public function install()
 {
     $field = new Field();
     $field->getByHandle('product_type');
     $field->selectValue('Dynamic Product');
 }