// Merge -> revision 7941

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7948 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-08 16:01:47 +00:00
parent 58769824ce
commit 47a4f7f31e
16 changed files with 200 additions and 65 deletions
+17 -5
View File
@@ -987,8 +987,10 @@ class eBayRequest
{
$name = explode(' ', (string)$order->ShippingAddress->Name);
$itemList = array();
foreach ($order->TransactionArray->Transaction as $transaction)
for ($i = 0; isset($order->TransactionArray->Transaction[$i]); $i++)
{
$transaction = $order->TransactionArray->Transaction[$i];
$id_product = 0;
$id_attribute = 0;
$quantity = (string)$transaction->QuantityPurchased;
@@ -1007,18 +1009,28 @@ class eBayRequest
$itemList[] = array('id_product' => $id_product, 'id_product_attribute' => $id_product_attribute, 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
else
{
$reference = '-----------------------';
$skuItem = (string)$transaction->Item->SKU;
$skuVariation = (string)$transaction->Variation->SKU;
$customLabel = (string)$transaction->SellingManagerProductDetails->CustomLabel;
if ($customLabel != '') $reference = $customLabel;
else
{
if ($skuVariation != '') $reference = $skuVariation;
else $reference = $skuItem;
}
$id_product = Db::getInstance()->getValue('
SELECT `id_product` FROM `'._DB_PREFIX_.'product`
WHERE `reference` = \''.pSQL((string)$transaction->item->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->item->CustomLabel).'\' OR `reference` = \''.pSQL((string)$transaction->SellingManagerProductDetails->CustomLabel).'\'
OR `reference` = \''.pSQL((string)$transaction->Variation->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->Variation->CustomLabel).'\'');
WHERE `reference` = \''.pSQL($reference).'\'');
if ((int)$id_product > 0)
$itemList[] = array('id_product' => $id_product, 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
else
{
$row = Db::getInstance()->getValue('
SELECT `id_product`, `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute`
WHERE `reference` = \''.pSQL((string)$transaction->item->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->item->CustomLabel).'\' OR `reference` = \''.pSQL((string)$transaction->SellingManagerProductDetails->CustomLabel).'\'
OR `reference` = \''.pSQL((string)$transaction->Variation->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->Variation->CustomLabel).'\'');
WHERE `reference` = \''.pSQL($reference).'\'');
if ((int)$row['id_product'] > 0)
$itemList[] = array('id_product' => $row['id_product'], 'id_product_attribute' => $row['id_product_attribute'], 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
}
-1
View File
@@ -339,7 +339,6 @@ class Ebay extends Module
if (Validate::isEmail($order['email']) && !empty($order['firstname']) && !empty($order['familyname']))
{
// Add customer if he doesn't exist
if ($id_customer < 1)
{
+1 -1
View File
@@ -28,6 +28,6 @@
include(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/sendtoafriend.php');
$sendtoafriend = new sendToAFriend();
$sendtoafriend = new sendToAFriend($dontTranslate = true);
echo $sendtoafriend->displayPageForm();
+4 -1
View File
@@ -30,7 +30,7 @@ if (!defined('_CAN_LOAD_FILES_'))
class sendToAFriend extends Module
{
function __construct()
function __construct($dontTranslate = false)
{
$this->name = 'sendtoafriend';
$this->version = '1.1';
@@ -40,9 +40,12 @@ class sendToAFriend extends Module
parent::__construct();
if(!$dontTranslate)
{
$this->displayName = $this->l('Send to a Friend module');
$this->description = $this->l('Allows customers to send a product link to a friend.');
}
}
function install()
{