Merge pull request #682 from shreesh-webkul/gli-1398
Updated: order summary in block cart popup and dropdown
This commit is contained in:
@@ -912,7 +912,7 @@ var ajaxCart = {
|
||||
content += '<tr class="rooms_remove_container">';
|
||||
content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + '</td>';
|
||||
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td>';
|
||||
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
content += '</td>';
|
||||
@@ -949,7 +949,7 @@ var ajaxCart = {
|
||||
booking_dates_content += '<tr class="rooms_remove_container">';
|
||||
booking_dates_content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + '</td>';
|
||||
booking_dates_content += '<td class="num_rooms_in_date">' + date_diff_v1.num_rm + '</td>';
|
||||
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
booking_dates_content += '<td>';
|
||||
booking_dates_content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v1.amount + ' id_product=' + productId + ' date_from=' + date_diff_v1.data_form + ' date_to=' + date_diff_v1.data_to + ' num_rooms=' + date_diff_v1.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
booking_dates_content += '</td>';
|
||||
@@ -1154,16 +1154,20 @@ var ajaxCart = {
|
||||
if (hasDeliveryAddress)
|
||||
$('.ajax_cart_shipping_cost').parent().find('.unvisible').show();
|
||||
|
||||
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
|
||||
$('.ajax_cart_tax_cost').text(jsonData.tax_cost);
|
||||
$('.cart_block_wrapping_cost').text(jsonData.wrapping_cost);
|
||||
|
||||
$('.ajax_block_cart_total').text(jsonData.total);
|
||||
$('.ajax_block_cart_total').attr('total_cart_price', jsonData.totalToPay);
|
||||
|
||||
$('.ajax_block_products_total').text(jsonData.product_total);
|
||||
$('.ajax_block_room_total').text(jsonData.roomTotal);
|
||||
$('.ajax_block_room_total').text(jsonData.room_total);
|
||||
$('.ajax_block_nornal_products_total').text(jsonData.normalProductsTotal);
|
||||
$('.ajax_cart_extra_demands_cost').text(jsonData.total_extra_services_format);
|
||||
$('.ajax_cart_convenience_fee').text(jsonData.total_convenience_fee_format);
|
||||
if (jsonData.total_convenience_fee) {
|
||||
$('.ajax_cart_convenience_fee').parent().show();
|
||||
} else {
|
||||
$('.ajax_cart_convenience_fee').parent().hide();
|
||||
}
|
||||
$('.ajax_total_price_wt').text(jsonData.total_price_wt);
|
||||
|
||||
if (parseFloat(jsonData.free_shipping_float) > 0) {
|
||||
|
||||
@@ -1,39 +1,38 @@
|
||||
/*******************************************************************
|
||||
Cart Block Styles
|
||||
********************************************************************/
|
||||
#header .shopping_cart {
|
||||
position: relative;
|
||||
float: right;
|
||||
/*margin-bottom: 20px;*/
|
||||
/*padding-top: 5px;*/ }
|
||||
#header .shopping_cart > a:first-child:after {
|
||||
content: "\f0d7";
|
||||
font-family: "FontAwesome";
|
||||
display: inline-block;
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
color: #FFFFFF;
|
||||
padding: 6px 0 0 0; }
|
||||
#header .shopping_cart > a:first-child:hover:after {
|
||||
content: "\f0d8";
|
||||
padding: 4px 0px 0px 0px; }
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
.shopping_cart {
|
||||
width: 34px; }
|
||||
@media (max-width: 480px) {
|
||||
/*.shopping_cart {
|
||||
padding-top: 20px; }*/ }
|
||||
@media (max-width: 1200px) {
|
||||
.shopping_cart {
|
||||
margin: 0 auto;
|
||||
float: none;} }
|
||||
#header .shopping_cart > a:first-child:after {
|
||||
content: "\f0d7";
|
||||
font-family: "FontAwesome";
|
||||
font-size: 12px;
|
||||
padding: 0 2px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
color: #fff; }
|
||||
#header .shopping_cart > a:first-child:hover::after {
|
||||
content: "\f0d8";
|
||||
top: -2px; }
|
||||
.shopping_cart > a:first-child {
|
||||
/*padding: 7px 10px;*/
|
||||
padding-top: 7px;
|
||||
/*background-color: #BF9958;*/
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
color: #777777;
|
||||
font-size: 20px;
|
||||
color: #777;
|
||||
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
|
||||
overflow: hidden; }
|
||||
@media (min-width: 768px) and (max-width: 991px) {
|
||||
@@ -49,15 +48,8 @@
|
||||
.shopping_cart > a:first-child:before {
|
||||
content: "\f07a";
|
||||
font-family: "FontAwesome";
|
||||
display: inline-block;
|
||||
font-size: 20px;
|
||||
line-height: 23px;
|
||||
color: #fff;
|
||||
top: 9px;
|
||||
left: 0px;
|
||||
z-index: 100;
|
||||
position: absolute;
|
||||
padding-right: 5px; }
|
||||
z-index: 100; }
|
||||
.shopping_cart .ajax_cart_total {
|
||||
display: none !important; }
|
||||
.shopping_cart .block_cart_expand:after, .shopping_cart .block_cart_collapse:after {
|
||||
@@ -234,7 +226,7 @@
|
||||
.cart_block .cart_block_tax_cost,
|
||||
.cart_block .cart_block_total,
|
||||
.cart_block .cart_block_wrapping_cost,
|
||||
.cart_block .cart_block_additional_facilities_cost {
|
||||
.cart_block .cart_block_convenience_fee {
|
||||
float: right; }
|
||||
|
||||
.cart_block table.vouchers {
|
||||
@@ -487,11 +479,10 @@
|
||||
.remove_rooms_from_cart_link:hover {
|
||||
color: #515151; }
|
||||
|
||||
.badge_style
|
||||
{
|
||||
.badge_style {
|
||||
left: 13px;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
top: -8px;
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
@@ -547,4 +538,4 @@
|
||||
{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,10 @@ class Blockcart extends Module
|
||||
unset($this->context->cookie->currentAddedProduct);
|
||||
}
|
||||
|
||||
$totalAdditionalServicesPrice = $this->context->cart->getOrderTotal(false, Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD);
|
||||
$totalAdditionalServicesWithoutAutoAddPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD);
|
||||
$totalAdditionalServicesWithAutoAddPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOM_SERVICES);
|
||||
$totalConvenienceFee = $params['cart']->getOrderTotal($useTax, Cart::ONLY_CONVENIENCE_FEE);
|
||||
$totalRoomsPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOMS);
|
||||
|
||||
$response = array(
|
||||
'products' => $products,
|
||||
@@ -285,11 +288,10 @@ class Blockcart extends Module
|
||||
'tax_cost' => $tax_cost,
|
||||
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
|
||||
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_PRODUCTS), $currency),
|
||||
'room_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOMS), $currency),
|
||||
// 'normal_products_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_NORMAL_PRODUCTS), $currency),
|
||||
'room_total' => Tools::displayPrice($totalRoomsPrice + $totalDemandsPrice + $totalAdditionalServicesWithAutoAddPrice - $totalConvenienceFee),
|
||||
'totalToPay' => $totalToPay,
|
||||
'total_extra_services' => $totalDemandsPrice + $totalAdditionalServicesPrice,
|
||||
'total_extra_services_format' => Tools::displayPrice(($totalDemandsPrice + $totalAdditionalServicesPrice), $currency),
|
||||
'total_convenience_fee' => $totalConvenienceFee,
|
||||
'total_convenience_fee_format' => Tools::displayPrice(($totalConvenienceFee), $currency),
|
||||
'total' => Tools::displayPrice($totalToPay, $currency),
|
||||
'order_process' => $orderProcess,
|
||||
'ajax_allowed' => (int) (Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false,
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
{$data_v['data_form']|date_format:"%d-%m-%Y"} - {$data_v['data_to']|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
|
||||
<td>{convertPrice price=$data_v['amount']}</td>
|
||||
<td>{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}</td>
|
||||
<td><a class="remove_rooms_from_cart_link" href="#" rm_price="{$data_v['amount']}" id_product="{$product.id_product|intval}" date_from="{$data_v['data_form']}" date_to="{$data_v['data_to']}" num_rooms="{$data_v['num_rm']}" title="{l s='remove this room from my cart' mod='blockcart'}"></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
@@ -222,10 +222,10 @@
|
||||
<span>{l s='Tax' mod='blockcart'}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($total_extra_services)}
|
||||
{if isset($total_convenience_fee)}
|
||||
<div class="cart-prices-line">
|
||||
<span class="price cart_block_additional_facilities_cost ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
|
||||
<span class="price">{l s='Extra Services Cost' mod='blockcart'}</strong>
|
||||
<span class="price cart_block_convenience_fee ajax_cart_convenience_fee">{convertPrice price=$total_convenience_fee}</span>
|
||||
<span class="price">{l s='Convenience Fees' mod='blockcart'}</strong>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="cart-prices-line last-line">
|
||||
@@ -314,7 +314,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
</strong>
|
||||
<span class="ajax_block_products_total">
|
||||
<span class="ajax_block_room_total pull-right">
|
||||
{if $cart_qties > 0}
|
||||
{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)}
|
||||
{/if}
|
||||
@@ -354,16 +354,16 @@
|
||||
{/if}
|
||||
</span>
|
||||
</div> -->
|
||||
{if isset($total_extra_services)}
|
||||
{if isset($total_convenience_fee)}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">{l s='Total Extra Services Cost' mod='blockcart'}</strong>
|
||||
<span class="price ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
|
||||
<strong class="dark">{l s='Convenience Fees' mod='blockcart'}</strong>
|
||||
<span class="price ajax_cart_convenience_fee pull-right">{convertPrice price=$total_convenience_fee}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{if $show_tax && $use_tax}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">{l s='Tax' mod='blockcart'}</strong>
|
||||
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
|
||||
<span class="price cart_block_tax_cost ajax_cart_tax_cost pull-right">{$tax_cost}</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="layer_cart_row">
|
||||
@@ -377,7 +377,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
</strong>
|
||||
<span class="ajax_block_cart_total">
|
||||
<span class="ajax_block_cart_total pull-right">
|
||||
{if $cart_qties > 0}
|
||||
{if $priceDisplay == 1}
|
||||
{convertPrice price=$cart->getOrderTotal(false)}
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
.cart_block .cart_block_tax_cost,
|
||||
.cart_block .cart_block_total,
|
||||
.cart_block .cart_block_wrapping_cost,
|
||||
.cart_block .cart_block_additional_facilities_cost {
|
||||
.cart_block .cart_block_convenience_fee {
|
||||
float: right; }
|
||||
|
||||
.cart_block table.vouchers {
|
||||
|
||||
@@ -912,7 +912,7 @@ var ajaxCart = {
|
||||
content += '<tr class="rooms_remove_container">';
|
||||
content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + '</td>';
|
||||
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td>';
|
||||
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
content += '</td>';
|
||||
@@ -949,7 +949,7 @@ var ajaxCart = {
|
||||
booking_dates_content += '<tr class="rooms_remove_container">';
|
||||
booking_dates_content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + '</td>';
|
||||
booking_dates_content += '<td class="num_rooms_in_date">' + date_diff_v1.num_rm + '</td>';
|
||||
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
booking_dates_content += '<td>';
|
||||
booking_dates_content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v1.amount + ' id_product=' + productId + ' date_from=' + date_diff_v1.data_form + ' date_to=' + date_diff_v1.data_to + ' num_rooms=' + date_diff_v1.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
booking_dates_content += '</td>';
|
||||
@@ -1154,16 +1154,20 @@ var ajaxCart = {
|
||||
if (hasDeliveryAddress)
|
||||
$('.ajax_cart_shipping_cost').parent().find('.unvisible').show();
|
||||
|
||||
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
|
||||
$('.ajax_cart_tax_cost').text(jsonData.tax_cost);
|
||||
$('.cart_block_wrapping_cost').text(jsonData.wrapping_cost);
|
||||
|
||||
$('.ajax_block_cart_total').text(jsonData.total);
|
||||
$('.ajax_block_cart_total').attr('total_cart_price', jsonData.totalToPay);
|
||||
|
||||
$('.ajax_block_products_total').text(jsonData.product_total);
|
||||
$('.ajax_block_room_total').text(jsonData.roomTotal);
|
||||
$('.ajax_block_room_total').text(jsonData.room_total);
|
||||
$('.ajax_block_nornal_products_total').text(jsonData.normalProductsTotal);
|
||||
$('.ajax_cart_extra_demands_cost').text(jsonData.total_extra_services_format);
|
||||
$('.ajax_cart_convenience_fee').text(jsonData.total_convenience_fee_format);
|
||||
if (jsonData.total_convenience_fee) {
|
||||
$('.ajax_cart_convenience_fee').parent().show();
|
||||
} else {
|
||||
$('.ajax_cart_convenience_fee').parent().hide();
|
||||
}
|
||||
$('.ajax_total_price_wt').text(jsonData.total_price_wt);
|
||||
|
||||
if (parseFloat(jsonData.free_shipping_float) > 0) {
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
{$data_v['data_form']|date_format:"%d-%m-%Y"} - {$data_v['data_to']|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
|
||||
<td>{convertPrice price=$data_v['amount']}</td>
|
||||
<td>{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}</td>
|
||||
<td><a class="remove_rooms_from_cart_link" href="#" rm_price="{$data_v['amount']}" id_product="{$product.id_product|intval}" date_from="{$data_v['data_form']}" date_to="{$data_v['data_to']}" num_rooms="{$data_v['num_rm']}" title="{l s='remove this room from my cart' mod='blockcart'}"></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
@@ -222,10 +222,10 @@
|
||||
<span>{l s='Tax' mod='blockcart'}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($total_extra_services)}
|
||||
{if isset($total_convenience_fee)}
|
||||
<div class="cart-prices-line">
|
||||
<span class="price cart_block_additional_facilities_cost ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
|
||||
<span class="price">{l s='Extra Services Cost' mod='blockcart'}</strong>
|
||||
<span class="price cart_block_convenience_fee ajax_cart_convenience_fee">{convertPrice price=$total_convenience_fee}</span>
|
||||
<span class="price">{l s='Convenience Fees' mod='blockcart'}</strong>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="cart-prices-line last-line">
|
||||
@@ -314,7 +314,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
</strong>
|
||||
<span class="ajax_block_products_total">
|
||||
<span class="ajax_block_room_total pull-right">
|
||||
{if $cart_qties > 0}
|
||||
{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)}
|
||||
{/if}
|
||||
@@ -354,16 +354,16 @@
|
||||
{/if}
|
||||
</span>
|
||||
</div> -->
|
||||
{if isset($total_extra_services)}
|
||||
{if isset($total_convenience_fee)}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">{l s='Total Extra Services Cost' mod='blockcart'}</strong>
|
||||
<span class="price ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
|
||||
<strong class="dark">{l s='Convenience Fees' mod='blockcart'}</strong>
|
||||
<span class="price ajax_cart_convenience_fee pull-right">{convertPrice price=$total_convenience_fee}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{if $show_tax && $use_tax}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">{l s='Tax' mod='blockcart'}</strong>
|
||||
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
|
||||
<span class="price cart_block_tax_cost ajax_cart_tax_cost pull-right">{$tax_cost}</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="layer_cart_row">
|
||||
@@ -377,7 +377,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
</strong>
|
||||
<span class="ajax_block_cart_total">
|
||||
<span class="ajax_block_cart_total pull-right">
|
||||
{if $cart_qties > 0}
|
||||
{if $priceDisplay == 1}
|
||||
{convertPrice price=$cart->getOrderTotal(false)}
|
||||
|
||||
Reference in New Issue
Block a user