protected function buildDefaultItemRow()
 {
     $row = parent::buildDefaultItemRow();
     // remove old fileds
     unset($row["unit_amount"]);
     unset($row["old_unit_amount"]);
     unset($row["tax_percent"]);
     $newFields = array("tax_class" => "", "unit_amount_net" => "0", "old_unit_amount_net" => "");
     $row = array_slice($row, 0, 3, true) + $newFields + array_slice($row, 3, count($row) - 3, true);
     return $row;
 }
Example #2
0
    // in versions before 1.4.0.2 FrontController doesn't exist
    require_once dirname(__FILE__) . '/../../init.php';
    $modules = Module::getModulesInstalled();
}
$moduleIsActive = 0;
foreach ($modules as $key => $module) {
    if ($module['name'] == 'shopgate' && !empty($module['active'])) {
        $moduleIsActive = 1;
    }
}
if ($moduleIsActive == 0) {
    throw new ShopgateLibraryException(ShopgateLibraryException::UNKNOWN_ERROR_CODE, 'shopgate module is not installed!');
    exit;
}
// needed for compatiblitiy
function getOrderStateId($order_state_var)
{
    return (int) (defined($order_state_var) ? constant($order_state_var) : (defined('_' . $order_state_var . '_') ? constant('_' . $order_state_var . '_') : Configuration::get($order_state_var)));
}
// select the correct plugin
if (getOrderStateId('PS_COUNTRY_DEFAULT') && ($countryId = getOrderStateId('PS_COUNTRY_DEFAULT')) !== 0 || getOrderStateId('PS_SHOP_COUNTRY_ID') && ($countryId = getOrderStateId('PS_SHOP_COUNTRY_ID')) !== 0) {
    $countryIsoCode = Tools::strtoupper(Db::getInstance()->getValue('SELECT `iso_code` FROM `' . _DB_PREFIX_ . 'country` WHERE `id_country` = ' . (int) $countryId));
} elseif (Configuration::get('PS_LOCALE_COUNTRY')) {
    $countryIsoCode = Configuration::get('PS_LOCALE_COUNTRY');
}
if (in_array(Tools::strtoupper($countryIsoCode), array('US'))) {
    $plugin = new PSShopgatePluginUS();
} else {
    $plugin = new PSShopgatePlugin();
}
$response = $plugin->handleRequest($_POST);