Пример #1
0
 public function __construct($options = array(), $module = false)
 {
     $this->types = array_keys(Lookup::packaging_types());
     if ($module !== false) {
         $this->module = $module;
     }
     $this->options = apply_filters('shopp_packager_options', $options, $module);
     // Set weight limit
     $weight_limit = shopp_setting('shipping_package_weight_limit');
     $defaults = array('wtl' => $weight_limit ? $weight_limit : 50, 'wl' => -1, 'hl' => -1, 'll' => -1);
     if (!isset($this->options['limits'])) {
         $this->options['limits'] = array();
     }
     $this->options['limits'] = array_merge($defaults, $this->options['limits']);
     // set packing behavior
     $this->pack = apply_filters('shopp_packager_type', isset($options['type']) && in_array($options['type'], $this->types) ? $options['type'] : $this->pack, $module);
     // register packagers
     foreach ($this->types as $pack) {
         add_action('shopp_packager_add_' . $pack, array(&$this, $pack . '_add'), 10, 2);
     }
 }
Пример #2
0
</label>
		</td>
	</tr>
	<?php 
$Shopp = Shopp::object();
if ($Shopp->Shipping->realtime) {
    ?>
	<tr>
		<th scope="row" valign="top"><label for="packaging"><?php 
    _e('Packaging', 'Shopp');
    ?>
</label></th>
		<td>
		<select name="settings[shipping_packaging]" id="packaging">
				<?php 
    echo menuoptions(Lookup::packaging_types(), shopp_setting('shipping_packaging'), true);
    ?>
		</select><br />
		<?php 
    _e('Determines packaging method used for real-time shipping quotes.', 'Shopp');
    ?>
</td>
	</tr>
	<tr>
		<th scope="row" valign="top"><label for="packaging"><?php 
    _e('Package Limit', 'Shopp');
    ?>
</label></th>
		<td>
		<select name="settings[shipping_package_weight_limit]" id="packaging_weight_limit">
				<?php