Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[*] Project : remove some deprecated functions #3704

Merged
merged 1 commit into from Aug 17, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -26,7 +26,7 @@
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd());
}
require_once(_PS_ADMIN_DIR_.'/../images.inc.php');
function bindDatepicker($id, $time)
{
if ($time) {

This file was deleted.

@@ -209,16 +209,6 @@ public static function checkAttributeQty($id_product_attribute, $qty, Shop $shop
return ($result && $qty <= $result);
}
/**
* @deprecated 1.5.0, use StockAvailable::getQuantityAvailableByProduct()
*/
public static function getAttributeQty($id_product)
{
Tools::displayAsDeprecated();
return StockAvailable::getQuantityAvailableByProduct($id_product);
}
/**
* Update array with veritable quantity
*
@@ -178,14 +178,6 @@ public function __construct($id = null, $id_lang = null)
$this->shipping_method = ((int)Configuration::get('PS_SHIPPING_METHOD') ? Carrier::SHIPPING_METHOD_WEIGHT : Carrier::SHIPPING_METHOD_PRICE);
}
/**
* keep retrocompatibility id_tax_rules_group
* @deprecated 1.5.0
*/
if ($this->id) {
$this->id_tax_rules_group = $this->getIdTaxRulesGroup(Context::getContext());
}
if ($this->name == '0') {
$this->name = Carrier::getCarrierNameFromShopName();
}
@@ -352,15 +352,6 @@ public function getAverageProductsTaxRate(&$cart_amount_te = null, &$cart_amount
}
}
/**
* @deprecated 1.5.0, use Cart->getCartRules()
*/
public function getDiscounts($lite = false, $refresh = false)
{
Tools::displayAsDeprecated();
return $this->getCartRules();
}
public function getCartRules($filter = CartRule::FILTER_ACTION_ALL)
{
// If the cart has not been saved, then there can't be any cart rule applied
@@ -828,15 +819,6 @@ public static function getNbProducts($id)
return self::$_nbProducts[$id];
}
/**
* @deprecated 1.5.0, use Cart->addCartRule()
*/
public function addDiscount($id_cart_rule)
{
Tools::displayAsDeprecated();
return $this->addCartRule($id_cart_rule);
}
public function addCartRule($id_cart_rule)
{
// You can't add a cart rule that does not exist
@@ -1210,15 +1192,6 @@ public function orderExists()
return Cache::retrieve($cache_id);
}
/**
* @deprecated 1.5.0, use Cart->removeCartRule()
*/
public function deleteDiscount($id_cart_rule)
{
Tools::displayAsDeprecated();
return $this->removeCartRule($id_cart_rule);
}
public function removeCartRule($id_cart_rule)
{
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_ALL);
@@ -2382,59 +2355,6 @@ public function carrierIsSelected($id_carrier, $id_address)
return true;
}
/**
* Get all deliveries options available for the current cart formated like Carriers::getCarriersForOrder
* This method was wrote for retrocompatibility with 1.4 theme
* New theme need to use Cart::getDeliveryOptionList() to generate carriers option in the checkout process
*
* @since 1.5.0
*
* @param Country $default_country
* @param bool $flush Force flushing cache
*
*/
public function simulateCarriersOutput(Country $default_country = null, $flush = false)
{
$delivery_option_list = $this->getDeliveryOptionList($default_country, $flush);
// This method cannot work if there is multiple address delivery
if (count($delivery_option_list) > 1 || empty($delivery_option_list)) {
return array();
}
$carriers = array();
foreach (reset($delivery_option_list) as $key => $option) {
$price = $option['total_price_with_tax'];
$price_tax_exc = $option['total_price_without_tax'];
if ($option['unique_carrier']) {
$carrier = reset($option['carrier_list']);
$name = $carrier['instance']->name;
$img = $carrier['logo'];
$delay = $carrier['instance']->delay;
$delay = isset($delay[Context::getContext()->language->id]) ? $delay[Context::getContext()->language->id] : $delay[(int)Configuration::get('PS_LANG_DEFAULT')];
} else {
$nameList = array();
foreach ($option['carrier_list'] as $carrier) {
$nameList[] = $carrier['instance']->name;
}
$name = join(' -', $nameList);
$img = ''; // No images if multiple carriers
$delay = '';
}
$carriers[] = array(
'name' => $name,
'img' => $img,
'delay' => $delay,
'price' => $price,
'price_tax_exc' => $price_tax_exc,
'id_carrier' => Cart::intifier($key), // Need to translate to an integer for retrocompatibility reason, in 1.4 template we used intval
'is_module' => false,
);
}
return $carriers;
}
public function simulateCarrierSelectedOutput($use_cache = true)
{
$delivery_option = $this->getDeliveryOption(null, false, $use_cache);
@@ -2702,15 +2622,6 @@ public function getCarrierCost($id_carrier, $useTax = true, Country $default_cou
return $total_shipping;
}
/**
* @deprecated 1.5.0, use Cart->getPackageShippingCost()
*/
public function getOrderShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null)
{
Tools::displayAsDeprecated();
return $this->getPackageShippingCost($id_carrier, $use_tax, $default_country, $product_list);
}
/**
* Return package shipping cost
*

This file was deleted.

@@ -728,48 +728,6 @@ public static function updateCarrier($id_carrier, $carrier)
return Hook::exec('updateCarrier', array('id_carrier' => $id_carrier, 'carrier' => $carrier));
}
/**
* Preload hook modules cache
*
* @deprecated 1.5.0 use Hook::getHookModuleList() instead
*
* @return bool preload_needed
*/
public static function preloadHookModulesCache()
{
Tools::displayAsDeprecated();
if (!is_null(self::$_hook_modules_cache)) {
return false;
}
self::$_hook_modules_cache = Hook::getHookModuleList();
return true;
}
/**
* Return hook ID from name
*
* @param string $hook_name Hook name
* @return int Hook ID
*
* @deprecated since 1.5.0 use Hook::getIdByName() instead
*/
public static function get($hook_name)
{
Tools::displayAsDeprecated();
if (!Validate::isHookName($hook_name)) {
die(Tools::displayError());
}
$result = Db::getInstance()->getRow('
SELECT `id_hook`, `name`
FROM `'._DB_PREFIX_.'hook`
WHERE `name` = \''.pSQL($hook_name).'\'');
return ($result ? $result['id_hook'] : false);
}
/**
* Called when quantity of a product is updated.
*
@@ -381,41 +381,6 @@ public static function duplicateAttributeImageAssociations($combination_images)
return DB::getInstance()->execute($query);
}
/**
* Reposition image
*
* @param int $position Position
* @param bool $direction Direction
* @deprecated since version 1.5.0.1 use Image::updatePosition() instead
*/
public function positionImage($position, $direction)
{
Tools::displayAsDeprecated();
$position = (int)$position;
$direction = (int)$direction;
// temporary position
$high_position = Image::getHighestPosition($this->id_product) + 1;
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'image`
SET `position` = '.(int)$high_position.'
WHERE `id_product` = '.(int)$this->id_product.'
AND `position` = '.($direction ? $position - 1 : $position + 1));
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'image`
SET `position` = `position`'.($direction ? '-1' : '+1').'
WHERE `id_image` = '.(int)$this->id);
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'image`
SET `position` = '.$this->position.'
WHERE `id_product` = '.(int)$this->id_product.'
AND `position` = '.(int)$high_position);
}
/**
* Change an image position and update relative positions
*
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.