User Tools

Site Tools


how_to_create_a_shipping_module

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
how_to_create_a_shipping_module [2019/01/31 03:12]
90.230.2.167 [options($items, $subtotal, $tax, $currency_code, $customer)]
how_to_create_a_shipping_module [2019/01/31 03:13] (current)
90.230.2.167 [options($items, $subtotal, $tax, $currency_code, $customer)]
Line 112: Line 112:
             '​name'​ => '​Option 1',             '​name'​ => '​Option 1',
             '​description'​ => 'This is the description for option 1',             '​description'​ => 'This is the description for option 1',
-            '​fields'​ => '',​+            '​fields'​ => '<input type="​text"​ name="​foo"​ value="'​. @$this->​userdata['​foo'​] .'"​ />' . PHP_EOL 
 +                      . '<​input type="​text"​ name="​bar"​ value="'​. @$this->​userdata['​bar'​] .'"​ />',
             '​cost'​ => $this->​settings['​fee_1'​],​             '​cost'​ => $this->​settings['​fee_1'​],​
             '​tax_class_id'​ => $this->​settings['​tax_class_id'​],​             '​tax_class_id'​ => $this->​settings['​tax_class_id'​],​
Line 122: Line 123:
 </​file>​ </​file>​
  
-If you need to collect some user data, here is an example. Inside the module you can access any submitted form fields through the array ''​$this->​userdata''​. 
- 
-<code php> 
-        array( 
-          '​id'​ => '​method',​ 
-          '​icon'​ => '​images/​shipping/​icon.png',​ 
-          '​name'​ => '​Title',​ 
-          '​description'​ => 'This is a payment method.',​ 
-          '​fields'​ => '<​input type="​text"​ name="​foo"​ value="'​. @$this->​userdata['​foo'​] .'"​ />' . PHP_EOL 
-                    . '<​input type="​text"​ name="​bar"​ value="'​. @$this->​userdata['​bar'​] .'"​ />',​ 
-          '​cost'​ => 0, 
-          '​tax_class_id'​ => 0, 
-          '​confirm'​ => '​Button Text', 
-        ), 
-</​code>​ 
 ==== select($module_id,​ $option_id) ==== ==== select($module_id,​ $option_id) ====
  
how_to_create_a_shipping_module.txt · Last modified: 2019/01/31 03:13 by 90.230.2.167