// Merge -> revision 8114
This commit is contained in:
@@ -342,8 +342,8 @@ class AdminDiscounts extends AdminTab
|
||||
<div class="margin-form">
|
||||
<input type="text" size="15" name="minimal" value="'.($this->getFieldValue($obj, 'minimal') ? (float)($this->getFieldValue($obj, 'minimal')) : '0').'" onkeyup="javascript:this.value = this.value.replace(/,/g, \'.\'); " /> <sup>*</sup>
|
||||
<select name="include_tax" id="include_tax" style="vertical-align: middle;">
|
||||
<option value="0">'.$this->l('tax excl.').'</option>
|
||||
<option value="1">'.$this->l('tax incl.').'</option>
|
||||
<option value="0" '.($obj->include_tax == 0 ? 'selected="selected"' : '').'>'.$this->l('tax excl.').'</option>
|
||||
<option value="1" '.($obj->include_tax == 1 ? 'selected="selected"' : '').'>'.$this->l('tax incl.').'</option>
|
||||
</select>
|
||||
<p class="clear">'.$this->l('0 if not applicable').'</p>
|
||||
</div>
|
||||
|
||||
@@ -956,8 +956,10 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
else
|
||||
{
|
||||
$price = Product::getPriceStatic((int)($product['id_product']), $withTaxes, (int)($product['id_product_attribute']), 2, NULL, false, true, $product['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL));
|
||||
$price = Product::getPriceStatic((int)($product['id_product']), true, (int)($product['id_product_attribute']), 2, NULL, false, true, $product['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL));
|
||||
$total_price = Tools::ps_round($price, 2) * (int)($product['cart_quantity']);
|
||||
if (!$withTaxes)
|
||||
$total_price = Tools::ps_round($total_price / (1 + ($product['rate'] / 100)), 2);
|
||||
}
|
||||
$order_total += $total_price;
|
||||
}
|
||||
@@ -976,7 +978,6 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
$wrapping_fees = Tools::convertPrice(Tools::ps_round($wrapping_fees, 2), Currency::getCurrencyInstance((int)($this->id_currency)));
|
||||
}
|
||||
|
||||
if ($type != Cart::ONLY_PRODUCTS)
|
||||
{
|
||||
$discounts = array();
|
||||
@@ -1366,7 +1367,7 @@ class CartCore extends ObjectModel
|
||||
if (Product::idIsOnCategoryId($product['id_product'], $categories))
|
||||
{
|
||||
if ((!$discountObj->cumulable_reduction AND !$product['reduction_applies'] AND !$product['on_sale']) OR $discountObj->cumulable_reduction)
|
||||
$total_cart += $product['total_wt'];
|
||||
$total_cart += $discountObj->include_tax ? $product['total_wt'] : $product['total'];
|
||||
$returnErrorNoProductCategory = false;
|
||||
}
|
||||
}
|
||||
@@ -1411,7 +1412,6 @@ class CartCore extends ObjectModel
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'delivery' => $delivery,
|
||||
'delivery_state' => State::getNameById($delivery->id_state),
|
||||
|
||||
@@ -314,7 +314,7 @@ class DiscountCore extends ObjectModel
|
||||
foreach ($products AS $product)
|
||||
if (Product::idIsOnCategoryId($product['id_product'], $categories))
|
||||
if ($this->cumulable_reduction OR (!$product['reduction_applies'] AND !$product['on_sale']))
|
||||
$amount += ($this->include_tax ? $product['total_wt'] : $product['total']) * $percentage;
|
||||
$amount += ($useTax? $product['total_wt'] : $product['total']) * $percentage;
|
||||
return $amount;
|
||||
|
||||
/* Absolute value */
|
||||
@@ -325,7 +325,7 @@ class DiscountCore extends ObjectModel
|
||||
return 0;
|
||||
|
||||
$taxDiscount = Cart::getTaxesAverageUsed((int)($cart->id));
|
||||
if (!$this->include_tax AND isset($taxDiscount) AND $taxDiscount != 1)
|
||||
if (!$useTax AND isset($taxDiscount) AND $taxDiscount != 1)
|
||||
$this->value = abs($this->value / (1 + $taxDiscount * 0.01));
|
||||
|
||||
// Main return
|
||||
|
||||
@@ -156,7 +156,7 @@ class MCachedCore extends Cache
|
||||
|
||||
public static function addServer($ip, $port, $weight)
|
||||
{
|
||||
return Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'memcached_servers (id_memcached_server, ip, port, weight) VALUES(\'\', \''.pSQL($ip).'\', '.(int)$port.', '.(int)$weight.')', false);
|
||||
return Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'memcached_servers (ip, port, weight) VALUES(\''.pSQL($ip).'\', '.(int)$port.', '.(int)$weight.')', false);
|
||||
}
|
||||
|
||||
public static function getMemcachedServers()
|
||||
|
||||
@@ -574,6 +574,26 @@ abstract class ModuleCore
|
||||
$modules_dir = self::getModulesDirOnDisk();
|
||||
foreach ($modules_dir AS $module)
|
||||
{
|
||||
// Memory usage checking
|
||||
if ($memory_limit = strtoupper(@ini_get('memory_limit')))
|
||||
{
|
||||
if (strpos($memory_limit, 'M'))
|
||||
{
|
||||
$memory_limit = str_replace('M', '', $memory_limit);
|
||||
$memory_limit *= 1024 * 1024;
|
||||
}
|
||||
elseif (strpos($memory_limit, 'K'))
|
||||
{
|
||||
$memory_limit = str_replace('K', '', $memory_limit);
|
||||
$memory_limit *= 1024;
|
||||
}
|
||||
|
||||
if ($memory_limit - memory_get_usage() <= (512 * 1024))
|
||||
{
|
||||
$errors[] = Tools::displayError('All modules cannot be loaded due to memory limit restriction reason, please increase your memory_limit value on your server configuration');
|
||||
break;
|
||||
}
|
||||
}
|
||||
$configFile = _PS_MODULE_DIR_.$module.'/config.xml';
|
||||
$xml_exist = file_exists($configFile);
|
||||
if ($xml_exist)
|
||||
|
||||
@@ -329,11 +329,13 @@ function returnDestImage($type, $ressource, $filename)
|
||||
$flag = imagegif($ressource, $filename);
|
||||
break;
|
||||
case 'png':
|
||||
$flag = imagepng($ressource, $filename, (int)Configuration::get('PS_PNG_QUALITY'));
|
||||
$quality = (Configuration::get('PS_PNG_QUALITY') === false ? 7 : Configuration::get('PS_PNG_QUALITY'));
|
||||
$flag = imagepng($ressource, $filename, (int)$quality);
|
||||
break;
|
||||
case 'jpeg':
|
||||
default:
|
||||
$flag = imagejpeg($ressource, $filename, (int)Configuration::get('PS_JPEG_QUALITY'));
|
||||
$quality = (Configuration::get('PS_JPEG_QUALITY') === false ? 90 : Configuration::get('PS_JPEG_QUALITY'));
|
||||
$flag = imagejpeg($ressource, $filename, (int)$quality);
|
||||
break;
|
||||
}
|
||||
imagedestroy($ressource);
|
||||
|
||||
@@ -135,7 +135,7 @@ $_LANG['This is not a valid image file.'] = 'Esto no es una imagen válida.';
|
||||
$_LANG['Too long!'] = '¡Demasiado largo!';
|
||||
$_LANG['Unfortunately,'] = 'Desgraciadamente,';
|
||||
$_LANG['Update is complete!'] = '¡Actualización completa!';
|
||||
$_LANG['Upgrade: get the latest stable version!'] = 'Actualización: instale la última versión de PrestShop';
|
||||
$_LANG['Upgrade: get the latest stable version!'] = 'Actualización: instale la última versión de PrestaShop';
|
||||
$_LANG['Verify now!'] = '¡Pruebe ahora!';
|
||||
$_LANG['Verify system compatibility'] = 'Compatibilidad sistema';
|
||||
$_LANG['WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'] = 'ATENCION : para más seguridad, por favor suprima la carpeta \'/install\' y los archivos readme (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG)..';
|
||||
|
||||
@@ -20,7 +20,7 @@ $_LANG['Community Forum'] = 'notre forum communautaire';
|
||||
$_LANG['Configure SMTP manually (advanced users only)'] = 'Configurer l\'envoi SMTP (experts uniquement)';
|
||||
$_LANG['Configure your database by filling out the following fields:'] = 'Configurez votre base de données en remplissant les champs ci-dessous :';
|
||||
$_LANG['Congratulation, your online shop is now ready!'] = 'Félicitations, votre boutique est installée !';
|
||||
$_LANG['Contact us'] = 'Contactez-nous !';
|
||||
$_LANG['Contact us!'] = 'Contactez-nous !';
|
||||
$_LANG['Create new files and folders allowed'] = 'Création de nouveaux dossiers et fichiers autorisée';
|
||||
$_LANG['Data integrity is not valided. Hack attempt?'] = 'L\'intégrité des données n\'est pas validée.';
|
||||
$_LANG['Database Server is available but database is not found'] = 'Le serveur de bases de données est disponible mais la base de données n\'a pas été trouvée';
|
||||
|
||||
@@ -247,14 +247,14 @@
|
||||
<state name="New Hampshire" iso_code="NH" country="US" zone="North America" />
|
||||
<state name="New Jersey" iso_code="NJ" country="US" zone="North America" />
|
||||
<state name="New Mexico" iso_code="NM" country="US" zone="North America" />
|
||||
<state name="North California" iso_code="NC" country="US" zone="North America" />
|
||||
<state name="North Carolina" iso_code="NC" country="US" zone="North America" />
|
||||
<state name="North Dakota" iso_code="ND" country="US" zone="North America" />
|
||||
<state name="Ohio" iso_code="OH" country="US" zone="North America" />
|
||||
<state name="Oklahoma" iso_code="OK" country="US" zone="North America" />
|
||||
<state name="Oregon" iso_code="OR" country="US" zone="North America" />
|
||||
<state name="Pennsylvania" iso_code="PA" country="US" zone="North America" />
|
||||
<state name="Rhode Island" iso_code="RI" country="US" zone="North America" />
|
||||
<state name="South California" iso_code="SC" country="US" zone="North America" />
|
||||
<state name="South Carolina" iso_code="SC" country="US" zone="North America" />
|
||||
<state name="South Dakota" iso_code="SD" country="US" zone="North America" />
|
||||
<state name="Tennessee" iso_code="TN" country="US" zone="North America" />
|
||||
<state name="Texas" iso_code="TX" country="US" zone="North America" />
|
||||
|
||||
@@ -71,14 +71,23 @@ class PaypalPayment extends Paypal
|
||||
$discounts = (float)($cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS));
|
||||
if ($discounts == 0)
|
||||
{
|
||||
if ($params['cart']->id_customer)
|
||||
{
|
||||
$customer = new Customer((int)$params['cart']->id_customer);
|
||||
$taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
|
||||
}
|
||||
else
|
||||
$taxCalculationMethod = Group::getDefaultPriceDisplayMethod();
|
||||
$priceField = (($taxCalculationMethod == PS_TAX_EXC) ? 'price' : 'price_wt');
|
||||
|
||||
$products = $cart->getProducts();
|
||||
$amt = 0;
|
||||
for ($i = 0; $i < sizeof($products); $i++)
|
||||
{
|
||||
$request .= '&L_NAME'.$i.'='.substr(urlencode($products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ), 0, 127);
|
||||
$request .= '&L_AMT'.$i.'='.urlencode($this->PayPalRound($products[$i]['price_wt']));
|
||||
$request .= '&L_AMT'.$i.'='.urlencode($this->PayPalRound($products[$i][$priceField]));
|
||||
$request .= '&L_QTY'.$i.'='.urlencode($products[$i]['cart_quantity']);
|
||||
$amt += $this->PayPalRound($products[$i]['price_wt']*$products[$i]['cart_quantity']);
|
||||
$amt += $this->PayPalRound($products[$i][$priceField] * $products[$i]['cart_quantity']);
|
||||
}
|
||||
$shipping = $this->PayPalRound($cart->getOrderShippingCost($cart->id_carrier, false));
|
||||
$request .= '&ITEMAMT='.urlencode($amt);
|
||||
|
||||
@@ -51,7 +51,7 @@ if ($result[0] == 0)
|
||||
{
|
||||
list ($rc, $errorcode, $error_message, $amount, $used_currency, $state) = $result;
|
||||
|
||||
if ($state == PrepaidServicesAPI::DISPOSITION_DISPOSED || $state == PrepaidServicesAPI::DISPOSITION_DEBITED)
|
||||
if ($state == PSCPrepaidServicesAPI::DISPOSITION_DISPOSED || $state == PSCPrepaidServicesAPI::DISPOSITION_DEBITED)
|
||||
{
|
||||
$state = Configuration::get('PS_OS_PAYMENT');
|
||||
$message .= $module->getL('disposition_created');
|
||||
|
||||
@@ -1099,7 +1099,7 @@ class shopimporter extends ImportModule
|
||||
Image::deleteAllImages(_PS_PROD_IMG_DIR_);
|
||||
Image::clearTmpDir();
|
||||
break;
|
||||
case 'Manufacturers' :
|
||||
case 'manufacturer' :
|
||||
Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer');
|
||||
Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer_lang');
|
||||
foreach (scandir(_PS_MANU_IMG_DIR_) AS $d)
|
||||
|
||||
Reference in New Issue
Block a user