// Merge -> revision 8076

This commit is contained in:
rMalie
2011-08-17 08:15:38 +00:00
parent 710be54b89
commit cba5631db0
22 changed files with 100 additions and 46 deletions
+1 -2
View File
@@ -75,8 +75,7 @@ class AdminAddresses extends AdminTab
{ {
if (Validate::isEmail(Tools::getValue('email'))) if (Validate::isEmail(Tools::getValue('email')))
{ {
$customer = new Customer; $customer = new Customer(Tools::getValue('id_customer'));
$customer = $customer->getByemail(Tools::getValue('email'));
if (Validate::isLoadedObject($customer)) if (Validate::isLoadedObject($customer))
$_POST['id_customer'] = $customer->id; $_POST['id_customer'] = $customer->id;
else else
+1 -1
View File
@@ -222,7 +222,7 @@ class AdminCategories extends AdminTab
'Collapse All' => $this->l('Collapse All'), 'Collapse All' => $this->l('Collapse All'),
'Expand All' => $this->l('Expand All') 'Expand All' => $this->l('Expand All')
); );
echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : 1), 'id_parent', true); echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1)), 'id_parent', true);
echo '</div> echo '</div>
<label>'.$this->l('Description:').' </label> <label>'.$this->l('Description:').' </label>
<div class="margin-form translatable">'; <div class="margin-form translatable">';
+10 -5
View File
@@ -1583,12 +1583,17 @@ class AdminProducts extends AdminTab
{ {
echo ' if (toload[id]) { echo ' if (toload[id]) {
toload[id] = false; toload[id] = false;
$.post(
"'.dirname(self::$currentIndex).'/ajax.php", { $.ajax({
url: "'.dirname(self::$currentIndex).'/ajax.php",
data: {
ajaxProductTab: id, id_product: '.$obj->id.', ajaxProductTab: id, id_product: '.$obj->id.',
token: \''.Tools::getValue('token').'\', token: \''.Tools::getValue('token').'\',
id_category: '.(int)(Tools::getValue('id_category')).'}, id_category: '.(int)(Tools::getValue('id_category')).'
function(rep) { },
cache: false,
type: \'POST\',
success: function(rep) {
$("#step" + id).html(rep);var languages = new Array(); $("#step" + id).html(rep);var languages = new Array();
if (id == 3) if (id == 3)
populate_attrs(); populate_attrs();
@@ -1607,7 +1612,7 @@ class AdminProducts extends AdminTab
}); });
} }
} }
) })
}'; }';
} }
echo ' } echo ' }
+8 -1
View File
@@ -34,7 +34,7 @@ class authorizeAIM extends PaymentModule
{ {
$this->name = 'authorizeaim'; $this->name = 'authorizeaim';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = '1.1'; $this->version = '1.2';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->limited_countries = array('us'); $this->limited_countries = array('us');
$this->need_instance = 0; $this->need_instance = 0;
@@ -43,6 +43,13 @@ class authorizeAIM extends PaymentModule
$this->displayName = 'Authorize.net AIM (Advanced Integration Method)'; $this->displayName = 'Authorize.net AIM (Advanced Integration Method)';
$this->description = $this->l('Receive payment with Authorize.net'); $this->description = $this->l('Receive payment with Authorize.net');
/* 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.'_'));
} }
public function install() public function install()
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>authorizeaim</name> <name>authorizeaim</name>
<displayName><![CDATA[Authorize.net AIM (Advanced Integration Method)]]></displayName> <displayName><![CDATA[Authorize.net AIM (Advanced Integration Method)]]></displayName>
<version><![CDATA[1.1]]></version> <version><![CDATA[1.2]]></version>
<description><![CDATA[Receive payment with Authorize.net]]></description> <description><![CDATA[Receive payment with Authorize.net]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
@@ -128,6 +128,7 @@ class BirthdayPresent extends Module
$voucher->name = 'BIRTHDAY-'.(int)($voucher->id_customer).'-'.date('Y'); $voucher->name = 'BIRTHDAY-'.(int)($voucher->id_customer).'-'.date('Y');
$voucher->description[(int)(Configuration::get('PS_LANG_DEFAULT'))] = $this->l('Your birthday present !'); $voucher->description[(int)(Configuration::get('PS_LANG_DEFAULT'))] = $this->l('Your birthday present !');
$voucher->value = Configuration::get('BIRTHDAY_DISCOUNT_VALUE'); $voucher->value = Configuration::get('BIRTHDAY_DISCOUNT_VALUE');
$voucher->id_currency = Configuration::get('PS_CURRENCY_DEFAULT');
$voucher->quantity = 1; $voucher->quantity = 1;
$voucher->quantity_per_user = 1; $voucher->quantity_per_user = 1;
$voucher->cumulable = 1; $voucher->cumulable = 1;
+1 -1
View File
@@ -685,7 +685,7 @@ class BlockCms extends Module
$footer .= $box.'|'; $footer .= $box.'|';
Configuration::updateValue('FOOTER_CMS', rtrim($footer, '|')); Configuration::updateValue('FOOTER_CMS', rtrim($footer, '|'));
Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', Tools::getValue('footer_active')); Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', Tools::getValue('footer_active'));
Configuration::updateValue('FOOTER_POWEREDBY', (Tools::getValue('footer_poweredby_active') == 1 ? 1 : 0)); Configuration::updateValue('FOOTER_POWEREDBY', (Tools::getValue('footer_poweredby_active') == 'on' ? 1 : 0));
$this->_html = $this->displayConfirmation($this->l('Footer\'s CMS updated')); $this->_html = $this->displayConfirmation($this->l('Footer\'s CMS updated'));
} }
+8 -1
View File
@@ -57,7 +57,7 @@ class CashTicket extends PrepaidServices
{ {
$this->name = 'cashticket'; $this->name = 'cashticket';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = 1.2; $this->version = '1.3';
$this->module_dir = dirname(__FILE__); $this->module_dir = dirname(__FILE__);
$this->certificat_dir = dirname(__FILE__).'/keyring/'; $this->certificat_dir = dirname(__FILE__).'/keyring/';
$this->need_instance = 0; $this->need_instance = 0;
@@ -66,6 +66,13 @@ class CashTicket extends PrepaidServices
$this->displayName = $this->l('CashTicket'); $this->displayName = $this->l('CashTicket');
$this->description = $this->l('Accepts payments by CashTicket'); $this->description = $this->l('Accepts payments by CashTicket');
/* 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.'_'));
} }
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>cashticket</name> <name>cashticket</name>
<displayName><![CDATA[CashTicket]]></displayName> <displayName><![CDATA[CashTicket]]></displayName>
<version><![CDATA[1.2]]></version> <version><![CDATA[1.3]]></version>
<description><![CDATA[Accepts payments by CashTicket]]></description> <description><![CDATA[Accepts payments by CashTicket]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+4
View File
@@ -389,6 +389,7 @@ class eBayRequest
$requestXml .= ' <CategoryID>'.$datas['categoryId'].'</CategoryID>'."\n"; $requestXml .= ' <CategoryID>'.$datas['categoryId'].'</CategoryID>'."\n";
$requestXml .= ' </PrimaryCategory>'."\n"; $requestXml .= ' </PrimaryCategory>'."\n";
$requestXml .= ' <ConditionID>1000</ConditionID>'."\n"; $requestXml .= ' <ConditionID>1000</ConditionID>'."\n";
if (!isset($datas['noPriceUpdate']))
$requestXml .= ' <StartPrice>'.$datas['price'].'</StartPrice>'."\n"; $requestXml .= ' <StartPrice>'.$datas['price'].'</StartPrice>'."\n";
$requestXml .= ' <CategoryMappingAllowed>true</CategoryMappingAllowed>'."\n"; $requestXml .= ' <CategoryMappingAllowed>true</CategoryMappingAllowed>'."\n";
$requestXml .= ' <Country>FR</Country>'."\n"; $requestXml .= ' <Country>FR</Country>'."\n";
@@ -505,6 +506,7 @@ class eBayRequest
$requestXml .= ' <ItemID>'.$datas['itemID'].'</ItemID>'."\n"; $requestXml .= ' <ItemID>'.$datas['itemID'].'</ItemID>'."\n";
$requestXml .= ' <SKU>prestashop-'.$datas['id_product'].'</SKU>'; $requestXml .= ' <SKU>prestashop-'.$datas['id_product'].'</SKU>';
$requestXml .= ' <Quantity>'.$datas['quantity'].'</Quantity>'."\n"; $requestXml .= ' <Quantity>'.$datas['quantity'].'</Quantity>'."\n";
if (!isset($datas['noPriceUpdate']))
$requestXml .= ' <StartPrice>'.$datas['price'].'</StartPrice>'."\n"; $requestXml .= ' <StartPrice>'.$datas['price'].'</StartPrice>'."\n";
if (Configuration::get('EBAY_SYNC_OPTION_RESYNC') != 1) if (Configuration::get('EBAY_SYNC_OPTION_RESYNC') != 1)
{ {
@@ -734,6 +736,7 @@ class eBayRequest
{ {
$requestXml .= ' <Variation>'."\n"; $requestXml .= ' <Variation>'."\n";
$requestXml .= ' <SKU>prestashop-'.$key.'</SKU>'."\n"; $requestXml .= ' <SKU>prestashop-'.$key.'</SKU>'."\n";
if (!isset($datas['noPriceUpdate']))
$requestXml .= ' <StartPrice>'.$variation['price'].'</StartPrice>'."\n"; $requestXml .= ' <StartPrice>'.$variation['price'].'</StartPrice>'."\n";
$requestXml .= ' <Quantity>'.$variation['quantity'].'</Quantity>'."\n"; $requestXml .= ' <Quantity>'.$variation['quantity'].'</Quantity>'."\n";
$requestXml .= ' <VariationSpecifics>'."\n"; $requestXml .= ' <VariationSpecifics>'."\n";
@@ -900,6 +903,7 @@ class eBayRequest
{ {
$requestXml .= ' <Variation>'."\n"; $requestXml .= ' <Variation>'."\n";
$requestXml .= ' <SKU>prestashop-'.$key.'</SKU>'."\n"; $requestXml .= ' <SKU>prestashop-'.$key.'</SKU>'."\n";
if (!isset($datas['noPriceUpdate']))
$requestXml .= ' <StartPrice>'.$variation['price'].'</StartPrice>'."\n"; $requestXml .= ' <StartPrice>'.$variation['price'].'</StartPrice>'."\n";
$requestXml .= ' <Quantity>'.$variation['quantity'].'</Quantity>'."\n"; $requestXml .= ' <Quantity>'.$variation['quantity'].'</Quantity>'."\n";
$requestXml .= ' <VariationSpecifics>'."\n"; $requestXml .= ' <VariationSpecifics>'."\n";
+10 -2
View File
@@ -269,6 +269,8 @@ class Ebay extends Module
{ {
// Retrieve product list for eBay (which have matched categories) AND Send each product on eBay // Retrieve product list for eBay (which have matched categories) AND Send each product on eBay
$productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE '.$sql.' AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0)'); $productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE '.$sql.' AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0)');
foreach ($productList as $k => $v)
$productList[$k]['noPriceUpdate'] = 1;
if ($productsList) if ($productsList)
$this->_syncProducts($productsList); $this->_syncProducts($productsList);
} }
@@ -276,6 +278,8 @@ class Ebay extends Module
{ {
// Select the sync Categories and Retrieve product list for eBay (which have matched and sync categories) AND Send each product on eBay // Select the sync Categories and Retrieve product list for eBay (which have matched and sync categories) AND Send each product on eBay
$productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE '.$sql.' AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1)'); $productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE '.$sql.' AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1)');
foreach ($productList as $k => $v)
$productList[$k]['noPriceUpdate'] = 1;
if ($productsList) if ($productsList)
$this->_syncProducts($productsList); $this->_syncProducts($productsList);
} }
@@ -1319,10 +1323,10 @@ class Ebay extends Module
@set_time_limit(3600); @set_time_limit(3600);
// Run the products list // Run the products list
foreach ($productsList as $product) foreach ($productsList as $p)
{ {
// Product instanciation // Product instanciation
$product = new Product((int)$product['id_product'], true, $this->id_lang); $product = new Product((int)$p['id_product'], true, $this->id_lang);
if (Validate::isLoadedObject($product) && $product->id_category_default > 0) if (Validate::isLoadedObject($product) && $product->id_category_default > 0)
{ {
// Load default category matched in cache // Load default category matched in cache
@@ -1408,6 +1412,10 @@ class Ebay extends Module
'picturesLarge' => $picturesLarge, 'picturesLarge' => $picturesLarge,
); );
// Price Update
if (isset($p['noPriceUpdate']))
$datas['noPriceUpdate'] = $p['noPriceUpdate'];
// Save percent and price discount // Save percent and price discount
if ($categoryDefaultCache[$product->id_category_default]['percent'] < 0) if ($categoryDefaultCache[$product->id_category_default]['percent'] < 0)
{ {
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>gcheckout</name> <name>gcheckout</name>
<displayName><![CDATA[Google Checkout]]></displayName> <displayName><![CDATA[Google Checkout]]></displayName>
<version><![CDATA[1.1]]></version> <version><![CDATA[1.2]]></version>
<description><![CDATA[Google Checkout API implementation]]></description> <description><![CDATA[Google Checkout API implementation]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+8 -1
View File
@@ -34,7 +34,7 @@ class GCheckout extends PaymentModule
{ {
$this->name = 'gcheckout'; $this->name = 'gcheckout';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = 1.1; $this->version = '1.2';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->currencies = true; $this->currencies = true;
@@ -47,6 +47,13 @@ class GCheckout extends PaymentModule
if (!sizeof(Currency::checkPaymentCurrencies($this->id))) if (!sizeof(Currency::checkPaymentCurrencies($this->id)))
$this->warning = $this->l('No currency set for this module'); $this->warning = $this->l('No currency set for this module');
/* 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.'_'));
} }
public function install() public function install()
+8 -8
View File
@@ -44,26 +44,26 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() $(document).ready(function()
{ {literal}{{/literal}
// Bind id_carrierX to an ajax call // Bind id_carrierX to an ajax call
{foreach from=$carriersextra item=carrier name=myLoop} {foreach from=$carriersextra item=carrier name=myLoop}
$('#id_carrier' + {$carrier.id_carrier}).click(function() $('#id_carrier' + {$carrier.id_carrier}).click(function()
{ {literal}{{/literal}
PS_MRCarrierSelectedProcess($(this), {$carrier.id_carrier}, '{$carrier.mr_ModeLiv}'); PS_MRCarrierSelectedProcess($(this), {$carrier.id_carrier}, '{$carrier.mr_ModeLiv}');
}); {literal}}{/literal});
PS_MRCarrierMethodList[{$carrier.id_carrier}] = {$carrier.id_mr_method}; PS_MRCarrierMethodList[{$carrier.id_carrier}] = {$carrier.id_mr_method};
if ($('#id_carrier' + {$carrier.id_carrier}).attr('checked')) if ($('#id_carrier' + {$carrier.id_carrier}).attr('checked'))
{ {literal}{{/literal}
PS_MRCarrierSelectedProcess($('#id_carrier' + {$carrier.id_carrier}), {$carrier.id_carrier}, '{$carrier.mr_ModeLiv}'); PS_MRCarrierSelectedProcess($('#id_carrier' + {$carrier.id_carrier}), {$carrier.id_carrier}, '{$carrier.mr_ModeLiv}');
} {literal}}{/literal}
{/foreach} {/foreach}
// Handle input click of the other input to hide the previous relay point list displayed // Handle input click of the other input to hide the previous relay point list displayed
$('input[name=id_carrier]').click(function() $('input[name=id_carrier]').click(function()
{ {literal}{{/literal}
// Hide MR input if one of them is not selected // Hide MR input if one of them is not selected
if (PS_MRCarrierMethodList[$(this).val()] == undefined) if (PS_MRCarrierMethodList[$(this).val()] == undefined)
PS_MRHideLastRelayPointList(); PS_MRHideLastRelayPointList();
}) {literal}}{/literal})
}); {literal}}{/literal});
</script> </script>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>ogone</name> <name>ogone</name>
<displayName><![CDATA[Ogone]]></displayName> <displayName><![CDATA[Ogone]]></displayName>
<version><![CDATA[2.0]]></version> <version><![CDATA[2.1]]></version>
<description><![CDATA[]]></description> <description><![CDATA[]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+8 -1
View File
@@ -36,12 +36,19 @@ class Ogone extends PaymentModule
{ {
$this->name = 'ogone'; $this->name = 'ogone';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = '2.0'; $this->version = '2.1';
parent::__construct(); parent::__construct();
$this->displayName = 'Ogone'; $this->displayName = 'Ogone';
$this->description = ''; $this->description = '';
/* 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.'_'));
} }
public function install() public function install()
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>paypal</name> <name>paypal</name>
<displayName><![CDATA[PayPal]]></displayName> <displayName><![CDATA[PayPal]]></displayName>
<version><![CDATA[2.7]]></version> <version><![CDATA[2.8]]></version>
<description><![CDATA[Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.]]></description> <description><![CDATA[Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+12 -10
View File
@@ -40,7 +40,7 @@ class PayPal extends PaymentModule
{ {
$this->name = 'paypal'; $this->name = 'paypal';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = '2.7'; $this->version = '2.8';
$this->currencies = true; $this->currencies = true;
$this->currencies_mode = 'radio'; $this->currencies_mode = 'radio';
@@ -352,7 +352,7 @@ class PayPal extends PaymentModule
$products = $order->getProducts(); $products = $order->getProducts();
$amt = $products[(int)($order_detail->id)]['product_price_wt'] * (int)($_POST['cancelQuantity'][(int)($order_detail->id)]); $amt = $products[(int)($order_detail->id)]['product_price_wt'] * (int)($_POST['cancelQuantity'][(int)($order_detail->id)]);
$response = $this->_makeRefund($id_transaction, (float)($amt)); $response = $this->_makeRefund($id_transaction, $order->id, (float)($amt));
$message = $this->l('Cancel products result:').'<br>'; $message = $this->l('Cancel products result:').'<br>';
foreach ($response AS $k => $value) foreach ($response AS $k => $value)
$message .= $k.': '.$value.'<br>'; $message .= $k.': '.$value.'<br>';
@@ -975,7 +975,7 @@ class PayPal extends PaymentModule
WHERE `id_order` = '.(int)$id_order); WHERE `id_order` = '.(int)$id_order);
} }
private function _makeRefund($id_transaction, $amt = false) private function _makeRefund($id_transaction, $id_order, $amt = false)
{ {
include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php');
@@ -991,7 +991,8 @@ class PayPal extends PaymentModule
$isoCurrency = Db::getInstance()->getValue(' $isoCurrency = Db::getInstance()->getValue('
SELECT `iso_code` SELECT `iso_code`
FROM `'._DB_PREFIX_.'orders` o FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'currency` c ON (o.`id_currency` = c.`id_currency`)'); LEFT JOIN `'._DB_PREFIX_.'currency` c ON (o.`id_currency` = c.`id_currency`)
WHERE o.`id_order` = '.(int)$id_order);
$request = '&TRANSACTIONID='.urlencode($id_transaction).'&REFUNDTYPE=Partial&AMT='.(float)($amt).'&CURRENCYCODE='.urlencode(strtoupper($isoCurrency)); $request = '&TRANSACTIONID='.urlencode($id_transaction).'&REFUNDTYPE=Partial&AMT='.(float)($amt).'&CURRENCYCODE='.urlencode(strtoupper($isoCurrency));
} }
$paypalLib = new PaypalLib(); $paypalLib = new PaypalLib();
@@ -1028,17 +1029,18 @@ class PayPal extends PaymentModule
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
return false; return false;
$products = $order->getProducts(); $products = $order->getProducts();
// Amount for refund // Amount for refund
$amt = 0.00; $amt = 0.00;
foreach ($products AS $product) foreach ($products AS $product)
if ($product['product_quantity_refunded'] == 0) $amt += (float)($product['total_price']) * ($product['product_quantity'] - $product['product_quantity_refunded']);
$amt += (float)($product['total_price']); $amt += (float)($order->total_shipping) + (float)($order->total_wrapping) - (float)($order->total_discounts);
$amt += (float)($order->total_shipping);
// check if total or partial // check if total or partial
if ($order->total_products_wt == $amt) if ($this->PayPalRound($order->total_paid_real) == $this->PayPalRound($amt))
$response = $this->_makeRefund($id_transaction); $response = $this->_makeRefund($id_transaction, $id_order);
else else
$response = $this->_makeRefund($id_transaction, (float)($amt)); $response = $this->_makeRefund($id_transaction, $id_order, (float)($amt));
$message = $this->l('Refund operation result:').'<br>'; $message = $this->l('Refund operation result:').'<br>';
foreach ($response AS $k => $value) foreach ($response AS $k => $value)
$message .= $k.': '.$value.'<br>'; $message .= $k.': '.$value.'<br>';
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>paysafecard</name> <name>paysafecard</name>
<displayName><![CDATA[PaysafeCard]]></displayName> <displayName><![CDATA[PaysafeCard]]></displayName>
<version><![CDATA[1.2]]></version> <version><![CDATA[1.3]]></version>
<description><![CDATA[Accepts payments by PaysafeCard.]]></description> <description><![CDATA[Accepts payments by PaysafeCard.]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab> <tab><![CDATA[payments_gateways]]></tab>
+8 -1
View File
@@ -58,7 +58,7 @@ class PaysafeCard extends PSCPrepaidServices
{ {
$this->name = 'paysafecard'; $this->name = 'paysafecard';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = 1.2; $this->version = '1.3';
$this->module_dir = dirname(__FILE__); $this->module_dir = dirname(__FILE__);
$this->certificat_dir = dirname(__FILE__).'/keyring/'; $this->certificat_dir = dirname(__FILE__).'/keyring/';
$this->need_instance = 0; $this->need_instance = 0;
@@ -67,6 +67,13 @@ class PaysafeCard extends PSCPrepaidServices
$this->displayName = $this->l('PaysafeCard'); $this->displayName = $this->l('PaysafeCard');
$this->description = $this->l('Accepts payments by PaysafeCard.'); $this->description = $this->l('Accepts payments by PaysafeCard.');
/* 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.'_'));
} }
public function getL($key) public function getL($key)
+5 -5
View File
@@ -57,7 +57,7 @@ class UspsCarrier extends CarrierModule
parent::__construct (); parent::__construct ();
$this->displayName = $this->l('USPS Carrier'); $this->displayName = $this->l('U.S.P.S Rate Calulator');
$this->description = $this->l('Offer your customers, different delivery methods with USPS'); $this->description = $this->l('Offer your customers, different delivery methods with USPS');
if (self::isInstalled($this->name)) if (self::isInstalled($this->name))
@@ -71,7 +71,7 @@ class UspsCarrier extends CarrierModule
if (!Configuration::get($keyConfiguration) && !empty($name)) if (!Configuration::get($keyConfiguration) && !empty($name))
$warning[] = '\''.$name.'\' '; $warning[] = '\''.$name.'\' ';
// Check calcul mode // Check calculation mode
if (!Configuration::get('USPS_CARRIER_CALCUL_MODE')) if (!Configuration::get('USPS_CARRIER_CALCUL_MODE'))
Configuration::updateValue('USPS_CARRIER_CALCUL_MODE', 'split'); Configuration::updateValue('USPS_CARRIER_CALCUL_MODE', 'split');
@@ -134,7 +134,7 @@ class UspsCarrier extends CarrierModule
'TRUE' => $this->l('True') 'TRUE' => $this->l('True')
); );
// Loading calcul mode list // Loading calculation mode list
$this->_calculModeList = array( $this->_calculModeList = array(
'onepackage' => $this->l('All items in one package'), 'onepackage' => $this->l('All items in one package'),
'split' => $this->l('Split one item per package') 'split' => $this->l('Split one item per package')
@@ -549,14 +549,14 @@ class UspsCarrier extends CarrierModule
$html .= '</select> $html .= '</select>
<p>' . $this->l('Select if it is machinable or not by default.') . '</p> <p>' . $this->l('Select if it is machinable or not by default.') . '</p>
</div> </div>
<label>'.$this->l('Calcul mode').' : </label> <label>'.$this->l('Calculation mode').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="usps_carrier_calcul_mode">'; <select name="usps_carrier_calcul_mode">';
$idcalculmode = array(); $idcalculmode = array();
foreach($this->_calculModeList as $kcalculmode => $vcalculmode) foreach($this->_calculModeList as $kcalculmode => $vcalculmode)
$html .= '<option value="'.$kcalculmode.'" '.($kcalculmode == (Tools::getValue('usps_carrier_calcul_mode', Configuration::get('USPS_CARRIER_CALCUL_MODE'))) ? 'selected="selected"' : '').'>'.$vcalculmode.'</option>'; $html .= '<option value="'.$kcalculmode.'" '.($kcalculmode == (Tools::getValue('usps_carrier_calcul_mode', Configuration::get('USPS_CARRIER_CALCUL_MODE'))) ? 'selected="selected"' : '').'>'.$vcalculmode.'</option>';
$html .= '</select> $html .= '</select>
<p>' . $this->l('Using the calcul mode "All items in one package" will automatically use default packaging size, packaging type and delivery services. Specifics configurations for categories or product won\'t be used.') . '</p> <p>' . $this->l('Using the calculation mode "All items in one package" will automatically use default packaging size, packaging type and delivery services. Specifics configurations for categories or product won\'t be used.') . '</p>
</div> </div>
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
+1 -1
View File
@@ -32,7 +32,7 @@
<li>{$error}</li> <li>{$error}</li>
{/foreach} {/foreach}
</ol> </ol>
{if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication') && preg_replace('#^http://[^/]+/#', '/', $smarty.server.HTTP_REFERER) != $request_uri} {if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication') && preg_replace('#^https?://[^/]+/#', '/', $smarty.server.HTTP_REFERER) != $request_uri}
<p class="align_right"><a href="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}" class="button_small" title="{l s='Back'}">&laquo; {l s='Back'}</a></p> <p class="align_right"><a href="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}" class="button_small" title="{l s='Back'}">&laquo; {l s='Back'}</a></p>
{/if} {/if}
</div> </div>