// Merge -> revision 8059

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8062 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-16 09:10:40 +00:00
parent bbb8acc0de
commit 21ca4d15d7
31 changed files with 188 additions and 84 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ class authorizeAIM extends PaymentModule
{
$this->name = 'authorizeaim';
$this->tab = 'payments_gateways';
$this->version = '1.0';
$this->version = '1.1';
$this->author = 'PrestaShop';
$this->limited_countries = array('us');
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>authorizeaim</name>
<displayName><![CDATA[Authorize.net AIM (Advanced Integration Method)]]></displayName>
<version><![CDATA[1.0]]></version>
<version><![CDATA[1.1]]></version>
<description><![CDATA[Receive payment with Authorize.net]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab>
+4 -2
View File
@@ -42,9 +42,11 @@ foreach ($_POST AS $key => $value)
$postString .= $key.'='.urlencode($value).'&';
$postString .= 'x_exp_date='.str_pad($_POST["x_exp_date_m"], 2, "0",STR_PAD_LEFT).$_POST["x_exp_date_y"];
if (Tools::getValue('x_test_request'))
$postString .= 'Test_Mode=1';
/* Do the CURL request ro Authorize.net */
$request = curl_init(
Tools::getValue('x_test_request') ? 'https://test.authorize.net/gateway/transact.dll' : 'https://secure.authorize.net/gateway/transact.dll');
$request = curl_init('https://secure.authorize.net/gateway/transact.dll');
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $postString);
+1 -1
View File
@@ -1363,7 +1363,7 @@ class CanadaPost extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'quantity' => $product['quantity'],
'id_product' => $product['id_product'],
);
+1 -1
View File
@@ -1536,7 +1536,7 @@ class FedexCarrier extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'pickup_type' => (isset($config['pickup_type_code']) ? $config['pickup_type_code'] : Configuration::get('FEDEX_CARRIER_PICKUP_TYPE')),
);
+1 -1
View File
@@ -376,7 +376,7 @@ class Followup extends Module
/* For all customers with more than x euros in 90 days */
private function bestCustomer($count = false)
{
$emailLogs = $this->getLogsEmail(2);
$emailLogs = $this->getLogsEmail(3);
$sql = '
SELECT SUM(o.total_paid) total, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>moneybookers</name>
<displayName><![CDATA[Moneybookers]]></displayName>
<version><![CDATA[1.5]]></version>
<version><![CDATA[1.6]]></version>
<description><![CDATA[Accepts payments by Moneybookers.]]></description>
<author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab>
+8 -1
View File
@@ -38,7 +38,7 @@ class MoneyBookers extends PaymentModule
{
$this->name = 'moneybookers';
$this->tab = 'payments_gateways';
$this->version = '1.5';
$this->version = '1.6';
parent::__construct();
@@ -49,6 +49,13 @@ class MoneyBookers extends PaymentModule
if (Configuration::get('MB_PAY_TO_EMAIL') == 'testmerchant@moneybookers.com')
$this->warning = $this->l('You are currently using the default Moneybookers e-mail address, please use your own e-mail address.');
/* For 1.4.3 and less compatibility */
$updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT');
if (!Configuration::get('PS_OS_PAYMENT'))
foreach ($updateConfig as $u)
if (!Configuration::get($u) && defined('_'.$u.'_'))
Configuration::updateValue($u, constant('_'.$u.'_'));
/* MoneyBookers payment methods */
$this->_internationalPaymentMethods = array(
0 => array('file' => 'amex', 'name' => 'American Express', 'code' => 'AMX'),
+1 -1
View File
@@ -44,7 +44,7 @@ if (Tools::getValue('hash') != md5(Configuration::get($module->prefix.'SALT') +
$result = $module->getDispositionState((int)($cart->id));
$state = Configuration::get('PS_OS_ERROR');
$disposition = Disposition::getByCartId((int)($cart->id));
$disposition = PSCDisposition::getByCartId((int)($cart->id));
$message = 'Transaction ID #'.$disposition['mtid'].': '.$disposition['amount'].$disposition['currency'].'<br />'. date('Y-m-d').' ';
if ($result[0] == 0)
+1 -4
View File
@@ -578,10 +578,7 @@ class shopimporter extends ImportModule
foreach($item as $key => $val)
{
if ($key == 'passwd')
{
$password = $val;
$val = substr($val,0,29);
}
$val = '------';
if (is_array($val) AND $key != 'images')
{
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>treepodia</name>
<displayName><![CDATA[Treepodia]]></displayName>
<version><![CDATA[1.4]]></version>
<version><![CDATA[1.6]]></version>
<description><![CDATA[Cover your entire catalog with product videos in 24 hours.]]></description>
<author><![CDATA[]]></author>
<tab><![CDATA[front_office_features]]></tab>
+33 -8
View File
@@ -47,7 +47,7 @@ class Treepodia extends Module
{
$this->name = 'treepodia';
$this->tab = 'front_office_features';
$this->version = '1.5';
$this->version = '1.6';
$this->displayName = 'Treepodia';
parent::__construct();
@@ -199,9 +199,18 @@ XML;
$price->addChild('retail-price-with-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], true, NULL, 6, NULL, false, false));
$price->addChild('retail-price-without-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], false, NULL, 6, NULL, false, false));
$price->addChild('final-retail-price-with-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], true));
if (version_compare(_PS_VERSION_, '1.4') < 0)
{
$price->addChild('final-retail-price-without-tax', Product::getPriceStatic(intval($sqlProduct['id_product']), false));
$price->addChild('reduction_percent', floatval($sqlProduct['reduction_percent']));
$price->addChild('reduction_price', floatval($sqlProduct['reduction_price']));
}
else
{
$price->addChild('final-retail-price-without-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], false, NULL, 6, NULL, false, true, 1, false, NULL, NULL, NULL, $specificPrice));
$price->addChild('reduction_percent', ($specificPrice AND $specificPrice['reduction_type'] == 'percentage') ? $specificPrice['reduction'] * 100 : 0.00);
$price->addChild('reduction_price', ($specificPrice AND $specificPrice['reduction_type'] == 'amount') ? (float)$specificPrice['reduction'] : 0.00);
}
$price->addChild('display-on-sale', (int)$sqlProduct['on_sale']);
$product->addChild('downloadable', $sqlProduct['id_product_download'] >= 1 ? 1 : 0);
@@ -264,14 +273,30 @@ XML;
}
}
$quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)$sqlProduct['id_product'], $this->context->shop->getGroupID(), 0, 0, 0);
foreach ($quantityDiscounts AS $quantityDiscount)
if (version_compare(_PS_VERSION_, '1.4') < 0)
{
$discount = $product->addChild('discount');
$discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity']));
$discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100);
$discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%'));
$quantityDiscounts = Db::getInstance()->ExecuteS('
SELECT dq.quantity, dq.value, dq.id_discount_type
FROM '._DB_PREFIX_.'discount_quantity dq
WHERE dq.id_product = '.intval($sqlProduct['id_product']));
foreach ($quantityDiscounts AS $quantityDiscount)
{
$discount = $product->addChild('discount');
$discount->addChild('discount-quantity', intval($quantityDiscount['quantity']));
$discount->addChild('discount-value', floatval($quantityDiscount['value']));
$discount->addChild('discount-type', ($quantityDiscount['id_discount_type'] == 1 ? $defaultCurrencyIsoCode : '%'));
}
}
else
{
$quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)$sqlProduct['id_product'], $this->context->shop->getGroupID(), 0, 0, 0);
foreach ($quantityDiscounts AS $quantityDiscount)
{
$discount = $product->addChild('discount');
$discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity']));
$discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100);
$discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%'));
}
}
$categories = Db::getInstance()->ExecuteS('
+2 -2
View File
@@ -1489,7 +1489,7 @@ class UpsCarrier extends CarrierModule
'width' => ($width > 0 ? $width : 7),
'height' => ($height > 0 ? $height : 3),
'depth' => ($depth > 0 ? $depth : 5),
'weight' => ($weight > 0 ? $weight : 0.5),
'weight' => ($weight > 0.1 ? $weight : 0.1),
'packaging_type' => Configuration::get('UPS_CARRIER_PACKAGING_TYPE'),
);
}
@@ -1513,7 +1513,7 @@ class UpsCarrier extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 7),
'height' => ($product['height'] ? $product['height'] : 3),
'depth' => ($product['depth'] ? $product['depth'] : 5),
'weight' => ($product['weight'] ? $product['weight'] : 0.5),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'packaging_type' => ($config['packaging_type_code'] ? $config['packaging_type_code'] : Configuration::get('UPS_CARRIER_PACKAGING_TYPE')),
);
+2 -2
View File
@@ -1515,7 +1515,7 @@ class UspsCarrier extends CarrierModule
'width' => ($width > 0 ? $width : 1),
'height' => ($height > 0 ? $height : 1),
'depth' => ($depth > 0 ? $depth : 1),
'weight' => ($weight > 0 ? $weight : 0.5),
'weight' => ($weight > 0.1 ? $weight : 0.1),
'packaging_type' => Configuration::get('USPS_CARRIER_PACKAGING_TYPE'),
'packaging_size' => Configuration::get('USPS_CARRIER_PACKAGING_SIZE'),
'machinable' => Configuration::get('USPS_CARRIER_MACHINABLE'),
@@ -1541,7 +1541,7 @@ class UspsCarrier extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'packaging_type' => (isset($config['packaging_type_code']) ? $config['packaging_type_code'] : Configuration::get('USPS_CARRIER_PACKAGING_TYPE')),
'packaging_size' => (isset($config['packaging_size_code']) ? $config['packaging_size_code'] : Configuration::get('USPS_CARRIER_PACKAGING_SIZE')),
'machinable' => (isset($config['machinable_code']) ? $config['machinable_code'] : Configuration::get('USPS_CARRIER_MACHINABLE')),
+1 -1
View File
@@ -28,4 +28,4 @@ include(dirname(__FILE__). '/../../config/config.inc.php');
include(dirname(__FILE__). '/../../init.php');
include(dirname(__FILE__). '/vatnumber.php');
echo VatNumber::isApplicable($_GET['id_country']);
echo VatNumber::isApplicable(Tools::getValue('id_country'));
+2 -7
View File
@@ -103,13 +103,8 @@ class VatNumber extends Module
public static function isApplicable($id_country)
{
$isApplicable = in_array(Country::getIsoById((int)$id_country), VatNumber::getPrefixIntracomVAT());
if ($isApplicable == "")
{
return 0;
return (((int)$id_country AND in_array(Country::getIsoById($id_country), self::getPrefixIntracomVAT())) ? 1 : 0);
}
return 1;
}
public static function WebServiceCheck($vatNumber)
{
@@ -142,7 +137,7 @@ class VatNumber extends Module
else
sleep(1);
}
ini_restore('default_socket_timeout');
@ini_restore('default_socket_timeout');
return array(Tools::displayError('VAT number validation service unavailable'));
}