// Little fix
This commit is contained in:
1 parent
3553466293
commit
98b0be7338
3 files changed
+14
-16
No files matched your search
+8
-8
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 2007-2011 PrestaShop
|
* 2007-2011 PrestaShop
|
||||||
*
|
*
|
||||||
* NOTICE OF LICENSE
|
* NOTICE OF LICENSE
|
||||||
*
|
*
|
||||||
@@ -28,25 +28,25 @@
|
|||||||
class ContactCore extends ObjectModel
|
class ContactCore extends ObjectModel
|
||||||
{
|
{
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
/** @var string Name */
|
/** @var string Name */
|
||||||
public $name;
|
public $name;
|
||||||
|
|
||||||
/** @var string e-mail */
|
/** @var string e-mail */
|
||||||
public $email;
|
public $email;
|
||||||
|
|
||||||
/** @var string Detailed description */
|
/** @var string Detailed description */
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
public $customer_service;
|
public $customer_service;
|
||||||
|
|
||||||
protected $fieldsRequired = array();
|
protected $fieldsRequired = array();
|
||||||
protected $fieldsSize = array('email' => 128);
|
protected $fieldsSize = array('email' => 128);
|
||||||
protected $fieldsValidate = array('email' => 'isEmail', 'customer_service' => 'isBool');
|
protected $fieldsValidate = array('email' => 'isEmail', 'customer_service' => 'isBool');
|
||||||
protected $fieldsRequiredLang = array('name');
|
protected $fieldsRequiredLang = array('name');
|
||||||
protected $fieldsSizeLang = array('name' => 32);
|
protected $fieldsSizeLang = array('name' => 32);
|
||||||
protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml');
|
protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml');
|
||||||
|
|
||||||
protected $table = 'contact';
|
protected $table = 'contact';
|
||||||
protected $identifier = 'id_contact';
|
protected $identifier = 'id_contact';
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class ContactCore extends ObjectModel
|
|||||||
$fields['customer_service'] = (int)($this->customer_service);
|
$fields['customer_service'] = (int)($this->customer_service);
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check then return multilingual fields for database interaction
|
* Check then return multilingual fields for database interaction
|
||||||
*
|
*
|
||||||
@@ -68,7 +68,7 @@ class ContactCore extends ObjectModel
|
|||||||
$this->validateFieldsLang();
|
$this->validateFieldsLang();
|
||||||
return $this->getTranslationsFields(array('name', 'description'));
|
return $this->getTranslationsFields(array('name', 'description'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return available contacts
|
* Return available contacts
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-1
@@ -156,7 +156,7 @@ abstract class ModuleCore
|
|||||||
SELECT `id_module`
|
SELECT `id_module`
|
||||||
FROM `'._DB_PREFIX_.'module`
|
FROM `'._DB_PREFIX_.'module`
|
||||||
WHERE `name` = \''.pSQL($this->name).'\'');
|
WHERE `name` = \''.pSQL($this->name).'\'');
|
||||||
if (0&&$result)
|
if ($result)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$result = Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table, array('name' => $this->name, 'active' => 1), 'INSERT');
|
$result = Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table, array('name' => $this->name, 'active' => 1), 'INSERT');
|
||||||
|
|||||||
@@ -25,8 +25,6 @@
|
|||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once(dirname(__FILE__).'/../config/config.inc.php');
|
|
||||||
|
|
||||||
abstract class PaymentModuleCore extends Module
|
abstract class PaymentModuleCore extends Module
|
||||||
{
|
{
|
||||||
/** @var integer Current order's id */
|
/** @var integer Current order's id */
|
||||||
@@ -178,7 +176,7 @@ abstract class PaymentModuleCore extends Module
|
|||||||
// Insert new Order detail list using cart for the current order
|
// Insert new Order detail list using cart for the current order
|
||||||
$orderDetail = new OrderDetail($this->context);
|
$orderDetail = new OrderDetail($this->context);
|
||||||
$orderDetail->createList($order, $cart, $id_order_state);
|
$orderDetail->createList($order, $cart, $id_order_state);
|
||||||
|
|
||||||
// Insert products from cart into order_detail table
|
// Insert products from cart into order_detail table
|
||||||
$productsList = '';
|
$productsList = '';
|
||||||
$products = $cart->getProducts();
|
$products = $cart->getProducts();
|
||||||
@@ -187,7 +185,7 @@ abstract class PaymentModuleCore extends Module
|
|||||||
|
|
||||||
$price = Product::getPriceStatic((int)($product['id_product']), false, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), 6, NULL, false, true, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
$price = Product::getPriceStatic((int)($product['id_product']), false, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), 6, NULL, false, true, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
||||||
$price_wt = Product::getPriceStatic((int)($product['id_product']), true, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), 2, NULL, false, true, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
$price_wt = Product::getPriceStatic((int)($product['id_product']), true, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), 2, NULL, false, true, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
||||||
|
|
||||||
$customizationQuantity = 0;
|
$customizationQuantity = 0;
|
||||||
if (isset($customizedDatas[$product['id_product']][$product['id_product_attribute']]))
|
if (isset($customizedDatas[$product['id_product']][$product['id_product_attribute']]))
|
||||||
{
|
{
|
||||||
@@ -227,7 +225,7 @@ abstract class PaymentModuleCore extends Module
|
|||||||
<td style="padding: 0.6em 0.4em; text-align: right;">'.Tools::displayPrice(((int)($product['cart_quantity']) - $customizationQuantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), $currency, false).'</td>
|
<td style="padding: 0.6em 0.4em; text-align: right;">'.Tools::displayPrice(((int)($product['cart_quantity']) - $customizationQuantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), $currency, false).'</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
} // end foreach ($products)
|
} // end foreach ($products)
|
||||||
|
|
||||||
// Insert discounts from cart into order_discount table
|
// Insert discounts from cart into order_discount table
|
||||||
$discounts = $cart->getDiscounts();
|
$discounts = $cart->getDiscounts();
|
||||||
$discountsList = '';
|
$discountsList = '';
|
||||||
@@ -306,7 +304,7 @@ abstract class PaymentModuleCore extends Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
unset($orderDetail);
|
unset($orderDetail);
|
||||||
|
|
||||||
// Set order state in order history ONLY even if the "out of stock" status has not been yet reached
|
// Set order state in order history ONLY even if the "out of stock" status has not been yet reached
|
||||||
// So you migth have two order states
|
// So you migth have two order states
|
||||||
$new_history = new OrderHistory();
|
$new_history = new OrderHistory();
|
||||||
@@ -316,7 +314,7 @@ abstract class PaymentModuleCore extends Module
|
|||||||
|
|
||||||
// Order is reloaded because the status just changed
|
// Order is reloaded because the status just changed
|
||||||
$order = new Order($order->id);
|
$order = new Order($order->id);
|
||||||
|
|
||||||
// Send an e-mail to customer
|
// Send an e-mail to customer
|
||||||
if ($id_order_state != Configuration::get('PS_OS_ERROR') AND $id_order_state != Configuration::get('PS_OS_CANCELED') AND $customer->id)
|
if ($id_order_state != Configuration::get('PS_OS_ERROR') AND $id_order_state != Configuration::get('PS_OS_CANCELED') AND $customer->id)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user