Updated the id_cart_booking_data to id_htl_cart_booking
This commit is contained in:
@@ -3042,7 +3042,7 @@ class ProductCore extends ObjectModel
|
||||
public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null,
|
||||
$only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null,
|
||||
$id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, ?Context $context = null,
|
||||
$use_customer_price = true, $id_hotel = false, $id_product_room_type = false, $id_group = null, $id_cart_booking_data = 0)
|
||||
$use_customer_price = true, $id_hotel = false, $id_product_room_type = false, $id_group = null, $id_htl_cart_booking = 0)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
@@ -3178,7 +3178,7 @@ class ProductCore extends ObjectModel
|
||||
$cart_quantity,
|
||||
$id_hotel,
|
||||
$id_product_room_type,
|
||||
$id_cart_booking_data
|
||||
$id_htl_cart_booking
|
||||
);
|
||||
|
||||
return $return;
|
||||
@@ -3212,7 +3212,7 @@ class ProductCore extends ObjectModel
|
||||
**/
|
||||
public static function priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $zipcode, $id_currency,
|
||||
$id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, &$specific_price, $use_group_reduction,
|
||||
$id_customer = 0, $use_customer_price = true, $id_cart = 0, $real_quantity = 0, $id_hotel = false, $id_product_room_type = false, $id_cart_booking_data = 0)
|
||||
$id_customer = 0, $use_customer_price = true, $id_cart = 0, $real_quantity = 0, $id_hotel = false, $id_product_room_type = false, $id_htl_cart_booking = 0)
|
||||
{
|
||||
static $address = null;
|
||||
static $context = null;
|
||||
@@ -3248,7 +3248,7 @@ class ProductCore extends ObjectModel
|
||||
'-'.(int)$quantity.'-'.(int)$id_product_attribute.
|
||||
'-'.(int)$with_ecotax.'-'.(int)$id_customer.'-'.(int)$use_group_reduction.'-'.(int)$id_cart.'-'.(int)$real_quantity.
|
||||
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals.'-'.($id_hotel?(int)$id_hotel:'0')
|
||||
.'-'.($id_product_option?(int)$id_product_option:'0'.'-'.($id_product_room_type?(int)$id_product_room_type:'0').'-'.(int)$id_cart_booking_data);
|
||||
.'-'.($id_product_option?(int)$id_product_option:'0'.'-'.($id_product_room_type?(int)$id_product_room_type:'0').'-'.(int)$id_htl_cart_booking);
|
||||
|
||||
// reference parameter is filled before any returns
|
||||
$specific_price = SpecificPrice::getSpecificPrice(
|
||||
@@ -3262,7 +3262,7 @@ class ProductCore extends ObjectModel
|
||||
$id_customer,
|
||||
$id_cart,
|
||||
$real_quantity,
|
||||
$id_cart_booking_data
|
||||
$id_htl_cart_booking
|
||||
);
|
||||
|
||||
if (isset(self::$_prices[$cache_id])) {
|
||||
@@ -6862,7 +6862,7 @@ class ProductCore extends ObjectModel
|
||||
'use_tax' => $useTax,
|
||||
'id_cart' => $idCart,
|
||||
'use_reduc' => $useReduc,
|
||||
'id_cart_booking_data' => $idCartBooking
|
||||
'id_htl_cart_booking' => $idCartBooking
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
public $reduction_type;
|
||||
public $from;
|
||||
public $to;
|
||||
public $id_cart_booking_data;
|
||||
public $id_htl_cart_booking;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
@@ -69,7 +69,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
'reduction_type' => array('type' => self::TYPE_STRING, 'validate' => 'isReductionType', 'required' => true),
|
||||
'from' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'required' => true),
|
||||
'to' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'required' => true),
|
||||
'id_cart_booking_data' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_htl_cart_booking' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -347,7 +347,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0, $real_quantity = 0, $id_cart_booking_data = 0)
|
||||
public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0, $real_quantity = 0, $id_htl_cart_booking = 0)
|
||||
{
|
||||
if (!SpecificPrice::isFeatureActive()) {
|
||||
return array();
|
||||
@@ -357,7 +357,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
** The price must not change between the top and the bottom of the page
|
||||
*/
|
||||
|
||||
$key = ((int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.(int)$id_group.'-'.(int)$quantity.'-'.(int)$id_product_attribute.'-'.(int)$id_cart.'-'.(int)$id_customer.'-'.(int)$real_quantity.'-'.(int) $id_cart_booking_data);
|
||||
$key = ((int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.(int)$id_group.'-'.(int)$quantity.'-'.(int)$id_product_attribute.'-'.(int)$id_cart.'-'.(int)$id_customer.'-'.(int)$real_quantity.'-'.(int) $id_htl_cart_booking);
|
||||
if (!array_key_exists($key, SpecificPrice::$_specificPriceCache)) {
|
||||
$query_extra = self::computeExtraConditions($id_product, $id_product_attribute, $id_customer, $id_cart);
|
||||
$query = '
|
||||
@@ -367,7 +367,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
`id_shop` '.self::formatIntInQuery(0, $id_shop).' AND
|
||||
`id_currency` '.self::formatIntInQuery(0, $id_currency).' AND
|
||||
`id_country` '.self::formatIntInQuery(0, $id_country).
|
||||
' AND `id_cart_booking_data`='.(int)$id_cart_booking_data.' '.
|
||||
' AND `id_htl_cart_booking`='.(int)$id_htl_cart_booking.' '.
|
||||
(Group::isFeatureActive() ? ' AND `id_group` '.self::formatIntInQuery(0, $id_group) : '').' '.$query_extra.'
|
||||
AND IF(`from_quantity` > 1, `from_quantity`, 0) <= ';
|
||||
|
||||
|
||||
@@ -1684,7 +1684,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$objSpecificPrice->price = $unitPrice;
|
||||
$objSpecificPrice->from_quantity = 1;
|
||||
$objSpecificPrice->reduction = 0;
|
||||
$objSpecificPrice->id_cart_booking_data = $objHotelCartBookingData->id;
|
||||
$objSpecificPrice->id_htl_cart_booking = $objHotelCartBookingData->id;
|
||||
$objSpecificPrice->reduction_type = 'amount';
|
||||
$objSpecificPrice->reduction_tax = 0;
|
||||
$objSpecificPrice->from = '0000-00-00 00:00:00';
|
||||
|
||||
@@ -1888,7 +1888,7 @@ CREATE TABLE `PREFIX_specific_price` (
|
||||
`id_country` INT UNSIGNED NOT NULL,
|
||||
`id_group` INT UNSIGNED NOT NULL,
|
||||
`id_customer` INT UNSIGNED NOT NULL,
|
||||
`id_cart_booking_data` INT UNSIGNED NOT NULL,
|
||||
`id_htl_cart_booking` INT UNSIGNED NOT NULL,
|
||||
`id_product_attribute` INT UNSIGNED NOT NULL,
|
||||
`price` DECIMAL(20, 6) NOT NULL,
|
||||
`from_quantity` mediumint(8) UNSIGNED NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user