static function getCountryNameOfCode($code) { $countries = array_flip(Helper_Paypal::getPaypalCountries()); $name = $code; if (isset($countries[$code])) { $name = $countries[$code]; } return $name; }
static function getInstanceFromSmartyParams($params, $template = NULL) { $renderer = new Renderer_Cart(); $messages = array(); if ($template) { $view = $template->smarty->getTemplateVars('__view'); if (isset($view['messages'])) { $messages = $view['messages']; } } $renderer->messages = $messages; $renderer->countries = Helper_Paypal::getPaypalCountries(); if (isset($params['with_product_link'])) { $renderer->withProductLink = $params['with_product_link']; } if (isset($params['with_currency_symbol'])) { $renderer->withCurrencySymbol = $params['with_currency_symbol']; } if (isset($params['with_currency_space'])) { $renderer->withCurrencySpace = $params['with_currency_space']; } if (isset($params['member'])) { $renderer->member = $params['member']; } if (isset($params['currencies'])) { $renderer->currencies = $params['currencies']; } if (isset($params['with_delivery_date'])) { $renderer->withDeliveryDate = $params['with_delivery_date']; } if (isset($params['with_discount'])) { $renderer->withDiscount = $params['with_discount']; } if (isset($params['with_points'])) { $renderer->withPoints = $params['with_points']; } if (isset($params['points_label'])) { $renderer->pointsLabel = $params['points_label']; } if (isset($params['with_item_table'])) { $renderer->withItemTable = $params['with_item_table']; } if (isset($params['with_total_rows'])) { $renderer->withTotalRows = $params['with_total_rows']; } if (isset($params['discount_label'])) { $renderer->discountLabel = $params['discount_label']; } if (isset($params['shows_discount'])) { $renderer->showsDiscount = $params['shows_discount']; } if (isset($params['always_show_shipping'])) { $renderer->alwaysShowShipping = $params['always_show_shipping']; } if (isset($params['with_shipping'])) { $renderer->withShipping = $params['with_shipping']; } if (isset($params['with_shipping_country'])) { $renderer->withShippingCountry = $params['with_shipping_country']; } if (isset($params['with_shipping_city'])) { $renderer->withShippingCity = $params['with_shipping_city']; } if (isset($params['thumbnail_suffix'])) { $renderer->thumbnailSuffix = $params['thumbnail_suffix']; } if (isset($params['with_backorder_shipping'])) { $renderer->withBackorderShipping = $params['with_backorder_shipping']; } if (isset($params['cart_table_mode'])) { $renderer->cartTableMode = $params['cart_table_mode']; } if (isset($params['with_new_line_separator'])) { $renderer->withNewLineSeparator = $params['with_new_line_separator']; } return $renderer; }