$postage = ereg('<Postage>(.*)</Postage>', $services[$i], $regs); $postage = $regs[1]; $time = ereg('<SvcCommitments>(.*)</SvcCommitments>', $services[$i], $tregs); $time = $tregs[1]; $time = preg_replace('/Weeks$/', 'Weeks', $time); $time = preg_replace('/Days$/', 'Days', $time); $time = preg_replace('/Day$/', 'Day', $time); if (!in_array($service, $allowed_types) || $postage < 0) { continue; } $postage = $postage + get_option('usps_extra_cost'); $service = str_replace('&lt;sup&gt;&amp;reg;&lt;/sup&gt;', '<sup>®</sup>', $service); $service = str_replace('&lt;sup&gt;&amp;trade;&lt;/sup&gt;', '<sup>™</sup>', $service); $rates += array($service => $postage); if ($time != '') { $transittime[$service] = ' (' . $time . ')'; } } } } } $uspsQuote = $rates; $wpsc_usps_quote = $rates; return $uspsQuote; } function get_item_shipping() { } } $usps = new usps(); $wpsc_shipping_modules[$usps->getInternalName()] = $usps;
public function getAdminForm() { return array('title' => 'Note: You can ' . CHtml::link('Set Product Restrictions', '#', array('class' => 'basic', 'id' => get_class($this))) . ' for this module.', 'elements' => array('label' => array('type' => 'text', 'maxlength' => 64), 'username' => array('type' => 'text', 'maxlength' => 64), 'originpostcode' => array('type' => 'text', 'maxlength' => 10), 'offerservices' => array('type' => 'checkboxlist', 'items' => usps::getServiceTypes('usps', false), 'separator' => '', 'template' => '<div class="offerservices">{input} {label}</div>', 'label' => 'Offer these services<br><a onclick="selectall()">Select All</a><br><a onclick="selectnone()">Select None</a><br>'), 'restrictcountry' => array('type' => 'dropdownlist', 'items' => Country::getAdminRestrictionList(true)), 'markup' => array('type' => 'text', 'maxlength' => 4), 'product' => array('type' => 'text', 'maxlength' => 64))); }