Resolve merge conflicts
255
.gitignore
vendored
Normal file
@@ -0,0 +1,255 @@
|
||||
|
||||
# Editors, tools and OS's
|
||||
|
||||
.buildpath
|
||||
/.htaccess
|
||||
.project
|
||||
.settings
|
||||
.idea
|
||||
.svn
|
||||
.DS_Store
|
||||
.sass-cache
|
||||
config.codekit
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
nbproject
|
||||
bower_components
|
||||
composer.lock
|
||||
|
||||
# Cache, temp and personal files
|
||||
|
||||
/cache/**
|
||||
!/cache/cacert.pem
|
||||
!/cache/index.php
|
||||
|
||||
!/cache/cachefs/
|
||||
!/cache/cachefs/index.php
|
||||
|
||||
!/cache/purifier/
|
||||
!/cache/purifier/index.php
|
||||
|
||||
!/cache/push/
|
||||
!/cache/push/activity
|
||||
!/cache/push/index.php
|
||||
!/cache/push/trends
|
||||
|
||||
!/cache/sandbox/
|
||||
!/cache/sandbox/index.php
|
||||
!/cache/smarty/
|
||||
|
||||
!/cache/smarty/cache/
|
||||
!/cache/smarty/cache/index.php
|
||||
!/cache/smarty/compile/
|
||||
!/cache/smarty/compile/index.php
|
||||
!/cache/smarty/index.php
|
||||
|
||||
!/cache/tcpdf/
|
||||
!/cache/tcpdf/index.php
|
||||
|
||||
|
||||
/download/*
|
||||
!/download/.htaccess
|
||||
!/download/index.php
|
||||
|
||||
img/**
|
||||
!/img/404.gif
|
||||
!/img/admin/
|
||||
!/img/admin/*.gif
|
||||
!/img/admin/*.png
|
||||
!/img/admin/*.jpg
|
||||
!/img/admin/index.php
|
||||
!/img/bg_500.png
|
||||
!/img/bg_loader.png
|
||||
!/img/c/
|
||||
!/img/c/index.php
|
||||
!/img/cms/
|
||||
!/img/cms/.htaccess
|
||||
!/img/cms/cms-img.jpg
|
||||
!/img/cms/index.php
|
||||
!/img/co/
|
||||
!/img/co/index.php
|
||||
!/img/favicon.ico
|
||||
!/img/genders/
|
||||
!/img/genders/Unknown.jpg
|
||||
!/img/genders/index.php
|
||||
!/img/hotel_header_image.jpg
|
||||
!/img/index.php
|
||||
!/img/jquery-ui/
|
||||
!/img/jquery-ui/*.png
|
||||
!/img/jquery-ui/index.php
|
||||
!/img/l/
|
||||
!/img/l/index.php
|
||||
!/img/l/none.jpg
|
||||
!/img/loader.gif
|
||||
!/img/loadingAnimation.gif
|
||||
!/img/logo.jpg
|
||||
!/img/logo_invoice.jpg
|
||||
!/img/logo_mail.jpg
|
||||
!/img/logo_stores.gif
|
||||
!/img/logo_stores.png
|
||||
!/img/m/
|
||||
!/img/m/index.php
|
||||
!/img/macFFBgHack.png
|
||||
!/img/os/
|
||||
!/img/os/index.php
|
||||
!/img/p/
|
||||
!/img/p/index.php
|
||||
!/img/prestashop-avatar.png
|
||||
!/img/qloapps@2x.png
|
||||
!/img/qloapps-login@2x.png
|
||||
!/img/qloapps-login-wink@2x.png
|
||||
!/img/questionmark.png
|
||||
!/img/rf/
|
||||
!/img/rf/index.php
|
||||
!/img/s/
|
||||
!/img/s/index.php
|
||||
!/img/scenes/
|
||||
!/img/scenes/index.php
|
||||
!/img/scenes/thumbs/
|
||||
!/img/scenes/thumbs/index.php
|
||||
!/img/st/
|
||||
!/img/st/index.php
|
||||
!/img/su/
|
||||
!/img/su/index.php
|
||||
!/img/t/
|
||||
!/img/t/*.gif
|
||||
!/img/t/index.php
|
||||
!/img/tmp/
|
||||
!/img/tmp/index.php
|
||||
|
||||
/log/*
|
||||
!/log/.htaccess
|
||||
!/log/index.php
|
||||
|
||||
/upload/*
|
||||
!/upload/.htaccess
|
||||
!/upload/index.php
|
||||
|
||||
/admin/backups/*
|
||||
!/admin/backups/.htaccess
|
||||
!/admin/backups/index.php
|
||||
|
||||
/admin/import/*
|
||||
!/admin/import/.htaccess
|
||||
!/admin/import/index.php
|
||||
|
||||
/themes/*/cache/*
|
||||
!/themes/*/cache/index.php
|
||||
|
||||
/admin/themes/*/cache/*
|
||||
!/admin/themes/*/cache/index.php
|
||||
|
||||
# Config
|
||||
|
||||
/config/settings.inc.php
|
||||
/config/settings.old.php
|
||||
|
||||
/config/xml/**
|
||||
!/config/xml/.htaccess
|
||||
!/config/xml/index.php
|
||||
!/config/xml/qlo_mod_list.xml
|
||||
!config/xml/themes/
|
||||
!config/xml/themes/default.xml
|
||||
!config/xml/themes/index.php
|
||||
|
||||
# Themes, modules and overrides
|
||||
|
||||
# modules/*
|
||||
/modules/*/config.xml
|
||||
/modules/*/translations/*
|
||||
|
||||
/override/*
|
||||
!/override/.htaccess
|
||||
!/override/index.php
|
||||
!/override/readme_override.txt
|
||||
|
||||
!/override/classes/
|
||||
!/override/classes/index.php
|
||||
!/override/classes/cache/
|
||||
!/override/classes/cache/index.php
|
||||
!/override/classes/controller/
|
||||
!/override/classes/controller/index.php
|
||||
!/override/classes/db/
|
||||
!/override/classes/db/index.php
|
||||
!/override/classes/exception/
|
||||
!/override/classes/exception/index.php
|
||||
!/override/classes/helper/
|
||||
!/override/classes/helper/index.php
|
||||
!/override/classes/log/
|
||||
!/override/classes/log/index.php
|
||||
!/override/classes/module/
|
||||
!/override/classes/module/index.php
|
||||
!/override/classes/order/
|
||||
!/override/classes/order/index.php
|
||||
!/override/classes/pdf/
|
||||
!/override/classes/pdf/index.php
|
||||
!/override/classes/range/
|
||||
!/override/classes/range/index.php
|
||||
!/override/classes/shop/
|
||||
!/override/classes/shop/index.php
|
||||
!/override/classes/stock/
|
||||
!/override/classes/stock/index.php
|
||||
!/override/classes/tax/
|
||||
!/override/classes/tax/index.php
|
||||
!/override/classes/tree/
|
||||
!/override/classes/tree/index.php
|
||||
!/override/classes/webservice/
|
||||
!/override/classes/webservice/index.php
|
||||
|
||||
!/override/controllers/
|
||||
!/override/controllers/index.php
|
||||
!/override/controllers/admin/
|
||||
!/override/controllers/admin/index.php
|
||||
!/override/controllers/admin/templates/
|
||||
!/override/controllers/admin/templates/index.php
|
||||
!/override/controllers/front
|
||||
|
||||
!/override/modules/
|
||||
!/override/modules/index.php
|
||||
|
||||
|
||||
admin/themes/default/sass/ie.sass
|
||||
admin/themes/default/sass/print.sass
|
||||
admin/themes/default/sass/screen.sass
|
||||
|
||||
admin/themes/default/css/ie.css
|
||||
admin/themes/default/css/print.css
|
||||
admin/themes/default/css/screen.css
|
||||
|
||||
# Translations and emails templates
|
||||
|
||||
/translations/**
|
||||
!/translations/index.php
|
||||
!/translations/en.gzip
|
||||
|
||||
!/translations/export/
|
||||
!/translations/export/index.php
|
||||
|
||||
/mails/*
|
||||
!/mails/.htaccess
|
||||
!/mails/index.php
|
||||
!/mails/en/
|
||||
|
||||
/themes/hotel-reservation-theme/cache/*
|
||||
!/themes/hotel-reservation-theme/cache/
|
||||
!/themes/hotel-reservation-theme/cache/index.php
|
||||
|
||||
/themes/hotel-reservation-theme/lang/*
|
||||
!/themes/hotel-reservation-theme/lang/index.php
|
||||
!/themes/hotel-reservation-theme/lang/en.php
|
||||
|
||||
/themes/hotel-reservation-theme/modules/*/translations/*.php
|
||||
!/themes/hotel-reservation-theme/modules/*/translations/index.php
|
||||
|
||||
/themes/hotel-reservation-theme/mails/*
|
||||
!/themes/hotel-reservation-theme/mails/index.php
|
||||
!/themes/hotel-reservation-theme/mails/en/
|
||||
|
||||
/themes/hotel-reservation-theme/modules/*/mails/*
|
||||
!/themes/hotel-reservation-theme/modules/*/mails/index.php
|
||||
!/themes/hotel-reservation-theme/modules/*/mails/en
|
||||
|
||||
# MISC
|
||||
|
||||
**sitemap.xml
|
||||
robots.txt
|
||||
@@ -86,9 +86,8 @@ function error_modal(heading, msg) {
|
||||
}
|
||||
|
||||
//move to hash after clicking on anchored links
|
||||
function scroll_if_anchor(href) {
|
||||
function scroll_if_anchor(href, fromTop = 120) {
|
||||
href = typeof(href) === "string" ? href : $(this).attr("href");
|
||||
var fromTop = 120;
|
||||
if(href.indexOf("#") === 0) {
|
||||
var $target = $(href);
|
||||
if($target.length) {
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
@import "partials/date-range-picker"
|
||||
@import "partials/multistore"
|
||||
@import "partials/product"
|
||||
@import "partials/skeleton-loading"
|
||||
|
||||
//Controllers
|
||||
@import "controllers/carrier-wizard"
|
||||
@@ -110,6 +111,3 @@
|
||||
|
||||
//Print support
|
||||
@import "partials/print"
|
||||
|
||||
//Add css
|
||||
@import "partials/css"
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
//Avatar
|
||||
|
||||
.employee_avatar_small
|
||||
@extend .avatar-sm
|
||||
vertical-align: middle
|
||||
img
|
||||
padding: 0
|
||||
border: none
|
||||
|
||||
.employee_avatar
|
||||
@extend .avatar-lg
|
||||
display: block!important
|
||||
margin: 10px auto!important
|
||||
text-align: center
|
||||
|
||||
.avatar-xs
|
||||
@include avatar(16px, 16px)
|
||||
.avatar-sm
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
z-index: 1
|
||||
position: absolute
|
||||
margin: 0 auto
|
||||
width: 69.5px
|
||||
text-align: center
|
||||
left: 0
|
||||
right: 0
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
display: none
|
||||
z-index: 1
|
||||
@include rotateY(180deg)
|
||||
.login-actions
|
||||
position: relative
|
||||
|
||||
#shop_name
|
||||
text-align: center
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
.datepicker2
|
||||
background: #fff
|
||||
position: absolute
|
||||
z-index: 599
|
||||
right: -10rem
|
||||
.daterangepicker
|
||||
border-radius: 5px 5px 0 0 !important
|
||||
.bootstrap
|
||||
#datepicker
|
||||
.daterangepicker
|
||||
thead
|
||||
tr
|
||||
th
|
||||
padding: 0.7em 0.3em
|
||||
text-align: center
|
||||
font-weight: bold
|
||||
border: 0
|
||||
background-color: #fff !important
|
||||
color: #555555 !important
|
||||
font-size: 14px
|
||||
text-transform: capitalize
|
||||
&:first-child
|
||||
th
|
||||
font-size: unset
|
||||
font-weight: bold
|
||||
background-color: #00AFF0 !important
|
||||
border: unset !important
|
||||
color: #fff !important
|
||||
padding: unset !important
|
||||
text-transform: capitalize
|
||||
.icon-angle-left
|
||||
font-weight: bold
|
||||
padding: 10px
|
||||
.icon-angle-right
|
||||
font-weight: bold
|
||||
padding: 10px
|
||||
th
|
||||
&.prev
|
||||
border-top-left-radius: 8px !important
|
||||
border-bottom-left-radius: 8px !important
|
||||
left: 2px
|
||||
top: 3px
|
||||
&.next
|
||||
border-top-right-radius: 8px !important
|
||||
border-bottom-right-radius: 8px !important
|
||||
right: 2px
|
||||
top: 3px
|
||||
&.month-switch
|
||||
top: 3px
|
||||
td
|
||||
padding: 5px 10px
|
||||
color: #555
|
||||
.ui-datepicker
|
||||
width: auto !important
|
||||
margin: 5px auto 0
|
||||
width: auto !important
|
||||
z-index: 1032 !important
|
||||
.ui-datepicker-header
|
||||
background-color: #00AFF0 !important
|
||||
.ui-datepicker-title
|
||||
color: #fff
|
||||
font-style: normal
|
||||
font-weight: bold
|
||||
font-size: unset
|
||||
thead
|
||||
background-color: #f7f7f7
|
||||
th
|
||||
font-style: normal
|
||||
font-size: 15px
|
||||
line-height: 23px
|
||||
color: #555555
|
||||
tbody
|
||||
td
|
||||
&:last-child
|
||||
border-right: 0px
|
||||
tr
|
||||
border-bottom: 1px solid #bbb
|
||||
border: none
|
||||
&:last-child
|
||||
border-bottom: 0px
|
||||
a
|
||||
text-decoration: none
|
||||
.form-date-actions .btn:hover, .form-date-actions .btn:focus, .form-date-actions .btn:active
|
||||
outline: unset !important
|
||||
text-decoration: none
|
||||
.form-date-actions
|
||||
bottom: -24px
|
||||
position: absolute
|
||||
width: 100%
|
||||
z-index: 599
|
||||
background-color: #fff
|
||||
border: solid 1px #ccc
|
||||
border-radius: 0 0 5px 5px
|
||||
.ui-datepicker-prev
|
||||
float: left
|
||||
cursor: pointer
|
||||
left: 15px !important
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #fff
|
||||
content: "\f104"
|
||||
font-family: FontAwesome
|
||||
.ui-datepicker-next
|
||||
float: right
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #fff
|
||||
content: "\f105"
|
||||
font-family: FontAwesome
|
||||
&:hover
|
||||
top: 5px !important
|
||||
right: 2px !important
|
||||
.ui-state-hover,
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
.ui-widget-content .ui-state-focus,
|
||||
.ui-widget-header .ui-state-focus
|
||||
border: unset
|
||||
background: none
|
||||
font-weight: none
|
||||
color: none
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a
|
||||
display: inline-block
|
||||
text-align: center
|
||||
line-height: 25px
|
||||
color: #ffffff
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next
|
||||
top: 5px !important
|
||||
.ui-state-default,
|
||||
.ui-widget-content .ui-state-default,
|
||||
.ui-widget-header .ui-state-default
|
||||
border: none !important
|
||||
.ui-widget-content
|
||||
.ui-icon
|
||||
background-image: none !important
|
||||
.ui-datepicker td span, .ui-datepicker td a
|
||||
text-align: center !important
|
||||
padding: 4px 9px !important
|
||||
.ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus
|
||||
background: unset !important
|
||||
border: unset !important
|
||||
.ui-widget-content .ui-slider-handle, .ui-datepicker-current .ui-slider-handle
|
||||
border: 1px solid #d3d3d3 !important
|
||||
color: #555555 !important
|
||||
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) !important
|
||||
.ui-datepicker-prev-hover
|
||||
top: unset !important
|
||||
@@ -14,42 +14,340 @@
|
||||
// ui-datepicker-buttonpane: The buttonpane that is used when the showButtonPanel option is set.
|
||||
// ui-datepicker-current: The button used to select today's date.
|
||||
|
||||
$color-bright: white
|
||||
|
||||
$color-calendar: #00A4E7
|
||||
$color-calendar-compare: #FF8000
|
||||
|
||||
$color-calendar-day: $color-bright
|
||||
|
||||
$color-calendar-outrange: #ccc
|
||||
|
||||
$color-calendar-day-selected: $color-calendar
|
||||
$color-calendar-day-selected-compare: $color-calendar-compare
|
||||
|
||||
$color-calendar-range: lighten($color-calendar,10%)
|
||||
$color-calendar-range-compare: lighten($color-calendar-compare,10%)
|
||||
|
||||
.datepicker2
|
||||
background: #fff
|
||||
position: absolute
|
||||
z-index: 599
|
||||
right: -10rem
|
||||
.daterangepicker
|
||||
border-radius: 5px 5px 0 0 !important
|
||||
.bootstrap
|
||||
#datepicker
|
||||
.daterangepicker
|
||||
position: relative
|
||||
width: 100%
|
||||
font-family: Verdana, Arial, sans-serif
|
||||
font-size: 13px
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.26)
|
||||
margin-bottom: 8px
|
||||
padding: 12px
|
||||
border-bottom-left-radius: 0
|
||||
border-bottom-right-radius: 0
|
||||
table
|
||||
width: 100%
|
||||
margin: 0
|
||||
border-spacing: 1px
|
||||
thead
|
||||
tr th
|
||||
text-transform: uppercase
|
||||
text-align: center
|
||||
font-weight: bold
|
||||
border: 0
|
||||
background-color: #fff !important
|
||||
color: #777 !important
|
||||
font-size: 14px
|
||||
tr:first-child th
|
||||
padding-bottom: 10px
|
||||
text-transform: capitalize
|
||||
.icon-angle-left
|
||||
font-weight: bold
|
||||
padding-left: 6px
|
||||
&:after
|
||||
content: ''
|
||||
position: absolute
|
||||
top: -5px
|
||||
left: -2px
|
||||
width: 24px
|
||||
height: 24px
|
||||
background-color: #f0f0f0
|
||||
z-index: -1
|
||||
border-radius: 50%
|
||||
.icon-angle-right
|
||||
font-weight: bold
|
||||
padding-right: 6px
|
||||
&:after
|
||||
content: ''
|
||||
position: absolute
|
||||
top: -5px
|
||||
right: -2px
|
||||
width: 24px
|
||||
height: 24px
|
||||
background-color: #f0f0f0
|
||||
z-index: -1
|
||||
border-radius: 50%
|
||||
td, th
|
||||
text-align: center
|
||||
padding: 0
|
||||
position: relative
|
||||
tr
|
||||
border-bottom: solid 1px white
|
||||
td
|
||||
color: #555
|
||||
font-size: 14px
|
||||
line-height: 25px
|
||||
padding: 5px 10px
|
||||
&.day:after
|
||||
content: ""
|
||||
position: absolute
|
||||
display: block
|
||||
top: 0
|
||||
width: 100%
|
||||
z-index: 0
|
||||
background-color: transparent
|
||||
@include left(0)
|
||||
&.day:hover
|
||||
cursor: pointer
|
||||
color: #212121
|
||||
&.day.disabled
|
||||
color: $color-calendar-outrange
|
||||
&.old, &.new
|
||||
color: $color-calendar-outrange
|
||||
&.start-selected:not(.old):not(.new):not(.end-selected)
|
||||
color: $color-bright
|
||||
background-color: #1292ff
|
||||
//@extend .chevron-left
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.end-selected-compare
|
||||
@include border-radius(0)
|
||||
&.end-selected:not(.old):not(.new):not(.start-selected)
|
||||
color: $color-bright
|
||||
background-color: #1292ff
|
||||
//@extend .chevron-right
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-right-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.start-selected-compare
|
||||
@include border-radius(0)
|
||||
&.start-selected-compare:not(.old):not(.new):not(.end-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-left-radius(15px)
|
||||
&.range
|
||||
background-color: #f2f2f2
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare:not(.old):not(.new):not(.start-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-right-radius(15px)
|
||||
&.range
|
||||
background-color: #f2f2f2
|
||||
@include border-right-radius(0)
|
||||
&.end-selected.start-selected
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-radius(0)
|
||||
&.end-selected-compare.start-selected-compare
|
||||
color: $color-bright
|
||||
@include border-radius(15px)
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-day-selected-compare,$color-calendar-range,70%)
|
||||
@include border-radius(0)
|
||||
&.range
|
||||
color: #333
|
||||
background-color: #f2f2f2
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.range-compare
|
||||
color: lighten($color-calendar-range-compare,35%)
|
||||
background-color: $color-calendar-range-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.today
|
||||
background-color: $color-bright
|
||||
span
|
||||
padding: 0
|
||||
display: block
|
||||
width: 33.333%
|
||||
height: 3em
|
||||
line-height: 3em
|
||||
font-weight: 400
|
||||
float: left
|
||||
text-transform: uppercase
|
||||
cursor: pointer
|
||||
&:hover
|
||||
color: white
|
||||
background-color: $color-calendar-day-selected
|
||||
&.active
|
||||
background-color: $color-calendar-day-selected
|
||||
color: #fff
|
||||
&.old
|
||||
color: $color-calendar-outrange
|
||||
th
|
||||
&.next
|
||||
@include text-align(right)
|
||||
&.prev
|
||||
@include text-align(left)
|
||||
&.next, &.prev, &.month-switch
|
||||
font-size: 16px !important
|
||||
font-weight: normal
|
||||
color: #333 !important
|
||||
&:hover
|
||||
opacity: 0.8
|
||||
thead tr:first-child th
|
||||
cursor: pointer
|
||||
.ui-datepicker
|
||||
margin: 5px auto 0
|
||||
width: auto !important
|
||||
z-index: 111111 !important
|
||||
top: 0
|
||||
left: 0
|
||||
padding: 4px
|
||||
padding: 12px !important
|
||||
margin-top: 1px
|
||||
@include border-radius(4px)
|
||||
&:before
|
||||
content: ''
|
||||
display: inline-block!important
|
||||
border-left: 7px solid transparent
|
||||
border-right: 7px solid transparent
|
||||
border-bottom: 7px solid #ccc
|
||||
border-bottom-color: rgba(black,.2)
|
||||
position: absolute
|
||||
top: -7px
|
||||
left: 6px
|
||||
&:after
|
||||
content: ''
|
||||
display: inline-block!important
|
||||
border-left: 6px solid transparent
|
||||
border-right: 6px solid transparent
|
||||
border-bottom: 6px solid white
|
||||
position: absolute
|
||||
top: -6px
|
||||
left: 7px
|
||||
.ui-datepicker-header
|
||||
background: transparent !important
|
||||
background: none
|
||||
border: none
|
||||
color: gray
|
||||
font-weight: normal
|
||||
.ui-state-default
|
||||
background: transparent !important
|
||||
.ui-datepicker-title
|
||||
color: #333
|
||||
font-size: 16px
|
||||
font-style: normal
|
||||
th
|
||||
font-size: 12px
|
||||
font-weight: 600
|
||||
color: #777
|
||||
text-transform: uppercase
|
||||
tbody
|
||||
td
|
||||
&:last-child
|
||||
border-right: 0px
|
||||
tr
|
||||
border-bottom: 1px solid #bbb
|
||||
border: none
|
||||
&:last-child
|
||||
border-bottom: 0px
|
||||
a
|
||||
text-decoration: none
|
||||
.ui-state-highlight
|
||||
border: solid 1px darken(#FEFBE2 ,50%) !important
|
||||
background: #FEFBE2 !important
|
||||
.ui-datepicker-today
|
||||
background: #e7f4ff !important
|
||||
.ui-state-highlight
|
||||
color: #1292ff !important
|
||||
.ui-datepicker-current-day, .ui-datepicker-today.ui-datepicker-current-day
|
||||
background-color: #1292ff !important
|
||||
.ui-datepicker-current-day, .ui-datepicker-today.ui-datepicker-current-day .ui-state-highlight
|
||||
color: #fff !important
|
||||
.ui-state-active
|
||||
color: white !important
|
||||
background: $primary-color !important
|
||||
border: solid 1px darken($primary-color,10%) !important
|
||||
|
||||
.ui-datepicker-prev-hover
|
||||
left: 2px !important
|
||||
.form-date-actions .btn:hover, .form-date-actions .btn:focus, .form-date-actions .btn:active
|
||||
outline: unset !important
|
||||
text-decoration: none
|
||||
.form-date-actions
|
||||
bottom: -27px
|
||||
position: absolute
|
||||
width: 100%
|
||||
z-index: 599
|
||||
background-color: #fff
|
||||
box-shadow: 0 7px 10px 0 rgba(0,0,0,0.26)
|
||||
padding: 2px
|
||||
border-bottom-left-radius: 4px
|
||||
border-bottom-right-radius: 4px
|
||||
.ui-datepicker-prev
|
||||
float: left
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #333
|
||||
content: "\f104"
|
||||
font-family: FontAwesome
|
||||
position: absolute
|
||||
left: 8px
|
||||
.ui-datepicker-next
|
||||
float: right
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #333
|
||||
content: "\f105"
|
||||
font-family: FontAwesome
|
||||
position: absolute
|
||||
right: 8px
|
||||
&:hover
|
||||
top: 5px !important
|
||||
right: 2px !important
|
||||
.ui-state-hover,
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
.ui-widget-content .ui-state-focus,
|
||||
.ui-widget-header .ui-state-focus
|
||||
border: unset
|
||||
background: none
|
||||
font-weight: none
|
||||
color: none
|
||||
.ui-widget-content.ui-datepicker
|
||||
border: none
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.26)
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a
|
||||
display: inline-block
|
||||
text-align: center
|
||||
line-height: 25px
|
||||
color: #ffffff
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next
|
||||
top: 5px !important
|
||||
background-color: #f0f0f0
|
||||
border: none
|
||||
border-radius: 50%
|
||||
.ui-state-default,
|
||||
.ui-widget-content .ui-state-default,
|
||||
.ui-widget-header .ui-state-default
|
||||
border: none !important
|
||||
background: transparent !important
|
||||
font-size: 14px
|
||||
color: #333
|
||||
.ui-widget-content
|
||||
.ui-icon
|
||||
background-image: none !important
|
||||
.ui-datepicker td span, .ui-datepicker td a
|
||||
text-align: center !important
|
||||
padding: 4px 9px !important
|
||||
.ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus
|
||||
background: unset !important
|
||||
border: unset !important
|
||||
.ui-widget-content .ui-slider-handle, .ui-datepicker-current .ui-slider-handle
|
||||
border: 1px solid #d3d3d3 !important
|
||||
color: #555555 !important
|
||||
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) !important
|
||||
.ui-datepicker-prev-hover
|
||||
top: unset !important
|
||||
@@ -68,162 +68,19 @@ $color-calendar-range-compare: lighten($color-calendar-compare,10%)
|
||||
width: 35%
|
||||
button
|
||||
@include margin(5px, 0, 0, 0)
|
||||
|
||||
.daterangepicker
|
||||
position: relative
|
||||
width: 100%
|
||||
font-size: 13px
|
||||
border: solid 1px #ccc
|
||||
@include margin(0, 0, 8px, 0)
|
||||
table
|
||||
width: 100%
|
||||
margin: 0
|
||||
border-spacing: 1px
|
||||
thead
|
||||
tr th
|
||||
background-color: darken($color-calendar,5%)
|
||||
color: white
|
||||
font-size: 0.7em
|
||||
height: 1.5em
|
||||
text-transform: uppercase
|
||||
tr:first-child th
|
||||
background-color: $color-bright
|
||||
border-bottom: 1px solid darken($color-calendar,5%)
|
||||
font-weight: 200
|
||||
font-size: 1.4em
|
||||
color: $color-calendar-day-selected
|
||||
td, th
|
||||
text-align: center
|
||||
padding: 0
|
||||
position: relative
|
||||
tr
|
||||
border-bottom: solid 1px white
|
||||
td
|
||||
color: $color-calendar-day-selected
|
||||
height: 2.4em
|
||||
padding: 0 8px
|
||||
@include transition-property(all)
|
||||
@include transition-duration(0.2s)
|
||||
@include transition-timing-function(ease-out)
|
||||
&.day:after
|
||||
content: ""
|
||||
position: absolute
|
||||
display: block
|
||||
top: 0
|
||||
width: 100%
|
||||
z-index: 0
|
||||
background-color: transparent
|
||||
@include left(0)
|
||||
&.day:hover
|
||||
cursor: pointer
|
||||
&.day.disabled
|
||||
color: $color-calendar-outrange
|
||||
&.old, &.new
|
||||
color: $color-calendar-outrange
|
||||
&.start-selected:not(.old):not(.new):not(.end-selected)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected
|
||||
@include border-left-radius(15px)
|
||||
//@extend .chevron-left
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.end-selected-compare
|
||||
@include border-radius(0)
|
||||
&.end-selected:not(.old):not(.new):not(.start-selected)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected
|
||||
//@extend .chevron-right
|
||||
@include border-right-radius(15px)
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-right-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.start-selected-compare
|
||||
@include border-radius(0)
|
||||
&.start-selected-compare:not(.old):not(.new):not(.end-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-left-radius(15px)
|
||||
&.range
|
||||
background-color: mix($color-calendar-day-selected-compare,$color-calendar-range,70%)
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare:not(.old):not(.new):not(.start-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-right-radius(15px)
|
||||
&.range
|
||||
background-color: mix($color-calendar-day-selected-compare,$color-calendar-range,70%)
|
||||
@include border-right-radius(0)
|
||||
&.end-selected.start-selected
|
||||
color: $color-bright
|
||||
@include border-radius(15px)
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-radius(0)
|
||||
&.end-selected-compare.start-selected-compare
|
||||
color: $color-bright
|
||||
@include border-radius(15px)
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-day-selected-compare,$color-calendar-range,70%)
|
||||
@include border-radius(0)
|
||||
&.range
|
||||
color: lighten($color-calendar-range,35%)
|
||||
background-color: $color-calendar-range
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.range-compare
|
||||
color: lighten($color-calendar-range-compare,35%)
|
||||
background-color: $color-calendar-range-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.today
|
||||
background-color: $color-bright
|
||||
span
|
||||
padding: 0
|
||||
display: block
|
||||
width: 33.333%
|
||||
height: 3em
|
||||
line-height: 3em
|
||||
font-weight: 400
|
||||
float: left
|
||||
text-transform: uppercase
|
||||
cursor: pointer
|
||||
&:hover
|
||||
color: white
|
||||
background-color: $color-calendar-day-selected
|
||||
&.active
|
||||
background-color: $color-calendar-day-selected
|
||||
color: #fff
|
||||
&.old
|
||||
color: $color-calendar-outrange
|
||||
th
|
||||
&.next
|
||||
@include text-align(right)
|
||||
@include padding(0, 10px, 0, 0)
|
||||
&.prev
|
||||
@include text-align(left)
|
||||
@include padding(0, 0, 0, 10px)
|
||||
&.next, &.prev, &.month-switch
|
||||
font-size: 1.3em
|
||||
line-height: 2em
|
||||
height: 2em
|
||||
&:hover
|
||||
background-color: darken($color-calendar,5%)
|
||||
color: white
|
||||
thead tr:first-child th
|
||||
cursor: pointer
|
||||
.form-date-actions .btn:hover, .form-date-actions .btn:focus, .form-date-actions .btn:active
|
||||
outline: unset !important
|
||||
text-decoration: none
|
||||
.form-date-actions
|
||||
bottom: -27px
|
||||
position: absolute
|
||||
width: 100%
|
||||
z-index: 599
|
||||
background-color: #fff
|
||||
box-shadow: 0 7px 10px 0 rgba(0,0,0,0.26)
|
||||
padding: 2px
|
||||
border-bottom-left-radius: 4px
|
||||
border-bottom-right-radius: 4px
|
||||
|
||||
//chevrons are disabled time to figure out the firefox incompatibility..
|
||||
.chevron-left, .chevron-right
|
||||
@@ -253,7 +110,7 @@ $color-calendar-range-compare: lighten($color-calendar-compare,10%)
|
||||
-ms-animation: one 0.2s ease-in-out
|
||||
-o-animation: one 0.2s ease-in-out
|
||||
animation: one 0.2s ease-in-out
|
||||
|
||||
|
||||
@-webkit-keyframes one
|
||||
0%
|
||||
background-color: $color-calendar
|
||||
|
||||
@@ -117,19 +117,6 @@
|
||||
padding: 9px 0
|
||||
color: $brand-warning
|
||||
#employee_infos
|
||||
.employee_name
|
||||
position: relative
|
||||
@include ltr
|
||||
padding-right: 40px !important
|
||||
@include rtl
|
||||
padding-left: 40px !important
|
||||
.employee_avatar_small
|
||||
.img-thumbnail
|
||||
@include border-radius(0)
|
||||
@include avatar(36px, 0px)
|
||||
position: absolute
|
||||
top: 0px
|
||||
@include right(0)
|
||||
img
|
||||
border: none
|
||||
padding: 0
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
white-space: nowrap
|
||||
text-overflow: ellipsis
|
||||
overflow: hidden
|
||||
&.loading
|
||||
height: 1.2em
|
||||
width: 200px
|
||||
&:hover
|
||||
text-decoration: none
|
||||
.color1
|
||||
|
||||
80
admin/themes/default/sass/partials/_skeleton-loading.sass
Normal file
@@ -0,0 +1,80 @@
|
||||
@-webkit-keyframes wave
|
||||
0%
|
||||
background-position: -786px 0
|
||||
100%
|
||||
background-position: 786px 0
|
||||
@keyframes wave
|
||||
0%
|
||||
background-position: -786px 0
|
||||
100%
|
||||
background-position: 786px 0
|
||||
|
||||
@-webkit-keyframes pulse
|
||||
0%
|
||||
background-color: #dddddd
|
||||
25%
|
||||
background-color: #f5f5f5
|
||||
50%
|
||||
background-color: #e5e5e5
|
||||
75%
|
||||
background-color: #f5f5f5
|
||||
100%
|
||||
background-color: #dddddd
|
||||
@keyframes pulse
|
||||
0%
|
||||
background-color: #dddddd
|
||||
25%
|
||||
background-color: #f5f5f5
|
||||
50%
|
||||
background-color: #e5e5e5
|
||||
75%
|
||||
background-color: #f5f5f5
|
||||
100%
|
||||
background-color: #dddddd
|
||||
|
||||
.skeleton-loading-wave
|
||||
animation-duration: 1.3s
|
||||
animation-fill-mode: forwards
|
||||
animation-iteration-count: infinite
|
||||
animation-name: wave
|
||||
animation-timing-function: linear
|
||||
-webkit-animation-duration: 1.3s
|
||||
-webkit-animation-fill-mode: forwards
|
||||
-webkit-animation-iteration-count: infinite
|
||||
-webkit-animation-name: wave
|
||||
-webkit-animation-timing-function: linear
|
||||
-moz-animation-duration: 1.3s
|
||||
-moz-animation-fill-mode: forwards
|
||||
-moz-animation-iteration-count: infinite
|
||||
-moz-animation-name: wave
|
||||
-moz-animation-timing-function: linear
|
||||
background: #dddddd
|
||||
background-image: -webkit-gradient(linear, left center, right center, from(#dddddd), color-stop(.2, #f5f5f5), color-stop(.4, #e5e5e5), to(#dddddd))
|
||||
background-image: -webkit-linear-gradient(left, #dddddd 0%, #f5f5f5 20%, #e5e5e5 40%, #dddddd 100%)
|
||||
background-image: -moz-gradient(linear, left center, right center, from(#dddddd), color-stop(.2, #f5f5f5), color-stop(.4, #e5e5e5), to(#dddddd))
|
||||
background-image: -moz-linear-gradient(left, #dddddd 0%, #f5f5f5 20%, #e5e5e5 40%, #dddddd 100%)
|
||||
background-repeat: no-repeat
|
||||
background-size: 800px 104px
|
||||
height: 104px
|
||||
position: relative
|
||||
|
||||
.skeleton-loading-pulse
|
||||
background: #dddddd
|
||||
background-color: #dddddd
|
||||
animation-name: pulse
|
||||
animation-duration: 3s
|
||||
animation-iteration-count: infinite
|
||||
-webkit-animation-name: pulse
|
||||
-webkit-animation-duration: 3s
|
||||
-webkit-animation-iteration-count: infinite
|
||||
-moz-animation-name: pulse
|
||||
-moz-animation-duration: 3s
|
||||
-moz-animation-iteration-count: infinite
|
||||
|
||||
.loading-container-box
|
||||
width: 100%
|
||||
height: 40px
|
||||
|
||||
.loading-container-bar
|
||||
width: 100%
|
||||
height: 10px
|
||||
@@ -26,10 +26,6 @@
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="label"}
|
||||
{if $input.name == 'vat_number'}
|
||||
<div id="vat_area" style="display: visible">
|
||||
{/if}
|
||||
|
||||
{if $input.type == 'text_customer' && !isset($customer)}
|
||||
<label class="control-label col-lg-3 required" for="email">{l s='Customer email'}</label>
|
||||
{else}
|
||||
@@ -92,7 +88,4 @@
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{if $input.name == 'vat_number'}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div id="contact-link" {if isset($is_logged) && $is_logged} class="is_logged"{/if}>
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html':'UTF-8'}" title="{l s='Contact us' mod='blockcontact'}">{l s='Contact us' mod='blockcontact'}</a>
|
||||
</div>
|
||||
{if $telnumber}
|
||||
<span class="shop-phone{if isset($is_logged) && $is_logged} is_logged{/if}">
|
||||
<i class="icon-phone"></i>{l s='Call us now:' mod='blockcontact'} <strong>{$telnumber}</strong>
|
||||
</span>
|
||||
|
||||
{if $type == 'orders' && isset($ids_order)}
|
||||
{foreach from=$ids_order item=id_order name=orders}
|
||||
<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$id_order}" style="margin: 1px 0;" target="_blank">#{$id_order}</a>{if !$smarty.foreach.orders.last},{/if}
|
||||
{/foreach}
|
||||
{elseif $type == 'abandoned'}
|
||||
<span class="badge badge-danger">{l s='Abandoned cart'}</span>
|
||||
{elseif $type == 'non_orderd'}
|
||||
<span class="badge badge-danger">{l s='Non-orderd cart'}</span>
|
||||
{/if}
|
||||
@@ -59,16 +59,18 @@
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<h2>{l s='Guest not registered'}</h2>
|
||||
<h2>{l s='Guest not registered.'}</h2>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="panel">
|
||||
<h3><i class="icon-shopping-cart"></i> {l s='Order information'}</h3>
|
||||
{if $order->id}
|
||||
<h2><a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&id_order={$order->id|intval}&vieworder"> {l s='Order #%d' sprintf=$order->id|string_format:"%06d"}</a></h2>
|
||||
{l s='Made on:'} {dateFormat date=$order->date_add}
|
||||
<h3><i class="icon-shopping-cart"></i> {l s='Order(s) Information'}</h3>
|
||||
{if is_array($cart_orders) && count($cart_orders)}
|
||||
{foreach from=$cart_orders item=$cart_order}
|
||||
<h2><a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&id_order={$cart_order.id_order|intval}&vieworder"> {l s='Order #%d' sprintf=$cart_order.id_order|string_format:"%06d"}</a></h2>
|
||||
{/foreach}
|
||||
{l s='Created on:'} {dateFormat date=$cart_order.date_add}
|
||||
{else}
|
||||
<h2>{l s='No order was created from this cart.'}</h2>
|
||||
{if $customer->id}
|
||||
@@ -80,113 +82,60 @@
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h3><i class="icon-archive"></i> {l s='Cart summary'}</h3>
|
||||
<div class="row">
|
||||
<table class="table" id="orderProducts">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fixed-width-xs"> </th>
|
||||
<th><span class="title_box">{l s='Product'}</span></th>
|
||||
<th class="text-right fixed-width-md"><span class="title_box">{l s='Unit price'}</span></th>
|
||||
<th class="text-center fixed-width-md"><span class="title_box">{l s='Quantity'}</span></th>
|
||||
<th class="text-center fixed-width-sm"><span class="title_box">{l s='Stock'}</span></th>
|
||||
<th class="text-right fixed-width-sm"><span class="title_box">{l s='Total'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$products item='product'}
|
||||
{if isset($customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery])}
|
||||
<tr>
|
||||
<td>{$product.image}</td>
|
||||
<td><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product.id_product}&updateproduct">
|
||||
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
|
||||
{if $product.reference}{l s='Ref:'} {$product.reference}{/if}
|
||||
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$product.price_wt currency=$currency}</td>
|
||||
<td class="text-center">{$product.customizationQuantityTotal}</td>
|
||||
<td class="text-center">{$product.qty_in_stock}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}</td>
|
||||
</tr>
|
||||
{foreach from=$customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery] item='customization'}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{foreach from=$customization.datas key='type' item='datas'}
|
||||
{if $type == constant('Product::CUSTOMIZE_FILE')}
|
||||
<ul style="margin: 0; padding: 0; list-style-type: none;">
|
||||
{foreach from=$datas key='index' item='data'}
|
||||
<li style="display: inline; margin: 2px;">
|
||||
<a href="displayImage.php?img={$data.value}&name={$order->id|intval}-file{$index}" class="_blank">
|
||||
<img src="{$pic_dir}{$data.value}_small" alt="" /></a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{elseif $type == constant('Product::CUSTOMIZE_TEXTFIELD')}
|
||||
<div class="form-horizontal">
|
||||
{foreach from=$datas key='index' item='data'}
|
||||
<div class="form-group">
|
||||
<span class="control-label col-lg-3"><strong>{if $data.name}{$data.name}{else}{l s='Text #'}{$index}{/if}</strong></span>
|
||||
<div class="col-lg-9">
|
||||
<p class="form-control-static">{$data.value}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</td>
|
||||
<td></td>
|
||||
<td class="text-center">{$customization.quantity}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{if !isset($product.customizationQuantityTotal) || $product.cart_quantity > $product.customizationQuantityTotal}
|
||||
<tr>
|
||||
<td>{$product.image}</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product.id_product}&updateproduct">
|
||||
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
|
||||
{if $product.reference}{l s='Ref:'} {$product.reference}{/if}
|
||||
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$product.product_price currency=$currency}</td>
|
||||
<td class="text-center">{if isset($product.customizationQuantityTotal)}{math equation='x - y' x=$product.cart_quantity y=$product.customizationQuantityTotal|intval}{else}{math equation='x - y' x=$product.cart_quantity y=$product.customization_quantity|intval}{/if}</td>
|
||||
<td class="text-center">{$product.qty_in_stock}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$product.product_total currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<div class="row">
|
||||
<table class="table" id="orderProducts">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="5">{l s='Total cost of products:'}</td>
|
||||
<th class="fixed-width-xs"><span class="title_box">{l s='Image'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Unit Price'}</span></th>
|
||||
<th class="text-right"><span class="title_box">{l s='Total'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$products item='product'}
|
||||
<tr>
|
||||
<td>{$product.image}</td>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product.id_product}&updateproduct">
|
||||
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
|
||||
{if $product.reference}{l s='Ref:'} {$product.reference}{/if}
|
||||
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">{displayWtPriceWithCurrency price=$product.product_price currency=$currency}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$product.product_total currency=$currency}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3">{l s='Total cost of room types:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td>
|
||||
</tr>
|
||||
{if $total_discounts != 0}
|
||||
<tr>
|
||||
<td colspan="5">{l s='Total value of vouchers:'}</td>
|
||||
<td colspan="3">{l s='Total value of vouchers:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $total_wrapping > 0}
|
||||
<tr>
|
||||
<td colspan="5">{l s='Total cost of gift wrapping:'}</td>
|
||||
<td colspan="3">{l s='Total cost of gift wrapping:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0}
|
||||
<tr>
|
||||
<td colspan="5">{l s='Total cost of shipping:'}</td>
|
||||
<td colspan="3">{l s='Total cost of shipping:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td colspan="5" class=" success"><strong>{l s='Total:'}</strong></td>
|
||||
<td colspan="3" class=" success"><strong>{l s='Total:'}</strong></td>
|
||||
<td class="text-right success"><strong>{displayWtPriceWithCurrency price=$total_price currency=$currency}</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{if $discounts}
|
||||
|
||||
@@ -23,120 +23,119 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<script>
|
||||
var dashboard_ajax_url = '{$link->getAdminLink('AdminDashboard')}';
|
||||
var adminstats_ajax_url = '{$link->getAdminLink('AdminStats')}';
|
||||
var no_results_translation = '{l s='No result' js=1}';
|
||||
var dashboard_use_push = '{$dashboard_use_push|intval}';
|
||||
var read_more = '{l s='Read more' js=1}';
|
||||
var dashboard_ajax_url = '{$link->getAdminLink('AdminDashboard')}';
|
||||
var adminstats_ajax_url = '{$link->getAdminLink('AdminStats')}';
|
||||
var no_results_translation = '{l s='No result' js=1}';
|
||||
var dashboard_use_push = '{$dashboard_use_push|intval}';
|
||||
var read_more = '{l s='Read more' js=1}';
|
||||
</script>
|
||||
|
||||
<div id="dashboard">
|
||||
{$hookDashboardTop}
|
||||
<div class="row">
|
||||
{if $warning}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning">{$warning}</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="col-lg-12">
|
||||
<div class="panel clearfix">
|
||||
<div class="col-lg-6">
|
||||
<div id="calendar">
|
||||
<form action="{$action|escape}" method="post" id="calendar_form" name="calendar_form" class="form-inline">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group input-group">
|
||||
<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'day')} active{/if}">
|
||||
{l s='Day'}
|
||||
</button>
|
||||
<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth {if isset($preselect_date_range) && $preselect_date_range == 'month'}active{/if}">
|
||||
{l s='Month'}
|
||||
</button>
|
||||
<button type="button" name="submitDateYear" class="btn btn-default submitDateYear{if isset($preselect_date_range) && $preselect_date_range == 'year'} active{/if}">
|
||||
{l s='Year'}
|
||||
</button>
|
||||
<button type="button" name="submitDateDayPrev" class="btn btn-default submitDateDayPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-day'} active{/if}">
|
||||
{l s='Day'}-1
|
||||
</button>
|
||||
<button type="button" name="submitDateMonthPrev" class="btn btn-default submitDateMonthPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-month'} active{/if}">
|
||||
{l s='Month'}-1
|
||||
</button>
|
||||
<button type="button" name="submitDateYearPrev" class="btn btn-default submitDateYearPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-year'} active{/if}">
|
||||
{l s='Year'}-1
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" name="datepickerFrom" id="datepickerFrom" value="{$date_from|escape}" class="form-control">
|
||||
<input type="hidden" name="datepickerTo" id="datepickerTo" value="{$date_to|escape}" class="form-control">
|
||||
<input type="hidden" name="preselectDateRange" id="preselectDateRange" value="{if isset($preselect_date_range)}{$preselect_date_range}{/if}" class="form-control">
|
||||
<div class="form-group input-group">
|
||||
<button id="datepickerExpand" class="btn btn-default" type="button">
|
||||
<i class="icon-calendar-empty"></i>
|
||||
<span class="hidden-xs">
|
||||
{l s='From'}
|
||||
<strong class="text-info" id="datepicker-from-info">{$date_from|escape}</strong>
|
||||
{l s='To'}
|
||||
<strong class="text-info" id="datepicker-to-info">{$date_to|escape}</strong>
|
||||
<strong class="text-info" id="datepicker-diff-info"></strong>
|
||||
</span>
|
||||
<i class="icon-caret-down"></i>
|
||||
</button>
|
||||
{$calendar}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<form action="{$action|escape}" method="post" class="form-inline">
|
||||
<div class="text-right">
|
||||
<select class="form-control stats-filter-hotel" name="stats_id_hotel">
|
||||
{foreach from=$hotel_options item=hotel_option}
|
||||
<option value="{$hotel_option.id_hotel}" {if $hotel_option.id_hotel == $id_hotel}selected{/if}>
|
||||
{$hotel_option.hotel_name|escape:'html':'UTF-8'}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<input type="hidden" id="submit-stats-hotel" name="submitStatsHotel" value="1" disabled>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-push-4 col-lg-7 col-lg-push-3" id="hookDashboardZoneTwo">
|
||||
<div class='row'>
|
||||
{$hookDashboardZoneTwo}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 col-md-pull-8 col-lg-3 col-lg-pull-7" id="hookDashboardZoneOne">
|
||||
{$hookDashboardZoneOne}
|
||||
</div>
|
||||
<div class="col-md-4 col-md-pull-8 col-lg-2 col-lg-pull-0" id="hookDashboardZoneThree">
|
||||
<div class="row">
|
||||
{$hookDashboardZoneThree}
|
||||
<div class="col-sm-12">
|
||||
<section class="dash_links widget panel">
|
||||
<h3><i class="icon-link"></i> {l s="Useful links"}</h3>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/qlo-reservation-system/" class="_blank">{l s="Official Documentation"}</a></dt>
|
||||
<dd>{l s="Qloapps User Guide"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://forums.qloapps.com/" class="_blank">{l s="Qloapps Forum"}</a></dt>
|
||||
<dd>{l s="Connect with the Qloapps community"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/addons/" class="_blank">{l s="Qloapps Addons"}</a></dt>
|
||||
<dd>{l s="Enhance your store Qloapps modules"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/contact/" class="_blank">{l s="Contact Us!"}</a></dt>
|
||||
<dd>{l s="Contact us for any help"}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{$hookDashboardTop}
|
||||
<div class="row">
|
||||
{if $warning}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning">{$warning}</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="col-lg-12">
|
||||
<div class="panel clearfix">
|
||||
<div class="col-lg-6">
|
||||
<div id="calendar">
|
||||
<form action="{$action|escape}" method="post" id="calendar_form" name="calendar_form" class="form-inline">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group input-group">
|
||||
<button type="button" name="submitDateDay" class="btn btn-default submitDateDay{if (!isset($preselect_date_range) || !$preselect_date_range) || (isset($preselect_date_range) && $preselect_date_range == 'day')} active{/if}">
|
||||
{l s='Day'}
|
||||
</button>
|
||||
<button type="button" name="submitDateMonth" class="btn btn-default submitDateMonth {if isset($preselect_date_range) && $preselect_date_range == 'month'}active{/if}">
|
||||
{l s='Month'}
|
||||
</button>
|
||||
<button type="button" name="submitDateYear" class="btn btn-default submitDateYear{if isset($preselect_date_range) && $preselect_date_range == 'year'} active{/if}">
|
||||
{l s='Year'}
|
||||
</button>
|
||||
<button type="button" name="submitDateDayPrev" class="btn btn-default submitDateDayPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-day'} active{/if}">
|
||||
{l s='Day'}-1
|
||||
</button>
|
||||
<button type="button" name="submitDateMonthPrev" class="btn btn-default submitDateMonthPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-month'} active{/if}">
|
||||
{l s='Month'}-1
|
||||
</button>
|
||||
<button type="button" name="submitDateYearPrev" class="btn btn-default submitDateYearPrev{if isset($preselect_date_range) && $preselect_date_range == 'prev-year'} active{/if}">
|
||||
{l s='Year'}-1
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" name="datepickerFrom" id="datepickerFrom" value="{$date_from|escape}" class="form-control">
|
||||
<input type="hidden" name="datepickerTo" id="datepickerTo" value="{$date_to|escape}" class="form-control">
|
||||
<input type="hidden" name="preselectDateRange" id="preselectDateRange" value="{if isset($preselect_date_range)}{$preselect_date_range}{/if}" class="form-control">
|
||||
<div class="form-group input-group">
|
||||
<button id="datepickerExpand" class="btn btn-default" type="button">
|
||||
<i class="icon-calendar-empty"></i>
|
||||
<span class="hidden-xs">
|
||||
{l s='From'}
|
||||
<strong class="text-info" id="datepicker-from-info">{dateFormat date=$date_from}</strong>
|
||||
{l s='To'}
|
||||
<strong class="text-info" id="datepicker-to-info">{dateFormat date=$date_to}</strong>
|
||||
<strong class="text-info" id="datepicker-diff-info"></strong>
|
||||
</span>
|
||||
<i class="icon-caret-down"></i>
|
||||
</button>
|
||||
{$calendar}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<form action="{$action|escape}" method="post" class="form-inline">
|
||||
<div class="text-right">
|
||||
<select class="form-control stats-filter-hotel" name="stats_id_hotel">
|
||||
{foreach from=$hotel_options item=hotel_option}
|
||||
<option value="{$hotel_option.id_hotel}" {if $hotel_option.id_hotel == $id_hotel}selected{/if}>
|
||||
{$hotel_option.hotel_name|escape:'html':'UTF-8'}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<input type="hidden" id="submit-stats-hotel" name="submitStatsHotel" value="1" disabled>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-push-4 col-lg-7 col-lg-push-3" id="hookDashboardZoneTwo">
|
||||
<div class='row'>
|
||||
{$hookDashboardZoneTwo}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 col-md-pull-8 col-lg-3 col-lg-pull-7" id="hookDashboardZoneOne">
|
||||
{$hookDashboardZoneOne}
|
||||
</div>
|
||||
<div class="col-md-4 col-md-pull-8 col-lg-2 col-lg-pull-0" id="hookDashboardZoneThree">
|
||||
<div class="row">
|
||||
{$hookDashboardZoneThree}
|
||||
<div class="col-sm-12">
|
||||
<section class="dash_links widget panel">
|
||||
<h3><i class="icon-link"></i> {l s="Useful links"}</h3>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/qlo-reservation-system/" class="_blank">{l s="Official Documentation"}</a></dt>
|
||||
<dd>{l s="Qloapps User Guide"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://forums.qloapps.com/" class="_blank">{l s="Qloapps Forum"}</a></dt>
|
||||
<dd>{l s="Connect with the Qloapps community"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/addons/" class="_blank">{l s="Qloapps Addons"}</a></dt>
|
||||
<dd>{l s="Enhance your store Qloapps modules"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/contact/" class="_blank">{l s="Contact Us!"}</a></dt>
|
||||
<dd>{l s="Contact us for any help"}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group login-actions">
|
||||
<div id="remind-me" class="checkbox pull-left">
|
||||
<label for="stay_logged_in">
|
||||
<input name="stay_logged_in" type="checkbox" id="stay_logged_in" value="1" tabindex="3"/>
|
||||
@@ -100,7 +100,7 @@
|
||||
</label>
|
||||
<input type="text" name="email_forgot" id="email_forgot" class="form-control" autofocus="autofocus" tabindex="5" placeholder=" test@example.com" />
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="panel-footer login-actions">
|
||||
<button type="button" href="#" class="btn btn-default show-login-form" tabindex="7">
|
||||
<i class="icon-caret-left"></i>
|
||||
{l s='Back to login'}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<span class="employee_avatar_small">
|
||||
<img class="imgm img-thumbnail" alt="" src="{$employee_image}" width="32" height="32" />
|
||||
</span>
|
||||
{$employee_name}
|
||||
|
||||
{$employee_name|escape:'html':'UTF-8'}
|
||||
<br />
|
||||
({$employee_email|escape:'html':'UTF-8'})
|
||||
|
||||
@@ -57,14 +57,14 @@
|
||||
</ul>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$data.date_from|escape:'html':'UTF-8'|date_format:"%d-%m-%Y"} - {$data.date_to|escape:'html':'UTF-8'|date_format:"%d-%m-%Y"}</td>
|
||||
<td>{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</td>
|
||||
<td id="cart_detail_data_unit_price_{$data.id|escape:'html':'UTF-8'}">
|
||||
<span class="product_original_price {if $data.feature_price_diff > 0}room_type_old_price{/if}" {if $data.feature_price_diff < 0} style="display:none;"{/if}>
|
||||
{displayPrice price=$data.product_price_tax_excl|escape:'html':'UTF-8'}
|
||||
</span>
|
||||
<span class="room_type_current_price" {if !$data.feature_price_diff}style="display:none;"{/if}>
|
||||
{displayPrice price=$data.feature_price_tax_excl|escape:'html':'UTF-8'}
|
||||
</span>
|
||||
{if $data.feature_price_diff != 0}
|
||||
{assign var=shown_room_type_price value=$data.feature_price_tax_excl}
|
||||
{else}
|
||||
{assign var=shown_room_type_price value=$data.product_price_tax_excl}
|
||||
{/if}
|
||||
<input type="text" class="room_unit_price" data-id-booking-data="{$data.id}" data-id-product="{$data.id_product}" data-id-room="{$data.id_room}" data-date-from="{$data.date_from}" data-date-to="{$data.date_to}" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
|
||||
</td>
|
||||
<td>
|
||||
{if isset($data.extra_demands) && $data.extra_demands}
|
||||
@@ -73,8 +73,8 @@
|
||||
{displayPrice price=0}
|
||||
{/if}
|
||||
</td>
|
||||
<td id="cart_detail_data_price_{$data.id|escape:'html':'UTF-8'}">{displayPrice price=$data.amt_with_qty}</td>
|
||||
<td>
|
||||
<td class="cart_line_total_rooms_price" id="cart_detail_data_price_{$data.id|escape:'html':'UTF-8'}">{displayPrice price=$data.amt_with_qty}</td>
|
||||
<td class="cart_line_total_price">
|
||||
{if isset($data.extra_demands) && $data.extra_demands}
|
||||
{displayPrice price=$data.amt_with_qty|escape:'html':'UTF-8'+$data.demand_price|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" readonly="true" />
|
||||
<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" readonly="true" />
|
||||
<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="booking_duration_show">{$data.date_from|date_format:"%d-%m-%Y"} -  {$data.date_to|date_format:"%d-%m-%Y"}</span>
|
||||
<span class="booking_duration_show">{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</span>
|
||||
|
||||
{if $can_edit}
|
||||
<div class="booking_duration_edit" style="display:none;">
|
||||
@@ -80,12 +80,19 @@
|
||||
</td>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="product_original_price {if $data.feature_price_diff > 0}room_type_old_price{/if}" {if $data.feature_price_diff < 0} style="display:none;"{/if}>
|
||||
{convertPriceWithCurrency price=$data.unit_price_without_reduction_tax_incl currency=$currency->id}
|
||||
</span>
|
||||
<span class="room_type_current_price" {if !$data.feature_price_diff}style="display:none;"{/if}>
|
||||
{convertPriceWithCurrency price=$data.paid_unit_price_tax_incl currency=$currency->id}
|
||||
</span>
|
||||
<span class="room_unit_price_show">
|
||||
{if $data.feature_price_diff != 0}
|
||||
<span class="product_original_price room_type_old_price">
|
||||
{convertPriceWithCurrency price=$data.unit_price_without_reduction_tax_excl currency=$currency->id}
|
||||
</span>
|
||||
{/if}
|
||||
<span class="room_type_current_price">
|
||||
{convertPriceWithCurrency price=$data.paid_unit_price_tax_excl currency=$currency->id}
|
||||
</span>
|
||||
</span>
|
||||
<div class="room_unit_price_edit" style="display: none;">
|
||||
<input type="text" class="room_unit_price" name="room_unit_price" value="{$data.paid_unit_price_tax_excl}">
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=$data.amt_with_qty_tax_incl currency=$currency->id}</span>
|
||||
|
||||
@@ -237,11 +237,19 @@
|
||||
$(this).change();
|
||||
return true;
|
||||
});
|
||||
$('.product_unit_price').live('change', function(e) {
|
||||
$(document).on('change', '.room_unit_price', function(e) {
|
||||
e.preventDefault();
|
||||
var product = $(this).attr('rel').split('_');
|
||||
updateProductPrice(product[0], product[1], $(this).val());
|
||||
});
|
||||
var cart_row = $(this).closest('tr');
|
||||
var params = {
|
||||
id_booking_data: parseInt($(this).attr('data-id-booking-data')),
|
||||
id_product: parseInt($(this).attr('data-id-product')),
|
||||
id_room: parseInt($(this).attr('data-id-room')),
|
||||
date_from: $(this).attr('data-date-from'),
|
||||
date_to: $(this).attr('data-date-to'),
|
||||
price: $(this).val(),
|
||||
};
|
||||
updateProductPrice(params, cart_row);
|
||||
})
|
||||
$('#order_message').live('change', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
@@ -381,31 +389,45 @@
|
||||
});
|
||||
}
|
||||
|
||||
function updateProductPrice(id_product, id_product_attribute, new_price)
|
||||
{
|
||||
function updateProductPrice(params, cart_row) {
|
||||
$.extend(params, {
|
||||
id_cart: id_cart,
|
||||
price: new Number(params.price.replace(",",".")).toFixed(4).toString(),
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
|
||||
async: true,
|
||||
dataType: "json",
|
||||
data : {
|
||||
dataType: "JSON",
|
||||
data: {
|
||||
ajax: "1",
|
||||
token: "{getAdminToken tab='AdminCarts'}",
|
||||
tab: "AdminCarts",
|
||||
action: "updateProductPrice",
|
||||
id_cart: id_cart,
|
||||
id_product: id_product,
|
||||
id_product_attribute: id_product_attribute,
|
||||
id_customer: id_customer,
|
||||
price: new Number(new_price.replace(",",".")).toFixed(4).toString()
|
||||
},
|
||||
success : function(res)
|
||||
{
|
||||
displaySummary(res);
|
||||
params: params,
|
||||
},
|
||||
success : function(response) {
|
||||
updateCartLine(response.curr_booking_info, cart_row);
|
||||
updateCartSummaryData(response.cart_info);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateCartLine(data, cart_row) {
|
||||
$(cart_row).find('.cart_line_total_rooms_price').html(data.amt_with_qty);
|
||||
$(cart_row).find('.cart_line_total_price').html(data.total_price);
|
||||
}
|
||||
|
||||
function updateCartSummaryData(summaryData) {
|
||||
$('#total_products').html(formatCurrency(parseFloat(summaryData.summary.total_products), currency_format, currency_sign, currency_blank));
|
||||
$('#total_extra_demands').html(formatCurrency(parseFloat(summaryData.summary.total_extra_demands_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_vouchers').html(formatCurrency(parseFloat(summaryData.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_without_taxes').html(formatCurrency(parseFloat(summaryData.summary.total_price_without_tax), currency_format, currency_sign, currency_blank));
|
||||
$('#total_taxes').html(formatCurrency(parseFloat(summaryData.summary.total_tax), currency_format, currency_sign, currency_blank));
|
||||
$('#total_with_taxes').html(formatCurrency(parseFloat(summaryData.summary.total_price), currency_format, currency_sign, currency_blank));
|
||||
}
|
||||
|
||||
function displayQtyInStock(id)
|
||||
{
|
||||
var id_product = $('#id_product').val();
|
||||
@@ -559,7 +581,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setupCustomer(idCustomer)
|
||||
{
|
||||
//$('#carts').show();// by webkul
|
||||
@@ -863,8 +884,7 @@
|
||||
return price;
|
||||
}
|
||||
|
||||
function displaySummary(jsonSummary)
|
||||
{
|
||||
function displaySummary(jsonSummary) {
|
||||
currency_format = jsonSummary.currency.format;
|
||||
currency_sign = jsonSummary.currency.sign;
|
||||
currency_blank = jsonSummary.currency.blank;
|
||||
@@ -874,37 +894,37 @@
|
||||
updateCartVouchers(jsonSummary.summary.discounts);
|
||||
updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice);
|
||||
|
||||
if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length || !jsonSummary.delivery_option_list)
|
||||
if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length || !jsonSummary.delivery_option_list) {
|
||||
$('#carriers_part').hide();
|
||||
else
|
||||
} else {
|
||||
$('#carriers_part').hide();
|
||||
|
||||
//original
|
||||
/*if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length || !jsonSummary.delivery_option_list)
|
||||
$('#carriers_part,#summary_part').hide();
|
||||
else
|
||||
$('#carriers_part,#summary_part').hide();
|
||||
*/
|
||||
}
|
||||
|
||||
updateDeliveryOptionList(jsonSummary.delivery_option_list);
|
||||
checkVirtualProduct(jsonSummary.summary.products,jsonSummary.delivery_option_list);
|
||||
|
||||
if (jsonSummary.cart.gift == 1)
|
||||
if (jsonSummary.cart.gift == 1) {
|
||||
$('#order_gift').attr('checked', true);
|
||||
else
|
||||
} else {
|
||||
$('#carrier_gift').removeAttr('checked');
|
||||
if (jsonSummary.cart.recyclable == 1)
|
||||
}
|
||||
if (jsonSummary.cart.recyclable == 1) {
|
||||
$('#carrier_recycled_package').attr('checked', true);
|
||||
else
|
||||
} else {
|
||||
$('#carrier_recycled_package').removeAttr('checked');
|
||||
if (jsonSummary.free_shipping == 1)
|
||||
}
|
||||
if (jsonSummary.free_shipping == 1) {
|
||||
$('#free_shipping').attr('checked', true);
|
||||
else
|
||||
} else {
|
||||
$('#free_shipping_off').attr('checked', true);
|
||||
}
|
||||
|
||||
$('#gift_message').html(jsonSummary.cart.gift_message);
|
||||
if (!changed_shipping_price)
|
||||
|
||||
if (!changed_shipping_price) {
|
||||
$('#shipping_price').html('<b>' + formatCurrency(parseFloat(jsonSummary.summary.total_shipping), currency_format, currency_sign, currency_blank) + '</b>');
|
||||
}
|
||||
|
||||
shipping_price_selected_carrier = jsonSummary.summary.total_shipping;
|
||||
|
||||
$('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
|
||||
@@ -291,10 +291,10 @@
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$data['date_from']|date_format:"%d-%m-%Y"}
|
||||
{dateFormat date=$data['date_from']}
|
||||
</td>
|
||||
<td>
|
||||
{$data['date_to']|date_format:"%d-%m-%Y"}
|
||||
{dateFormat date=$data['date_to']}
|
||||
</td>
|
||||
<td>
|
||||
<form action="" method="post" class="form-horizontal row room_status_info_form">
|
||||
@@ -305,7 +305,11 @@
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}<span class="badge badge-success margin-bottom-5">{l s='checked in on'} {$data['check_in']|date_format:"%d-%m-%Y"}</span>{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}<span class="badge badge-success margin-bottom-5">{l s='checked out on'} {$data['check_out']|date_format:"%d-%m-%Y"}</span>{/if}
|
||||
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}
|
||||
<p class="text-center"><span class="badge badge-success margin-bottom-5">{l s='Checked in on'} {dateFormat date=$data['check_in']}</span></p>
|
||||
{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
|
||||
<p class="text-center"><span class="badge badge-success margin-bottom-5">{l s='Checked out on'} {dateFormat date=$data['check_out']}</span></p>
|
||||
{/if}
|
||||
|
||||
{* field for the current date *}
|
||||
<input class="room_status_date wk-input-date" type="text" name="status_date" value="{$data['date_from']|date_format:"%d-%m-%Y"}" readonly/>
|
||||
@@ -977,7 +981,7 @@
|
||||
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Hotel Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Unit Price (Tax incl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Unit Price (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
{if isset($refundReqBookings) && $refundReqBookings}
|
||||
<th class="text-center"><span class="title_box">{l s='Refund State'}</span></th>
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
{if isset($product->id)}
|
||||
<div id="product-lengthofstay" class="panel product-tab">
|
||||
<h3 class="tab"><i class="icon-calendar"></i> {l s='Length Of Stay'}</h3>
|
||||
<input type="hidden" name="submitted_tabs[]" value="LengthOfStay" />
|
||||
|
||||
<div class="panel-content">
|
||||
<div class="alert alert-info">
|
||||
{l s='Please read below important points regarding length of stay management'}
|
||||
<ul>
|
||||
<li>{l s='Set 1 day for setting no limit on Minimum length of stay'}</li>
|
||||
<li>{l s='Set 0 day for setting no limit on Maximum length of stay'}</li>
|
||||
<li>{l s='Enable "Length of stay for date ranges" for setting values of \"Minimum length of stay\" and \"Maximum length of stay\" according to different date ranges'}</li>
|
||||
<li>{l s='Length of stays (minimum|maximum) of all the dates which does not fall under the date ranges of \"Length of stay for date ranges\", will be taken from the global values of length of stays of this room type.'}</li>
|
||||
<li>{l s='\"Date to\" will not be included in the date range of \"Length of stay for date ranges\".'}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3 required" for="min_los">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Enter minimum length of stay for the hotel. set 1 day for setting no limit on minimum length of stay.'}">{l s='Minimum length of stay'}</span>
|
||||
</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group">
|
||||
<input type="text" id="min_los" name="min_los" value="{if isset($smarty.post.min_los)}{$smarty.post.min_los|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['min_los']) && $roomTypeInfo['min_los']}{$roomTypeInfo['min_los']|escape:'html':'UTF-8'}{else}1{/if}">
|
||||
<span class="input-group-addon">{l s='Day(s)'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3 required" for="max_los">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Enter maximum length of stay for the hotel. set 0 day for setting no limit on maximum length of stay.'}">{l s='Maximum length of stay'}</span>
|
||||
</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group">
|
||||
<input type="text" id="max_los" name="max_los" value="{if isset($smarty.post.max_los)}{$smarty.post.max_los|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['max_los'])}{$roomTypeInfo['max_los']|escape:'html':'UTF-8'}{else}0{/if}">
|
||||
<span class="input-group-addon">{l s='Day(s)'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="active_restriction_dates" class="control-label col-sm-3">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Enable, if you want set minimum|maximum length of stay according to different date ranges.'}">{l s='Length of stay for date ranges'}</span>
|
||||
</label>
|
||||
<div class="col-sm-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" value="1" id="active_restriction_dates_on" name="active_restriction_dates" {if isset($smarty.post.active_restriction_dates) && $smarty.post.active_restriction_dates}checked="checked"{elseif isset($roomTypeInfo['restrictionDataRange']) && $roomTypeInfo['restrictionDataRange']}checked="checked"{/if}>
|
||||
<label for="active_restriction_dates_on">{l s='Yes'}</label>
|
||||
|
||||
<input type="radio" value="0" id="active_restriction_dates_off" name="active_restriction_dates" {if isset($smarty.post.active_restriction_dates)}{if !$smarty.post.active_restriction_dates}checked="checked"{/if}{elseif isset($roomTypeInfo['restrictionDataRange'])}{if !$roomTypeInfo['restrictionDataRange']}checked="checked"{/if}{else}checked="checked"{/if}>
|
||||
<label for="active_restriction_dates_off">{l s='No'}</label>
|
||||
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="restriction_dates_container" class="form-group table-responsive" {if isset($smarty.post.active_restriction_dates)}{if !$smarty.post.active_restriction_dates}style="display:none;"{/if}{elseif isset($roomTypeInfo['restrictionDataRange'])}{if !$roomTypeInfo['restrictionDataRange']}style="display:none;"{/if}{/if}>
|
||||
<table id="restriction_dates_table" class="table table-striped">
|
||||
<thead>
|
||||
<th>{l s='Date From'}</th>
|
||||
<th>{l s='Date To'}</th>
|
||||
<th>{l s='Minimum length of stay'}</th>
|
||||
<th>{l s='Maximum length of stay'}</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($smarty.post.active_restriction_dates) && $smarty.post.active_restriction_dates && isset($smarty.post.restriction_date_from) && $smarty.post.restriction_date_from}
|
||||
{assign var="restrictionDataRange" value=[]}
|
||||
{foreach from=$smarty.post.restriction_date_from item=restrictionDateFromVal key=restrictionKey}
|
||||
{assign var="restrictionDataRangeTemp" value=['date_from' => $restrictionDateFromVal, 'date_to' => $smarty.post.restriction_date_to[$restrictionKey], 'min_los' => $smarty.post.restriction_min_los[$restrictionKey], 'max_los' => $smarty.post.restriction_max_los[$restrictionKey]]}
|
||||
|
||||
{if isset($smarty.post.id_rt_restriction) && isset($smarty.post.id_rt_restriction[$restrictionKey])}
|
||||
{$restrictionDataRangeTemp['id_rt_restriction'] = $smarty.post.id_rt_restriction[$restrictionKey]}
|
||||
{/if}
|
||||
|
||||
{$restrictionDataRange[] = $restrictionDataRangeTemp}
|
||||
{/foreach}
|
||||
{elseif isset($roomTypeInfo['restrictionDataRange']) && $roomTypeInfo['restrictionDataRange']}
|
||||
{assign var="restrictionDataRange" value=$roomTypeInfo['restrictionDataRange']}
|
||||
{else}
|
||||
{assign var="restrictionDataRange" value=[['date_from' => '', 'date_to' => '', 'min_los' => '', 'max_los' => '']]}
|
||||
{/if}
|
||||
|
||||
{foreach from=$restrictionDataRange item=restrictionInfo}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input class="form-control restriction_date date_from_restriction" type="text" name="restriction_date_from[]" value="{$restrictionInfo['date_from']|date_format:'%d-%m-%Y'}" readonly>
|
||||
<span class="input-group-addon"><i class="icon-calendar"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input class="form-control restriction_date date_to_restriction" type="text" name="restriction_date_to[]" value="{$restrictionInfo['date_to']|date_format:'%d-%m-%Y'}" readonly>
|
||||
<span class="input-group-addon"><i class="icon-calendar"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" name="restriction_min_los[]" value="{$restrictionInfo['min_los']}">
|
||||
<span class="input-group-addon">{l s='day(s)'}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" name="restriction_max_los[]" value="{$restrictionInfo['max_los']}">
|
||||
<span class="input-group-addon">{l s='day(s)'}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{if isset($restrictionInfo['id_rt_restriction'])}
|
||||
<input type="hidden" name="id_rt_restriction[]" value="{$restrictionInfo['id_rt_restriction']}">
|
||||
{/if}
|
||||
<a href="#" class="btn btn-default delete_date_restriction" {if isset($restrictionInfo['id_rt_restriction'])}data-id-rt-restriction="{$restrictionInfo['id_rt_restriction']}"{/if}><i class="icon-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<a href="#" id="add_los_restriction" class="btn btn-default"><i class="icon icon-plus"></i> {l s='Add more length of stays'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default">
|
||||
<i class="process-icon-cancel"></i>
|
||||
{l s='Cancel'}
|
||||
</a>
|
||||
<button type="submit" name="submitAddproduct" class="btn btn-default pull-right" disabled="disabled">
|
||||
<i class="process-icon-loading"></i>
|
||||
{l s='Save'}
|
||||
</button>
|
||||
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled">
|
||||
<i class="process-icon-loading"></i>
|
||||
{l s='Save and stay'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
var days_txt = "{l s='day(s)' js=1}";
|
||||
var adminProductLink = "{$link->getAdminlink('AdminProducts')}";
|
||||
var someErrorText = "{l s='Something went wrong. Please try again.' js=1}";
|
||||
|
||||
// console.log($.datepicker.parseDate( "dd-mm-yy", "15-06-2022" ));
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input[name='active_restriction_dates']").on('change', function () {
|
||||
if (parseInt($(this).val())) {
|
||||
$("#restriction_dates_container").show(200);
|
||||
} else {
|
||||
$("#restriction_dates_container").hide(200);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".delete_date_restriction",function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (typeof $(this).attr('data-id-rt-restriction') !== 'undefined' && $(this).attr('data-id-rt-restriction') !== false) {
|
||||
var currentElement = $(this);
|
||||
$.ajax({
|
||||
url: adminProductLink,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
ajax: true,
|
||||
action:'deleteRoomTypeLengthOfStayRestriction',
|
||||
id_rt_restriction: currentElement.attr('data-id-rt-restriction'),
|
||||
},
|
||||
success: function (result) {
|
||||
if (typeof result.success !== 'undefined' && result.success !== false) {
|
||||
showSuccessMessage(result.success);
|
||||
currentElement.closest('tr').remove();
|
||||
} else if (typeof result.error !== 'undefined' && result.error !== false) {
|
||||
showErrorMessage(result.error);
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
showErrorMessage(someErrorText);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$(this).closest('tr').remove();
|
||||
}
|
||||
});
|
||||
|
||||
$('#add_los_restriction').on('click',function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var html = '';
|
||||
html += '<tr>';
|
||||
html += '<td>';
|
||||
html += '<div class="input-group">';
|
||||
html += '<input class="form-control restriction_date date_from_restriction" type="text" name="restriction_date_from[]" value="" readonly>';
|
||||
html += '<span class="input-group-addon"><i class="icon-calendar"></i></span>';
|
||||
html += '</div>';
|
||||
html += '</td>';
|
||||
html += '<td>';
|
||||
html += '<div class="input-group">';
|
||||
html += '<input class="form-control restriction_date date_to_restriction" type="text" name="restriction_date_to[]" value="" readonly>';
|
||||
html += '<span class="input-group-addon"><i class="icon-calendar"></i></span>';
|
||||
html += '</div>';
|
||||
html += '</td>';
|
||||
html += '<td>';
|
||||
html += '<div class="input-group">';
|
||||
html += '<input class="form-control" type="text" name="restriction_min_los[]" value="">';
|
||||
html += '<span class="input-group-addon">'+ days_txt +'</span>';
|
||||
html += '</div>';
|
||||
html += '</td>';
|
||||
html += '<td>';
|
||||
html += '<div class="input-group">';
|
||||
html += '<input class="form-control" type="text" name="restriction_max_los[]" value="">';
|
||||
html += '<span class="input-group-addon">'+ days_txt +'</span>';
|
||||
html += '</div>';
|
||||
html += '</td>';
|
||||
html += '<td>';
|
||||
html += '<a href="#" class="btn btn-default delete_date_restriction"><i class="icon-trash"></i></a>';
|
||||
html += '</td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#restriction_dates_table tbody').append(html);
|
||||
$(this).blur();
|
||||
});
|
||||
|
||||
$(document).on('focus', '.restriction_date', function() {
|
||||
var dateFormat = "dd-mm-yy";
|
||||
$(this).datepicker({
|
||||
defaultDate: new Date(),
|
||||
dateFormat: dateFormat,
|
||||
minDate: 0,
|
||||
beforeShow: function (input, instance) {
|
||||
if ($(input).hasClass('date_to_restriction') ) {
|
||||
var dateFrom = $(this).closest('tr').find('td div input.date_from_restriction').val();
|
||||
if (typeof dateFrom !== 'undefined' && dateFrom !== false && dateFrom != '') {
|
||||
// This can also work but more testing needed: var date = new Date($.datepicker.parseDate(dateFormat, dateFrom));
|
||||
var minDateTo = new Date($.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(dateFormat, dateFrom)));
|
||||
minDateTo.setDate(minDateTo.getDate() + 1);
|
||||
|
||||
$(this).datepicker("option", "minDate", minDateTo);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeShowDay: function (currentDate) {
|
||||
let dateRange = [];
|
||||
|
||||
$(this).closest('tr').siblings().each(function( index ) {
|
||||
var dateFrom = $(this).find('td div input.date_from_restriction').val();
|
||||
var dateTo = $(this).find('td div input.date_to_restriction').val();
|
||||
if ((typeof dateFrom !== 'undefined' && dateFrom !== false && dateFrom != '') && (typeof dateTo !== 'undefined' && dateTo !== false && dateTo != '')) {
|
||||
for (let index = $.datepicker.parseDate(dateFormat, dateFrom); index < $.datepicker.parseDate(dateFormat, dateTo); index.setDate(index.getDate() + 1)) {
|
||||
dateRange.push($.datepicker.formatDate(dateFormat, index));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let dateString = $.datepicker.formatDate(dateFormat, currentDate);
|
||||
return [dateRange.indexOf(dateString) == -1];
|
||||
},
|
||||
onClose: function (dateText, instance) {
|
||||
if ($(this).hasClass('date_from_restriction')) {
|
||||
if (dateText != "") {
|
||||
var dateFrom = $.datepicker.parseDate(dateFormat, dateText);
|
||||
|
||||
var dateTo = $(this).closest('tr').find('td div input.date_to_restriction').val();
|
||||
dateTo = $.datepicker.parseDate(dateFormat, dateTo);
|
||||
|
||||
if (dateFrom >= dateTo) {
|
||||
// In this case empty date_to, so that user have to again select the date for date_to field
|
||||
$(this).closest('tr').find('td div input.date_to_restriction').val("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -383,17 +383,17 @@ $(document).ready(function () {
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<h3>{l s='Feature Price Plans'}</h3>
|
||||
<h3>{l s='Advanced Price Rules'}</h3>
|
||||
<div class="alert alert-info">
|
||||
{l s='You can set feature price plans by visiting '}
|
||||
<a target="_blank" href="{$link->getAdminLink('AdminHotelFeaturePricesSettings')}">{l s='create feature price plans'}</a>
|
||||
{l s='You can set advanced price rules by visiting '}
|
||||
<a target="_blank" href="{$link->getAdminLink('AdminHotelFeaturePricesSettings')}">{l s='create advanced price rules.'}</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#{l s='Id'}</th>
|
||||
<th>{l s='Plan Name'}</th>
|
||||
<th>{l s='Rule Name'}</th>
|
||||
<th>{l s='Impact way'}</th>
|
||||
<th>{l s='Impact Type'}</th>
|
||||
<th>{l s='Impact Value'}</th>
|
||||
@@ -413,21 +413,21 @@ $(document).ready(function () {
|
||||
{$featurePlan['feature_price_name']}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['impact_type'] == 1}
|
||||
{if $featurePlan['impact_type'] == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE}
|
||||
{l s='Percentage'}
|
||||
{else}
|
||||
{l s='Fixed Amount'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['impact_way'] == 1}
|
||||
{if $featurePlan['impact_way'] == HotelRoomTypeFeaturePricing::IMPACT_WAY_DECREASE}
|
||||
{l s='Decrease'}
|
||||
{else}
|
||||
{l s='Increase'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['impact_type'] == 1}
|
||||
{if $featurePlan['impact_type'] == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE}
|
||||
{$featurePlan['impact_value']|round:2}%
|
||||
{else}
|
||||
{displayPrice price=$featurePlan['impact_value']}
|
||||
@@ -437,7 +437,7 @@ $(document).ready(function () {
|
||||
{dateFormat date=$featurePlan['date_from'] full=0}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['date_selection_type'] == 1}
|
||||
{if $featurePlan['date_selection_type'] == HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE}
|
||||
{dateFormat date=$featurePlan['date_to'] full=0}
|
||||
{else}
|
||||
<span class="badge badge-success">{l s='Specific date'}</span>
|
||||
@@ -455,7 +455,7 @@ $(document).ready(function () {
|
||||
{else}
|
||||
<tr>
|
||||
<td class="text-center" colspan="6">
|
||||
<i class="icon-warning-sign"></i> {l s='No feature price plans.'}
|
||||
<i class="icon-warning-sign"></i> {l s='No advanced price rules.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
@@ -318,29 +318,16 @@
|
||||
</li>
|
||||
{/if}
|
||||
<li id="employee_infos" class="dropdown">
|
||||
<a href="{$link->getAdminLink('AdminEmployees')|escape:'html':'UTF-8'}&id_employee={$employee->id|intval}&updateemployee" class="employee_name dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="employee_avatar_small">
|
||||
{if isset($employee)}
|
||||
<img class="imgm img-thumbnail" alt="" src="{$employee->getImage()}" width="32" height="32" />
|
||||
{/if}
|
||||
</span>
|
||||
<a href="{$link->getAdminLink('AdminEmployees')|escape:'html':'UTF-8'}&id_employee={$employee->id|intval}&updateemployee" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="string-long">{$employee->firstname} {$employee->lastname}</span>
|
||||
<span class="string-short">{l s='Me'}</span>
|
||||
<i class="caret"></i>
|
||||
</a>
|
||||
<ul id="employee_links" class="dropdown-menu">
|
||||
<li>
|
||||
<span class="employee_avatar">
|
||||
<img class="imgm img-thumbnail" alt="" src="{$employee->getImage()}" width="96" height="96" />
|
||||
</span>
|
||||
</li>
|
||||
<li class="text-center text-nowrap">{$employee->firstname} {$employee->lastname}</li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="{$link->getAdminLink('AdminEmployees')|escape:'html':'UTF-8'}&id_employee={$employee->id|intval}&updateemployee"><i class="icon-wrench"></i> {l s='My preferences'}</a></li>
|
||||
{if $host_mode}
|
||||
<li><a href="https://www.prestashop.com/cloud/" class="_blank"><i class="icon-wrench"></i> {l s='My PrestaShop account'}</a></li>
|
||||
{/if}
|
||||
<li class="divider"></li>
|
||||
<li><a id="header_logout" href="{$login_link|escape:'html':'UTF-8'}&logout"><i class="icon-signout"></i> {l s='Sign out'}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -911,7 +911,6 @@
|
||||
var module_dir = '{$smarty.const._MODULE_DIR_}';
|
||||
var id_language = {$defaultFormLanguage|intval};
|
||||
var languages = new Array();
|
||||
var vat_number = {if $vat_number}1{else}0{/if};
|
||||
// Multilang field setup must happen before document is ready so that calls to displayFlags() to avoid
|
||||
// precedence conflicts with other document.ready() blocks
|
||||
{foreach $languages as $k => $language}
|
||||
|
||||
@@ -22,63 +22,65 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<script>
|
||||
var callFunction = false;
|
||||
</script>
|
||||
|
||||
<{if isset($href) && $href}a style="display:block" href="{$href|escape:'html':'UTF-8'}"{else}div{/if} id="{$id|escape:'html':'UTF-8'}" data-toggle="tooltip" class="box-stats label-tooltip {$color|escape}" data-original-title="{$tooltip|escape}">
|
||||
<div class="kpi-content">
|
||||
{if isset($icon) && $icon}
|
||||
<i class="{$icon|escape}"></i>
|
||||
{/if}
|
||||
{if isset($chart) && $chart}
|
||||
<div class="boxchart-overlay">
|
||||
<div class="boxchart">
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($icon) && $icon}
|
||||
<i class="{$icon|escape}"></i>
|
||||
{/if}
|
||||
<span class="title">{$title|escape}</span>
|
||||
<span cLass="subtitle">{$subtitle|escape}</span>
|
||||
<span class="value">{$value|escape|replace:'&':'&'}</span>
|
||||
{if isset($chart) && $chart}
|
||||
<div class="boxchart-overlay">
|
||||
<div class="boxchart">
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($source) && $source}
|
||||
<span class="value skeleton-loading-wave loading-container-bar loading"></span>
|
||||
{elseif isset($value) && $value != ''}
|
||||
<span class="value">{$value|escape:'html':'UTF-8'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</{if isset($href) && $href}a{else}div{/if}>
|
||||
|
||||
{if isset($source) && $source != '' && isset($refresh) && $refresh != ''}
|
||||
<script>
|
||||
callFunction = true;
|
||||
</script>
|
||||
{if isset($source) && $source}
|
||||
<script>
|
||||
function refresh_{$id|replace:'-':'_'|addslashes}()
|
||||
{
|
||||
$.ajax({
|
||||
url: '{$source|addslashes}' + '&rand=' + new Date().getTime(),
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
headers: { 'cache-control': 'no-cache' },
|
||||
beforeSend: function() {
|
||||
$('#{$id|addslashes}').find('.value').html('');
|
||||
$('#{$id|addslashes}').find('.value').addClass('skeleton-loading-wave loading-container-bar loading');
|
||||
},
|
||||
success: function(jsonData){
|
||||
if (!jsonData.has_errors)
|
||||
{
|
||||
if (jsonData.value != undefined)
|
||||
$('#{$id|addslashes} .value').html(jsonData.value);
|
||||
if (jsonData.data != undefined)
|
||||
{
|
||||
$("#{$id|addslashes} .boxchart svg").remove();
|
||||
set_d3_{$id|replace:'-':'_'|addslashes}(jsonData.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
$('#{$id|addslashes}').find('.value').removeClass('skeleton-loading-wave loading-container-bar loading');
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
<script>
|
||||
function refresh_{$id|replace:'-':'_'|addslashes}(callFunction)
|
||||
{
|
||||
if(callFunction){
|
||||
$.ajax({
|
||||
url: '{$source|addslashes}' + '&rand=' + new Date().getTime(),
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
headers: { 'cache-control': 'no-cache' },
|
||||
success: function(jsonData){
|
||||
if (!jsonData.has_errors)
|
||||
{
|
||||
if (jsonData.value != undefined)
|
||||
$('#{$id|addslashes} .value').html(jsonData.value);
|
||||
if (jsonData.data != undefined)
|
||||
{
|
||||
$("#{$id|addslashes} .boxchart svg").remove();
|
||||
set_d3_{$id|replace:'-':'_'|addslashes}(jsonData.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
{if $chart}
|
||||
<script>
|
||||
function set_d3_{$id|str_replace:'-':'_'|addslashes}(jsonObject)
|
||||
function set_d3_{$id|replace:'-':'_'|addslashes}(jsonObject)
|
||||
{
|
||||
var data = new Array;
|
||||
$.each(jsonObject, function (index, value) {
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel kpi-container">
|
||||
<div class="kpi-refresh"><button class="close refresh" type="button" onclick="refresh_kpis(true);"><i class="process-icon-refresh" style="font-size:1em"></i></button></div>
|
||||
{if $refresh}
|
||||
<div class="kpi-refresh"><button class="close refresh" type="button" onclick="refresh_kpis();"><i class="process-icon-refresh" style="font-size:1em"></i></button></div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
{assign var='col' value=(int)(12 / $kpis|count)}
|
||||
{foreach from=$kpis item=i name=kpi}
|
||||
|
||||
@@ -243,13 +243,6 @@ class AddressCore extends ObjectModel
|
||||
public function validateController($htmlentities = true)
|
||||
{
|
||||
$errors = parent::validateController($htmlentities);
|
||||
if (!Configuration::get('VATNUMBER_MANAGEMENT') || !Configuration::get('VATNUMBER_CHECKING')) {
|
||||
return $errors;
|
||||
}
|
||||
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
|
||||
if (class_exists('VatNumber', false)) {
|
||||
return array_merge($errors, VatNumber::WebServiceCheck($this->vat_number));
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -746,7 +746,16 @@ class CartCore extends ObjectModel
|
||||
$totalPriceByProductTaxExcl = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($cartRoomInfo['id_product'], $cartRoomInfo['date_from'], $cartRoomInfo['date_to']);
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to'],
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room']
|
||||
);
|
||||
$totalPriceByProductTaxIncl += $roomTotalPrice['total_price_tax_incl'];
|
||||
$totalPriceByProductTaxExcl += $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
@@ -1637,7 +1646,12 @@ class CartCore extends ObjectModel
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to']
|
||||
$cartRoomInfo['date_to'],
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room']
|
||||
);
|
||||
if ($with_taxes) {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_incl'];
|
||||
|
||||
@@ -728,6 +728,7 @@ class CustomerCore extends ObjectModel
|
||||
if (!$cart) {
|
||||
$cart = Context::getContext()->cart;
|
||||
}
|
||||
|
||||
if (!$cart || !$cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) {
|
||||
$id_address = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_address`
|
||||
@@ -738,8 +739,13 @@ class CustomerCore extends ObjectModel
|
||||
} else {
|
||||
$id_address = $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
|
||||
}
|
||||
|
||||
$ids = Address::getCountryAndState($id_address);
|
||||
return (int)$ids['id_country'] ? $ids['id_country'] : Configuration::get('PS_COUNTRY_DEFAULT');
|
||||
if (isset($ids['id_country']) && (int) $ids['id_country']) {
|
||||
return (int) $ids['id_country'];
|
||||
}
|
||||
|
||||
return (int) Configuration::get('PS_COUNTRY_DEFAULT');
|
||||
}
|
||||
|
||||
public function toggleStatus()
|
||||
|
||||
@@ -124,19 +124,6 @@ class DispatcherCore
|
||||
'tags' => array('regexp' => '[a-zA-Z0-9-\pL]*'),
|
||||
),
|
||||
),
|
||||
/* Must be after the product and category rules in order to avoid conflict */
|
||||
'layered_rule' => array(
|
||||
'controller' => 'category',
|
||||
'rule' => '{id}-{rewrite}{/:selected_filters}',
|
||||
'keywords' => array(
|
||||
'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'),
|
||||
/* Selected filters is used by the module blocklayered */
|
||||
'selected_filters' => array('regexp' => '.*', 'param' => 'selected_filters'),
|
||||
'rewrite' => array('regexp' => '[_a-zA-Z0-9\pL\pS-]*'),
|
||||
'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
|
||||
'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -491,10 +491,7 @@ class EmployeeCore extends ObjectModel
|
||||
|
||||
public function getImage()
|
||||
{
|
||||
if (!Validate::isLoadedObject($this)) {
|
||||
return Tools::getAdminImageUrl('prestashop-avatar.png');
|
||||
}
|
||||
return Tools::getShopProtocol().'profile.prestashop.com/'.urlencode($this->email).'.jpg';
|
||||
return Context::getContext()->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO'));
|
||||
}
|
||||
|
||||
public function getLastElementsForNotify($element)
|
||||
|
||||
@@ -800,10 +800,9 @@ class LanguageCore extends ObjectModel
|
||||
$lang->iso_code = Tools::strtolower($iso_code);
|
||||
$lang->language_code = $iso_code; // Rewritten afterwards if the language code is available
|
||||
$lang->active = true;
|
||||
|
||||
// If the language pack has not been provided, retrieve it from prestashop.com
|
||||
if (!$lang_pack) {
|
||||
$lang_pack = json_decode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code));
|
||||
$lang_pack = json_decode(Tools::file_get_contents(_QLO_API_URL_.'/lang_pack/get_lang_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code));
|
||||
}
|
||||
|
||||
// If a language pack has been found or provided, prefill the language object with the value
|
||||
@@ -836,7 +835,7 @@ class LanguageCore extends ObjectModel
|
||||
Configuration::updateGlobalValue('PS_ALLOW_ACCENTED_CHARS_URL', 1);
|
||||
}
|
||||
|
||||
$flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
|
||||
$flag = Tools::file_get_contents(_QLO_API_URL_.'/download/lang_pack/flags/'.$iso_code.'.jpg');
|
||||
if ($flag != null && !preg_match('/<body>/', $flag)) {
|
||||
$file = fopen(_PS_ROOT_DIR_.'/img/l/'.(int)$lang->id.'.jpg', 'w');
|
||||
if ($file) {
|
||||
@@ -917,11 +916,11 @@ class LanguageCore extends ObjectModel
|
||||
$errors = array();
|
||||
$file = _PS_TRANSLATIONS_DIR_.(string)$iso.'.gzip';
|
||||
|
||||
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower((string)$iso))) {
|
||||
if (!$lang_pack_link = Tools::file_get_contents(_QLO_API_URL_.'/lang_pack/get_lang_pack.php?version='.$version.'&iso_lang='.Tools::strtolower((string)$iso))) {
|
||||
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
||||
} elseif (!$lang_pack = json_decode($lang_pack_link)) {
|
||||
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
||||
} elseif (empty($lang_pack->error) && ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))) {
|
||||
} elseif (empty($lang_pack->error) && ($content = Tools::file_get_contents($lang_pack->download_link))) {
|
||||
if (!@file_put_contents($file, $content)) {
|
||||
if (is_writable(dirname($file))) {
|
||||
@unlink($file);
|
||||
@@ -939,7 +938,6 @@ class LanguageCore extends ObjectModel
|
||||
$gz = new Archive_Tar($file, true);
|
||||
$files_list = AdminTranslationsController::filterTranslationFiles(Language::getLanguagePackListContent((string)$iso, $gz));
|
||||
$files_paths = AdminTranslationsController::filesListToPaths($files_list);
|
||||
|
||||
$i = 0;
|
||||
$tmp_array = array();
|
||||
|
||||
@@ -982,8 +980,6 @@ class LanguageCore extends ObjectModel
|
||||
AdminTranslationsController::checkAndAddMailsFiles((string)$iso, $files_list);
|
||||
AdminTranslationsController::addNewTabs((string)$iso, $files_list);
|
||||
}
|
||||
//By webkul....Replace our customized mail files in the mail folder.....
|
||||
Language::replaceCustomizedMailFiles($iso);
|
||||
}
|
||||
|
||||
return count($errors) ? $errors : true;
|
||||
|
||||
@@ -689,9 +689,7 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
}
|
||||
|
||||
// update order in hlt tables
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
// update order in htl tables
|
||||
$objRoomType = new HotelRoomType();
|
||||
|
||||
$objAdvancedPayment = new HotelAdvancedPayment();
|
||||
@@ -731,7 +729,12 @@ abstract class PaymentModuleCore extends Module
|
||||
$total_price = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$objCartBookingData->date_from,
|
||||
$objCartBookingData->date_to
|
||||
$objCartBookingData->date_to,
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$objCartBookingData->id_cart,
|
||||
$objCartBookingData->id_guest,
|
||||
$objCartBookingData->id_room
|
||||
);
|
||||
$objBookingDetail->date_from = $objCartBookingData->date_from;
|
||||
$objBookingDetail->date_to = $objCartBookingData->date_to;
|
||||
@@ -843,6 +846,9 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
}
|
||||
|
||||
// delete cart feature prices after booking creation success
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart);
|
||||
|
||||
if (isset($_COOKIE['wk_id_cart'])) {
|
||||
setcookie('wk_id_cart', ' ', time() - 86400, '/');
|
||||
setcookie('wk_id_guest', ' ', time() - 86400, '/');
|
||||
@@ -945,7 +951,6 @@ abstract class PaymentModuleCore extends Module
|
||||
'{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
|
||||
'{delivery_other}' => $delivery->other,
|
||||
'{invoice_company}' => $invoice->company,
|
||||
'{invoice_vat_number}' => $invoice->vat_number,
|
||||
'{invoice_firstname}' => $invoice->firstname,
|
||||
'{invoice_lastname}' => $invoice->lastname,
|
||||
'{invoice_address2}' => $invoice->address2,
|
||||
@@ -1345,20 +1350,17 @@ abstract class PaymentModuleCore extends Module
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code."-default", 'small_default');
|
||||
}
|
||||
|
||||
$unit_price = Product::getPriceStatic($type_value['product_id'], true, null, 6, null, false, true, 1);
|
||||
|
||||
if (isset($customer->id)) {
|
||||
$cart_obj = new Cart($order->id_cart);
|
||||
$cart_bk_data = $obj_cart_bk_data->getOnlyCartBookingData($order->id_cart, $cart_obj->id_guest, $type_value['product_id'], $customer->id);
|
||||
$cart_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($order->id, $cart_obj->id_guest, $type_value['product_id'], $customer->id);
|
||||
} else {
|
||||
$cart_bk_data = $obj_cart_bk_data->getOnlyCartBookingData($order->id_cart, $customer->id_guest, $type_value['product_id']);
|
||||
$cart_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($order->id, $customer->id_guest, $type_value['product_id']);
|
||||
}
|
||||
$rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id']);
|
||||
|
||||
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
|
||||
$cart_htl_data[$type_key]['name'] = $product->name;
|
||||
$cart_htl_data[$type_key]['unit_price'] = $unit_price;
|
||||
$cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name'];
|
||||
$cart_htl_data[$type_key]['adult'] = $rm_dtl['adult'];
|
||||
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
|
||||
@@ -1370,16 +1372,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
|
||||
$vart_quant = (int)$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'];
|
||||
|
||||
//$amount = Product::getPriceStatic($type_value['product_id'], true, null, 6, null, false, true, 1);
|
||||
//$amount *= $vart_quant;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
|
||||
|
||||
|
||||
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($type_value['id_product'], $data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $roomTypeDateRangePrice['total_price_tax_incl']*$vart_quant;
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
@@ -1415,12 +1412,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
|
||||
/*$amount = Product::getPriceStatic($type_value['product_id'], true, null, 6, null, false, true, 1);
|
||||
$amount *= $num_days;*/
|
||||
|
||||
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($type_value['id_product'], $data_v['date_from'], $data_v['date_to']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $roomTypeDateRangePrice['total_price_tax_incl'];
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
@@ -1453,6 +1449,10 @@ abstract class PaymentModuleCore extends Module
|
||||
$result['total_extra_demands_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
|
||||
}
|
||||
}
|
||||
// calculate averages now
|
||||
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
|
||||
$value['avg_paid_unit_price_tax_incl'] = Tools::ps_round($value['avg_paid_unit_price_tax_incl'] / $value['num_rm'], 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
$result['cart_htl_data'] = $cart_htl_data;
|
||||
|
||||
@@ -189,7 +189,7 @@ class PrestaShopBackupCore
|
||||
{
|
||||
if (!$this->psBackupAll) {
|
||||
$ignore_insert_table = array(_DB_PREFIX_.'connections', _DB_PREFIX_.'connections_page', _DB_PREFIX_
|
||||
.'connections_source', _DB_PREFIX_.'guest', _DB_PREFIX_.'statssearch');
|
||||
.'connections_source', _DB_PREFIX_.'guest');
|
||||
} else {
|
||||
$ignore_insert_table = array();
|
||||
}
|
||||
|
||||
@@ -588,13 +588,6 @@ class ProductCore extends ObjectModel
|
||||
$id_address = (int)$cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
|
||||
}
|
||||
$address_infos = Address::getCountryAndState($id_address);
|
||||
|
||||
if (self::$_taxCalculationMethod != PS_TAX_EXC
|
||||
&& !empty($address_infos['vat_number'])
|
||||
&& $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY')
|
||||
&& Configuration::get('VATNUMBER_MANAGEMENT')) {
|
||||
self::$_taxCalculationMethod = PS_TAX_EXC;
|
||||
}
|
||||
} else {
|
||||
self::$_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
}
|
||||
@@ -2857,13 +2850,6 @@ class ProductCore extends ObjectModel
|
||||
$usetax = false;
|
||||
}
|
||||
|
||||
if ($usetax != false
|
||||
&& !empty($address_infos['vat_number'])
|
||||
&& $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY')
|
||||
&& Configuration::get('VATNUMBER_MANAGEMENT')) {
|
||||
$usetax = false;
|
||||
}
|
||||
|
||||
if (is_null($id_customer) && Validate::isLoadedObject($context->customer)) {
|
||||
$id_customer = $context->customer->id;
|
||||
}
|
||||
@@ -3750,7 +3736,7 @@ class ProductCore extends ObjectModel
|
||||
* @param string $query Search query
|
||||
* @return array Matching products
|
||||
*/
|
||||
public static function searchByName($id_lang, $query, Context $context = null)
|
||||
public static function searchByName($id_lang, $query, Context $context = null, $id_hotel = false)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
@@ -3765,6 +3751,14 @@ class ProductCore extends ObjectModel
|
||||
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl')
|
||||
);
|
||||
$sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`');
|
||||
if ($id_hotel) {
|
||||
$sql->innerJoin(
|
||||
'htl_room_type',
|
||||
'hrt',
|
||||
'p.`id_product` = hrt.`id_product` AND hrt.`id_hotel` = '.(int)$id_hotel
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$where = 'pl.`name` LIKE \'%'.pSQL($query).'%\'
|
||||
OR p.`ean13` LIKE \'%'.pSQL($query).'%\'
|
||||
@@ -5506,66 +5500,6 @@ class ProductCore extends ObjectModel
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
$cache_id = 'Product::getAttributesParams_'.(int)$id_product.'-'.(int)$id_product_attribute.'-'.(int)$id_lang.'-'.(int)$id_shop;
|
||||
|
||||
// if blocklayered module is installed we check if user has set custom attribute name
|
||||
if (Module::isInstalled('blocklayered') && Module::isEnabled('blocklayered')) {
|
||||
$nb_custom_values = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT la.`id_attribute`, la.`url_name` as `name`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` la
|
||||
ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE la.`url_name` IS NOT NULL AND la.`url_name` != \'\'
|
||||
AND pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute);
|
||||
|
||||
if (!empty($nb_custom_values)) {
|
||||
$tab_id_attribute = array();
|
||||
foreach ($nb_custom_values as $attribute) {
|
||||
$tab_id_attribute[] = $attribute['id_attribute'];
|
||||
|
||||
$group = Db::getInstance()->executeS('
|
||||
SELECT a.`id_attribute`, g.`id_attribute_group`, g.`url_name` as `group`
|
||||
FROM `'._DB_PREFIX_.'layered_indexable_attribute_group_lang_value` g
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)$id_lang.'
|
||||
AND g.`url_name` IS NOT NULL AND g.`url_name` != \'\'');
|
||||
if (empty($group)) {
|
||||
$group = Db::getInstance()->executeS('
|
||||
SELECT g.`id_attribute_group`, g.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute_group_lang` g
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)$id_lang.'
|
||||
AND g.`name` IS NOT NULL');
|
||||
}
|
||||
$result[] = array_merge($attribute, $group[0]);
|
||||
}
|
||||
$values_not_custom = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.id_product_attribute = '.(int)$id_product_attribute.'
|
||||
AND a.`id_attribute` NOT IN('.implode(', ', $tab_id_attribute).')');
|
||||
return array_merge($values_not_custom, $result);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Cache::isStored($cache_id)) {
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT a.`id_attribute`, a.`id_attribute_group`, al.`name`, agl.`name` as `group`
|
||||
@@ -5595,94 +5529,20 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public static function getAttributesInformationsByProduct($id_product)
|
||||
{
|
||||
// if blocklayered module is installed we check if user has set custom attribute name
|
||||
if (Module::isInstalled('blocklayered') && Module::isEnabled('blocklayered')) {
|
||||
$nb_custom_values = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT la.`id_attribute`, la.`url_name` as `attribute`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` la
|
||||
ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE la.`url_name` IS NOT NULL AND la.`url_name` != \'\'
|
||||
AND pa.`id_product` = '.(int)$id_product);
|
||||
|
||||
if (!empty($nb_custom_values)) {
|
||||
$tab_id_attribute = array();
|
||||
foreach ($nb_custom_values as $attribute) {
|
||||
$tab_id_attribute[] = $attribute['id_attribute'];
|
||||
|
||||
$group = Db::getInstance()->executeS('
|
||||
SELECT g.`id_attribute_group`, g.`url_name` as `group`
|
||||
FROM `'._DB_PREFIX_.'layered_indexable_attribute_group_lang_value` g
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND g.`url_name` IS NOT NULL AND g.`url_name` != \'\'');
|
||||
if (empty($group)) {
|
||||
$group = Db::getInstance()->executeS('
|
||||
SELECT g.`id_attribute_group`, g.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute_group_lang` g
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND g.`name` IS NOT NULL');
|
||||
}
|
||||
$result[] = array_merge($attribute, $group[0]);
|
||||
}
|
||||
$values_not_custom = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name` as `attribute`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
'.Shop::addSqlAssociation('attribute', 'pac').'
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND a.`id_attribute` NOT IN('.implode(', ', $tab_id_attribute).')');
|
||||
$result = array_merge($values_not_custom, $result);
|
||||
} else {
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name` as `attribute`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
'.Shop::addSqlAssociation('attribute', 'pac').'
|
||||
WHERE pa.`id_product` = '.(int)$id_product);
|
||||
}
|
||||
} else {
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name` as `attribute`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
'.Shop::addSqlAssociation('attribute', 'pac').'
|
||||
WHERE pa.`id_product` = '.(int)$id_product);
|
||||
}
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name` as `attribute`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
'.Shop::addSqlAssociation('attribute', 'pac').'
|
||||
WHERE pa.`id_product` = '.(int)$id_product);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1579,6 +1579,14 @@ class AdminControllerCore extends Controller
|
||||
|
||||
$this->context->smarty->assign('help_link', 'http://help.prestashop.com/'.Language::getIsoById($this->context->employee->id_lang).'/doc/'
|
||||
.Tools::getValue('controller').'?version='._PS_VERSION_.'&country='.Language::getIsoById($this->context->employee->id_lang));
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'show_page_header_toolbar' => $this->show_page_header_toolbar,
|
||||
'page_header_toolbar_title' => $this->page_header_toolbar_title,
|
||||
'title' => $this->page_header_toolbar_title,
|
||||
'toolbar_btn' => $this->page_header_toolbar_btn,
|
||||
'page_header_toolbar_btn' => $this->page_header_toolbar_btn,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2112,11 +2120,6 @@ class AdminControllerCore extends Controller
|
||||
'content' => $this->content,
|
||||
'lite_display' => $this->lite_display,
|
||||
'url_post' => self::$currentIndex.'&token='.$this->token,
|
||||
'show_page_header_toolbar' => $this->show_page_header_toolbar,
|
||||
'page_header_toolbar_title' => $this->page_header_toolbar_title,
|
||||
'title' => $this->page_header_toolbar_title,
|
||||
'toolbar_btn' => $this->page_header_toolbar_btn,
|
||||
'page_header_toolbar_btn' => $this->page_header_toolbar_btn
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,6 @@ class FrontControllerCore extends Controller
|
||||
'use_taxes' => (int)Configuration::get('PS_TAX'),
|
||||
'show_taxes' => (int)(Configuration::get('PS_TAX_DISPLAY') == 1 && (int)Configuration::get('PS_TAX')),
|
||||
'display_tax_label' => (bool)$display_tax_label,
|
||||
'vat_management' => (int)Configuration::get('VATNUMBER_MANAGEMENT'),
|
||||
'opc' => (bool)Configuration::get('PS_ORDER_PROCESS_TYPE'),
|
||||
'PS_CATALOG_MODE' => (bool)Configuration::get('PS_CATALOG_MODE') || (Group::isFeatureActive() && !(bool)Group::getCurrent()->show_prices),
|
||||
'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE'),
|
||||
@@ -1582,17 +1581,10 @@ class FrontControllerCore extends Controller
|
||||
*/
|
||||
public function setMobileTemplate($template)
|
||||
{
|
||||
// Needed for site map
|
||||
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
|
||||
$blocksupplier = Module::getInstanceByName('blocksupplier');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'categoriesTree' => Category::getRootCategory()->recurseLiteCategTree(0),
|
||||
'categoriescmsTree' => CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1),
|
||||
'voucherAllowed' => (int)CartRule::isFeatureActive(),
|
||||
'display_manufacturer_link' => (bool)$blockmanufacturer->active,
|
||||
'display_supplier_link' => (bool)$blocksupplier->active,
|
||||
'PS_DISPLAY_SUPPLIERS' => Configuration::get('PS_DISPLAY_SUPPLIERS'),
|
||||
'PS_DISPLAY_BEST_SELLERS' => Configuration::get('PS_DISPLAY_BEST_SELLERS'),
|
||||
'display_store' => Configuration::get('PS_STORES_DISPLAY_SITEMAP'),
|
||||
'conditions' => Configuration::get('PS_CONDITIONS'),
|
||||
|
||||
@@ -251,7 +251,6 @@ class HelperFormCore extends Helper
|
||||
'fields' => $this->fields_form,
|
||||
'fields_value' => $this->fields_value,
|
||||
'required_fields' => $this->getFieldsRequired(),
|
||||
'vat_number' => Module::isInstalled('vatnumber') && file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'),
|
||||
'module_dir' => _MODULE_DIR_,
|
||||
'base_url' => $this->context->shop->getBaseURL(),
|
||||
'contains_states' => (isset($this->fields_value['id_country']) && isset($this->fields_value['id_state'])) ? Country::containsStates($this->fields_value['id_country']) : null,
|
||||
|
||||
@@ -38,7 +38,6 @@ class HelperKpiCore extends Helper
|
||||
public $value;
|
||||
public $data;
|
||||
public $source;
|
||||
public $refresh = true;
|
||||
public $href;
|
||||
public $tooltip;
|
||||
|
||||
@@ -56,10 +55,10 @@ class HelperKpiCore extends Helper
|
||||
'value' => $this->value,
|
||||
'data' => $this->data,
|
||||
'source' => $this->source,
|
||||
'refresh' => $this->refresh,
|
||||
'href' => $this->href,
|
||||
'tooltip' => $this->tooltip
|
||||
));
|
||||
|
||||
return $this->tpl->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,15 @@ class HelperKpiRowCore extends Helper
|
||||
public $base_tpl = 'row.tpl';
|
||||
|
||||
public $kpis = array();
|
||||
public $refresh = true;
|
||||
|
||||
public function generate()
|
||||
{
|
||||
$this->tpl = $this->createTemplate($this->base_tpl);
|
||||
|
||||
$this->tpl->assign('kpis', $this->kpis);
|
||||
$this->tpl->assign('refresh', $this->refresh);
|
||||
|
||||
return $this->tpl->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,15 +402,14 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
|
||||
$var_quant = (int)$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $data_v['total_price_tax_excl']*$var_quant;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += $data_v['total_price_tax_excl'];
|
||||
|
||||
// For order refund
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['stage_name'] = $stage_name;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
|
||||
} else {
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
@@ -450,10 +449,11 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $data_v['total_price_tax_excl'];
|
||||
|
||||
// For order refund
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['stage_name'] = $stage_name;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
|
||||
$totalDemandsPriceTE += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
|
||||
$totalDemandsPriceTI += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
|
||||
@@ -471,6 +471,11 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$cart_htl_data[$type_key]['order_detail_tax_label'] = HTMLTemplateInvoice::l('No tax');
|
||||
}
|
||||
}
|
||||
|
||||
// calculate averages now
|
||||
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
|
||||
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
|
||||
}
|
||||
}
|
||||
unset($tax_temp);
|
||||
|
||||
@@ -533,9 +538,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$debug = Tools::getValue('debug');
|
||||
|
||||
$address = new Address((int)$this->order->id_address_tax);
|
||||
$tax_exempt = Configuration::get('VATNUMBER_MANAGEMENT')
|
||||
&& !empty($address->vat_number)
|
||||
&& $address->id_country != Configuration::get('VATNUMBER_COUNTRY');
|
||||
$carrier = new Carrier($this->order->id_carrier);
|
||||
|
||||
// code to send name of the taxes applied on the order to show names od taxes in the invoice for GST
|
||||
@@ -560,7 +562,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
|
||||
$data = array(
|
||||
'showTaxName' => $showTaxName,
|
||||
'tax_exempt' => $tax_exempt,
|
||||
'use_one_after_another_method' => $this->order_invoice->useOneAfterAnotherTaxComputationMethod(),
|
||||
'display_tax_bases_in_breakdowns' => $this->order_invoice->displayTaxBasesInProductTaxesBreakdown(),
|
||||
'product_tax_breakdown' => $this->order_invoice->getProductTaxesBreakdown($this->order),
|
||||
|
||||
@@ -199,12 +199,7 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
public function getTaxTabContent()
|
||||
{
|
||||
$address = new Address((int)$this->order->id_address_tax);
|
||||
$tax_exempt = Configuration::get('VATNUMBER_MANAGEMENT')
|
||||
&& !empty($address->vat_number)
|
||||
&& $address->id_country != Configuration::get('VATNUMBER_COUNTRY');
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'tax_exempt' => $tax_exempt,
|
||||
'product_tax_breakdown' => $this->getProductTaxesBreakdown(),
|
||||
'shipping_tax_breakdown' => $this->getShippingTaxesBreakdown(),
|
||||
'order' => $this->order,
|
||||
|
||||
@@ -183,7 +183,7 @@ class WebserviceRequestCore
|
||||
public static $ws_current_classname;
|
||||
|
||||
|
||||
public static $shopIDs;
|
||||
public static $shopIDs = array();
|
||||
|
||||
|
||||
public function getOutputEnabled()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/* Debug only */
|
||||
if (!defined('_PS_MODE_DEV_')) {
|
||||
define('_PS_MODE_DEV_', false);
|
||||
define('_PS_MODE_DEV_', false);
|
||||
}
|
||||
/* Compatibility warning */
|
||||
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<modules_list>
|
||||
<modules type="native">
|
||||
<module name="hotelreservationsystem"/>
|
||||
<module name="wkabouthotelblock"/>
|
||||
<module name="wkfooteraboutblock"/>
|
||||
<module name="wkfooterexploreblock"/>
|
||||
<module name="wkfooterlangcurrencyblock"/>
|
||||
<module name="wkfooternotificationblock"/>
|
||||
<module name="wkfooterpaymentblock"/>
|
||||
<module name="wkfooterpaymentinfoblockcontainer"/>
|
||||
<module name="wkhotelfeaturesblock"/>
|
||||
<module name="wkhotelfilterblock"/>
|
||||
<module name="wkhotelfiltersearchblock"/>
|
||||
<module name="wkhotelroom"/>
|
||||
<module name="wkroomsearchblock"/>
|
||||
<module name="wktestimonialblock"/>
|
||||
</modules>
|
||||
</modules_list>
|
||||
@@ -50,8 +50,8 @@
|
||||
<modules>
|
||||
<module action="enable" name="blocknewsletter"/>
|
||||
<module action="enable" name="blocksocial"/>
|
||||
<module action="enable" name="socialsharing"/>
|
||||
<module action="enable" name="blockmyaccount"/>
|
||||
<module action="enable" name="qloblockcontact"/>
|
||||
<module action="enable" name="blocklanguages"/>
|
||||
<module action="enable" name="blockcurrencies"/>
|
||||
<module action="enable" name="productcomments"/>
|
||||
@@ -62,43 +62,6 @@
|
||||
<module action="enable" name="statsdata"/>
|
||||
<module action="enable" name="blockcart"/>
|
||||
<module action="enable" name="blockuserinfo"/>
|
||||
<module action="disable" name="blockadvertising"/>
|
||||
<module action="disable" name="blockbanner"/>
|
||||
<module action="disable" name="blockbestsellers"/>
|
||||
<module action="disable" name="blockcategories"/>
|
||||
<module action="disable" name="blockcms"/>
|
||||
<module action="disable" name="blockcmsinfo"/>
|
||||
<module action="disable" name="blockcontact"/>
|
||||
<module action="disable" name="blockcontactinfos"/>
|
||||
<module action="disable" name="blockcustomerprivacy"/>
|
||||
<module action="disable" name="blockfacebook"/>
|
||||
<module action="disable" name="blocklayered"/>
|
||||
<module action="disable" name="blocklink"/>
|
||||
<module action="disable" name="blockmanufacturer"/>
|
||||
<module action="disable" name="blockmyaccountfooter"/>
|
||||
<module action="disable" name="blocknewproducts"/>
|
||||
<module action="disable" name="blockpaymentlogo"/>
|
||||
<module action="disable" name="blockpermanentlinks"/>
|
||||
<module action="disable" name="blockrss"/>
|
||||
<module action="disable" name="blocksearch"/>
|
||||
<module action="disable" name="blocksharefb"/>
|
||||
<module action="disable" name="blockspecials"/>
|
||||
<module action="disable" name="blockstore"/>
|
||||
<module action="disable" name="blocksupplier"/>
|
||||
<module action="disable" name="blocktags"/>
|
||||
<module action="disable" name="blocktopmenu"/>
|
||||
<module action="disable" name="blockviewed"/>
|
||||
<module action="disable" name="blockwishlist"/>
|
||||
<module action="disable" name="crossselling"/>
|
||||
<module action="disable" name="homefeatured"/>
|
||||
<module action="disable" name="homeslider"/>
|
||||
<module action="disable" name="productpaymentlogos"/>
|
||||
<module action="disable" name="productscategory"/>
|
||||
<module action="disable" name="producttooltip"/>
|
||||
<module action="disable" name="pscleaner"/>
|
||||
<module action="disable" name="sendtoafriend"/>
|
||||
<module action="disable" name="trackingfront"/>
|
||||
<module action="disable" name="vatnumber"/>
|
||||
<hooks>
|
||||
<hook module="hotelreservationsystem" hook="actionValidateOrder" position="1"/>
|
||||
<hook module="hotelreservationsystem" hook="Header" position="1"/>
|
||||
@@ -149,8 +112,8 @@
|
||||
<hook module="wkfooterlangcurrencyblock" hook="displayFooter" position="3"/>
|
||||
<hook module="wkfooterpaymentinfoblockcontainer" hook="displayFooter" position="4"/>
|
||||
<hook module="wkfooteraboutblock" hook="displayFooterMostLeftBlock" position="3"/>
|
||||
<hook module="wkfooteraboutblock" hook="displayFooterPaymentInfo" position="1"/>
|
||||
<hook module="wkfooterpaymentblock" hook="displayFooterPaymentInfo" position="2"/>
|
||||
<hook module="wkfooterpaymentblock" hook="displayAddModuleSettingLink" position="6"/>
|
||||
<hook module="wkfooterpaymentblock" hook="displayFooterPaymentInfo" position="1"/>
|
||||
<hook module="wkfooternotificationblock" hook="displayFooter" position="5"/>
|
||||
<hook module="blocknavigationmenu" hook="displayTop" position="2"/>
|
||||
<hook module="blocknavigationmenu" hook="displayFooter" position="6"/>
|
||||
@@ -166,20 +129,10 @@
|
||||
<hook module="blocknewsletter" hook="actionDeleteGDPRCustomer" position="1"/>
|
||||
<hook module="blocksocial" hook="Header" position="4"/>
|
||||
<hook module="blocksocial" hook="displayFooterNotificationHook" position="2"/>
|
||||
<hook module="socialsharing" hook="Header" position="6"/>
|
||||
<hook module="socialsharing" hook="displayRightColumnProduct" position="1"/>
|
||||
<hook module="socialsharing" hook="actionObjectProductUpdateAfter" position="1"/>
|
||||
<hook module="socialsharing" hook="actionObjectProductDeleteAfter" position="1"/>
|
||||
<hook module="socialsharing" hook="displayCompareExtraInformation" position="1"/>
|
||||
<hook module="socialsharing" hook="displaySocialSharing" position="1"/>
|
||||
<hook module="blockmyaccount" hook="displayLeftColumn" position="3" exceptions="category"/>
|
||||
<hook module="blockmyaccount" hook="Header" position="8"/>
|
||||
<hook module="blockmyaccount" hook="actionModuleRegisterHookAfter" position="1"/>
|
||||
<hook module="blockmyaccount" hook="actionModuleUnRegisterHookAfter" position="1"/>
|
||||
<hook module="blocklanguages" hook="Header" position="9"/>
|
||||
<hook module="blocklanguages" hook="displayFooterMostLeftBlock" position="1"/>
|
||||
<hook module="blockcurrencies" hook="Header" position="10"/>
|
||||
<hook module="blockcurrencies" hook="displayFooterMostLeftBlock" position="2"/>
|
||||
<hook module="productcomments" hook="Header" position="11"/>
|
||||
<hook module="productcomments" hook="displayRightColumnProduct" position="2"/>
|
||||
<hook module="productcomments" hook="displayProductTab" position="1"/>
|
||||
@@ -214,6 +167,12 @@
|
||||
<hook module="blockuserinfo" hook="Header" position="13"/>
|
||||
<hook module="blockuserinfo" hook="displayTop" position="6"/>
|
||||
<hook module="blockuserinfo" hook="displayExternalNavigationHook" position="1"/>
|
||||
<hook module="blockcurrencies" hook="displayNav" position="1"/>
|
||||
<hook module="blockcurrencies" hook="displayExternalNavigationHook" position="2"/>
|
||||
<hook module="blocklanguages" hook="displayNav" position="2"/>
|
||||
<hook module="blocklanguages" hook="displayExternalNavigationHook" position="3"/>
|
||||
<hook module="qloblockcontact" hook="displayNav" position="3"/>
|
||||
<hook module="qloblockcontact" hook="displayExternalNavigationHook" position="4"/>
|
||||
</hooks>
|
||||
</modules>
|
||||
<images>
|
||||
|
||||
@@ -36,7 +36,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->required_database = true;
|
||||
$this->required_fields = array('company','address2', 'postcode', 'other', 'phone', 'phone_mobile', 'vat_number', 'dni');
|
||||
$this->required_fields = array('company', 'address2', 'postcode', 'other', 'phone', 'phone_mobile', 'dni');
|
||||
$this->table = 'address';
|
||||
$this->className = 'Address';
|
||||
$this->lang = false;
|
||||
@@ -217,13 +217,6 @@ class AdminAddressesControllerCore extends AdminController
|
||||
'col' => '4',
|
||||
'hint' => $this->l('Invalid characters:').' <>;=#{}'
|
||||
);
|
||||
$temp_fields[] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('VAT number'),
|
||||
'col' => '2',
|
||||
'name' => 'vat_number',
|
||||
'required' => in_array('vat_number', $required_fields)
|
||||
);
|
||||
} elseif ($addr_field_item == 'lastname') {
|
||||
if (isset($customer) &&
|
||||
!Tools::isSubmit('submit'.strtoupper($this->table)) &&
|
||||
|
||||
@@ -61,7 +61,7 @@ class AdminBackupControllerCore extends AdminController
|
||||
'title' => $this->l('Ignore statistics tables'),
|
||||
'desc' => $this->l('Drop existing tables during import.').'
|
||||
<br />'._DB_PREFIX_.'connections, '._DB_PREFIX_.'connections_page, '._DB_PREFIX_
|
||||
.'connections_source, '._DB_PREFIX_.'guest, '._DB_PREFIX_.'statssearch',
|
||||
.'connections_source, '._DB_PREFIX_.'guest',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
|
||||
@@ -43,17 +43,19 @@ class AdminCartsControllerCore extends AdminController
|
||||
$this->_orderWay = 'DESC';
|
||||
$this->context = Context::getContext();
|
||||
|
||||
$this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) `customer`, a.id_cart total,
|
||||
IF (IFNULL(o.id_order, \''.$this->l('Non ordered').'\') = \''.$this->l('Non ordered').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered').'\'), o.id_order) AS status, IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
|
||||
$this->_select = 'CONCAT(c.`firstname`, \' \', c.`lastname`) `customer`, a.id_cart total,
|
||||
TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) AS `time_diff`,
|
||||
IFNULL(GROUP_CONCAT(o.`id_order`), 0) AS `ids_order`,
|
||||
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(o.`id_order`)) AS filter_ids_order,
|
||||
IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
|
||||
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
|
||||
LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency)
|
||||
LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_cart = a.id_cart)
|
||||
LEFT JOIN `'._DB_PREFIX_.'connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', co.`date_add`)) < 1800)';
|
||||
$this->_group = ' GROUP BY a.`id_cart`';
|
||||
|
||||
if (Tools::getValue('action') && Tools::getValue('action') == 'filterOnlyAbandonedCarts') {
|
||||
$this->_having = 'status = \''.$this->l('Abandoned cart').'\'';
|
||||
} else {
|
||||
$this->_use_found_rows = false;
|
||||
if (Tools::getValue('action') == 'filterAbandonedCarts') {
|
||||
$this->_filterHaving = ' AND `ids_order` = 0 AND `time_diff` > 86400';
|
||||
}
|
||||
|
||||
$this->fields_list = array(
|
||||
@@ -62,11 +64,12 @@ class AdminCartsControllerCore extends AdminController
|
||||
'align' => 'text-center',
|
||||
'class' => 'fixed-width-xs'
|
||||
),
|
||||
'status' => array(
|
||||
'ids_order' => array(
|
||||
'title' => $this->l('Order ID'),
|
||||
'align' => 'text-center',
|
||||
'badge_danger' => true,
|
||||
'havingFilter' => true
|
||||
'havingFilter' => true,
|
||||
'filter_key' => 'filter_ids_order',
|
||||
'callback' => 'getOrderColumn',
|
||||
),
|
||||
'customer' => array(
|
||||
'title' => $this->l('Customer'),
|
||||
@@ -114,6 +117,29 @@ class AdminCartsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->list_no_link = true;
|
||||
}
|
||||
|
||||
public function getOrderColumn($idsOrder, $tr)
|
||||
{
|
||||
$smartyVars = array();
|
||||
if ($idsOrder) {
|
||||
$idsOrder = explode(',', $idsOrder);
|
||||
$smartyVars['type'] = 'orders';
|
||||
$smartyVars['ids_order'] = $idsOrder;
|
||||
} else {
|
||||
if ($tr['time_diff'] > 86400) {
|
||||
$smartyVars['type'] = 'abandoned';
|
||||
} else {
|
||||
$smartyVars['type'] = 'non_orderd';
|
||||
}
|
||||
}
|
||||
|
||||
$tpl = $this->createTemplate('_orders.tpl');
|
||||
$tpl->assign($smartyVars);
|
||||
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
@@ -134,7 +160,6 @@ class AdminCartsControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-conversion-rate';
|
||||
$helper->icon = 'icon-sort-by-attributes-alt';
|
||||
@@ -142,14 +167,10 @@ class AdminCartsControllerCore extends AdminController
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Conversion Rate', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('CONVERSION_RATE') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('CONVERSION_RATE');
|
||||
}
|
||||
if (ConfigurationKPI::get('CONVERSION_RATE_CHART') !== false) {
|
||||
$helper->data = ConfigurationKPI::get('CONVERSION_RATE_CHART');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=conversion_rate';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('CONVERSION_RATE_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -161,11 +182,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$date_to = date(Context::getContext()->language->date_format_lite, strtotime('-1 day'));
|
||||
$helper->subtitle = sprintf($this->l('From %s to %s', null, null, false), $date_from, $date_to);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts';
|
||||
if (ConfigurationKPI::get('ABANDONED_CARTS') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('ABANDONED_CARTS');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('ABANDONED_CARTS_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -174,12 +191,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Average Order Value', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('AVG_ORDER_VALUE') !== false) {
|
||||
$helper->value = sprintf($this->l('%s tax excl.'), ConfigurationKPI::get('AVG_ORDER_VALUE'));
|
||||
}
|
||||
if (ConfigurationKPI::get('AVG_ORDER_VALUE_EXPIRE') < $time) {
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=average_order_value';
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=average_order_value';
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -188,11 +200,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Net Profit per Visitor', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('NETPROFIT_VISIT') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('NETPROFIT_VISIT');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=netprofit_visit';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('NETPROFIT_VISIT_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
@@ -218,12 +226,14 @@ class AdminCartsControllerCore extends AdminController
|
||||
Product::addCustomizationPrice($products, $customized_datas);
|
||||
$summary = $cart->getSummaryDetails();
|
||||
|
||||
/* Display order information */
|
||||
$id_order = (int)Order::getOrderByCartId($cart->id);
|
||||
$order = new Order($id_order);
|
||||
if (Validate::isLoadedObject($order)) {
|
||||
$tax_calculation_method = $order->getTaxCalculationMethod();
|
||||
$id_shop = (int)$order->id_shop;
|
||||
/* Display orders information */
|
||||
$cartOrders = Order::getAllOrdersByCartId($cart->id);
|
||||
if ($cartOrders) {
|
||||
$objOrder = new Order($cartOrders[0]['id_order']);
|
||||
if (Validate::isLoadedObject($objOrder)) {
|
||||
$tax_calculation_method = $objOrder->getTaxCalculationMethod();
|
||||
$id_shop = (int)$objOrder->id_shop;
|
||||
}
|
||||
} else {
|
||||
$id_shop = (int)$cart->id_shop;
|
||||
$tax_calculation_method = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
@@ -304,7 +314,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
'kpi' => $kpi,
|
||||
'products' => $products,
|
||||
'discounts' => $cart->getCartRules(),
|
||||
'order' => $order,
|
||||
'cart_orders' => $cartOrders,
|
||||
'cart' => $cart,
|
||||
'currency' => $currency,
|
||||
'customer' => $customer,
|
||||
@@ -884,26 +894,60 @@ class AdminCartsControllerCore extends AdminController
|
||||
|
||||
public function ajaxProcessUpdateProductPrice()
|
||||
{
|
||||
$params = Tools::getValue('params');
|
||||
$id_booking_data = (int) $params['id_booking_data'];
|
||||
$id_cart = (int) $params['id_cart'];
|
||||
$id_product = (int) $params['id_product'];
|
||||
$id_room = (int) $params['id_room'];
|
||||
$date_from = $params['date_from'];
|
||||
$date_to = $params['date_to'];
|
||||
$price = (float) $params['price'];
|
||||
|
||||
$this->context->cart = new Cart($id_cart);
|
||||
|
||||
$date_from = date('Y-m-d', strtotime($date_from));
|
||||
$date_to = date('Y-m-d', strtotime($date_to));
|
||||
|
||||
if ($this->tabAccess['edit'] === '1') {
|
||||
SpecificPrice::deleteByIdCart((int)$this->context->cart->id, (int)Tools::getValue('id_product'), (int)Tools::getValue('id_product_attribute'));
|
||||
$specific_price = new SpecificPrice();
|
||||
$specific_price->id_cart = (int)$this->context->cart->id;
|
||||
$specific_price->id_shop = 0;
|
||||
$specific_price->id_shop_group = 0;
|
||||
$specific_price->id_currency = 0;
|
||||
$specific_price->id_country = 0;
|
||||
$specific_price->id_group = 0;
|
||||
$specific_price->id_customer = (int)$this->context->customer->id;
|
||||
$specific_price->id_product = (int)Tools::getValue('id_product');
|
||||
$specific_price->id_product_attribute = (int)Tools::getValue('id_product_attribute');
|
||||
$specific_price->price = (float)Tools::getValue('price');
|
||||
$specific_price->from_quantity = 1;
|
||||
$specific_price->reduction = 0;
|
||||
$specific_price->reduction_type = 'amount';
|
||||
$specific_price->from = '0000-00-00 00:00:00';
|
||||
$specific_price->to = '0000-00-00 00:00:00';
|
||||
$specific_price->add();
|
||||
echo json_encode($this->ajaxReturnVars());
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart, $id_product, $id_room, $date_from, $date_to);
|
||||
$feature_price_name = array();
|
||||
foreach (Language::getIDs(true) as $id_lang) {
|
||||
$feature_price_name[$id_lang] = 'Auto-generated';
|
||||
}
|
||||
|
||||
$hrt_feature_price = new HotelRoomTypeFeaturePricing();
|
||||
$hrt_feature_price->id_product = $id_product;
|
||||
$hrt_feature_price->id_cart = $id_cart;
|
||||
$hrt_feature_price->id_guest = (int) $this->context->cookie->id_guest;
|
||||
$hrt_feature_price->id_room = $id_room;
|
||||
$hrt_feature_price->feature_price_name = $feature_price_name;
|
||||
$hrt_feature_price->date_selection_type = HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE;
|
||||
$hrt_feature_price->date_from = $date_from;
|
||||
$hrt_feature_price->date_to = $date_to;
|
||||
$hrt_feature_price->is_special_days_exists = 0;
|
||||
$hrt_feature_price->special_days = json_encode(false);
|
||||
$hrt_feature_price->impact_way = HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE;
|
||||
$hrt_feature_price->impact_type = HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE;
|
||||
$hrt_feature_price->impact_value = $price;
|
||||
$hrt_feature_price->active = 1;
|
||||
$hrt_feature_price->groupBox = array_column(Group::getGroups($this->context->language->id), 'id_group');
|
||||
$hrt_feature_price->add();
|
||||
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$bookingsInfo = $objHotelCartBookingData->getCartFormatedBookinInfoByIdCart($id_cart);
|
||||
foreach ($bookingsInfo as &$bookingInfo) {
|
||||
if ($bookingInfo['id'] == $id_booking_data) {
|
||||
$amt_with_qty = $bookingInfo['amt_with_qty'];
|
||||
$bookingInfo['amt_with_qty'] = Tools::displayPrice($amt_with_qty);
|
||||
$bookingInfo['total_price'] = Tools::displayPrice($amt_with_qty + $bookingInfo['demand_price']);
|
||||
$response = array(
|
||||
'curr_booking_info' => $bookingInfo,
|
||||
'cart_info' => $this->ajaxReturnVars(),
|
||||
);
|
||||
|
||||
die(json_encode($response));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -957,7 +1001,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$skip_list = array();
|
||||
|
||||
foreach ($this->_list as $row) {
|
||||
if (isset($row['id_order']) && is_numeric($row['id_order'])) {
|
||||
if (isset($row['ids_order']) && $row['ids_order'] != '0') {
|
||||
$skip_list[] = $row['id_cart'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,18 +373,12 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-disabled-categories';
|
||||
$helper->icon = 'icon-off';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Disabled Categories', null, null, false);
|
||||
if (ConfigurationKPI::get('DISABLED_CATEGORIES') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('DISABLED_CATEGORIES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=disabled_categories';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('DISABLED_CATEGORIES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -393,11 +387,7 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
$helper->color = 'color2';
|
||||
$helper->href = $this->context->link->getAdminLink('AdminTracking');
|
||||
$helper->title = $this->l('Empty Categories', null, null, false);
|
||||
if (ConfigurationKPI::get('EMPTY_CATEGORIES') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('EMPTY_CATEGORIES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=empty_categories';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('EMPTY_CATEGORIES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -406,11 +396,7 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Top Category', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('TOP_CATEGORY', $this->context->employee->id_lang) !== false) {
|
||||
$helper->value = ConfigurationKPI::get('TOP_CATEGORY', $this->context->employee->id_lang);
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=top_category';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('TOP_CATEGORY_EXPIRE', $this->context->employee->id_lang) < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -418,11 +404,7 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
$helper->icon = 'icon-search';
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Average number of products per category', null, null, false);
|
||||
if (ConfigurationKPI::get('PRODUCTS_PER_CATEGORY') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('PRODUCTS_PER_CATEGORY');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=products_per_category';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('PRODUCTS_PER_CATEGORY_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
|
||||
@@ -459,7 +459,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
if (isset($_GET['filename']) && (bool)Tools::file_get_contents($context->link->getMediaLink(_THEME_PROD_PIC_DIR_.$_GET['filename'])) && Validate::isFileName($_GET['filename'])) { // by webkul
|
||||
if (isset($_GET['filename']) && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_THEME_PROD_PIC_DIR_.$_GET['filename'])) && Validate::isFileName($_GET['filename'])) { // by webkul
|
||||
AdminCustomerThreadsController::openUploadedFile();
|
||||
}
|
||||
|
||||
@@ -509,18 +509,12 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-pending-messages';
|
||||
$helper->icon = 'icon-envelope';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Pending Discussion Threads', null, null, false);
|
||||
if (ConfigurationKPI::get('PENDING_MESSAGES') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('PENDING_MESSAGES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=pending_messages';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('PENDING_MESSAGES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -529,11 +523,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Average Response Time', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=avg_msg_response_time';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -542,11 +532,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Messages per Thread', null, null, false);
|
||||
$helper->subtitle = $this->l('30 day', null, null, false);
|
||||
if (ConfigurationKPI::get('MESSAGES_PER_THREAD') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('MESSAGES_PER_THREAD');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=messages_per_thread';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('MESSAGES_PER_THREAD_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
@@ -560,7 +546,6 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
return;
|
||||
}
|
||||
|
||||
$this->context = Context::getContext();
|
||||
if (!($thread = $this->loadObject())) {
|
||||
return;
|
||||
}
|
||||
@@ -800,7 +785,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
'thread_url' => Tools::getAdminUrl(basename(_PS_ADMIN_DIR_).'/'.
|
||||
$this->context->link->getAdminLink('AdminCustomerThreads').'&id_customer_thread='
|
||||
.(int)$message['id_customer_thread'].'&viewcustomer_thread=1'),
|
||||
'link' => Context::getContext()->link,
|
||||
'link' => $this->context->link,
|
||||
'current' => self::$currentIndex,
|
||||
'token' => $this->token,
|
||||
'message' => $message,
|
||||
@@ -808,7 +793,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
'email' => $email,
|
||||
'id_employee' => $id_employee,
|
||||
'PS_SHOP_NAME' => Configuration::get('PS_SHOP_NAME'),
|
||||
'file_name' => (bool)Tools::file_get_contents($context->link->getMediaLink(_THEME_PROD_PIC_DIR_.$message['file_name'])), // by webkul
|
||||
'file_name' => (bool)Tools::file_get_contents($this->context->link->getMediaLink(_THEME_PROD_PIC_DIR_.$message['file_name'])), // by webkul
|
||||
'contacts' => $contacts,
|
||||
'is_valid_order_id' => $is_valid_order_id
|
||||
));
|
||||
|
||||
@@ -643,19 +643,13 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-gender';
|
||||
$helper->icon = 'icon-male';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Customers', null, null, false);
|
||||
$helper->subtitle = $this->l('All Time', null, null, false);
|
||||
if (ConfigurationKPI::get('CUSTOMER_MAIN_GENDER', $this->context->language->id) !== false) {
|
||||
$helper->value = ConfigurationKPI::get('CUSTOMER_MAIN_GENDER', $this->context->language->id);
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=customer_main_gender';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('CUSTOMER_MAIN_GENDER_EXPIRE', $this->context->language->id) < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -664,11 +658,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Average Age', 'AdminTab', null, false);
|
||||
$helper->subtitle = $this->l('All Time', null, null, false);
|
||||
if (ConfigurationKPI::get('AVG_CUSTOMER_AGE', $this->context->language->id) !== false) {
|
||||
$helper->value = ConfigurationKPI::get('AVG_CUSTOMER_AGE', $this->context->language->id);
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=avg_customer_age';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('AVG_CUSTOMER_AGE_EXPIRE', $this->context->language->id) < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -677,11 +667,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Orders per Customer', null, null, false);
|
||||
$helper->subtitle = $this->l('All Time', null, null, false);
|
||||
if (ConfigurationKPI::get('ORDERS_PER_CUSTOMER') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('ORDERS_PER_CUSTOMER');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=orders_per_customer';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('ORDERS_PER_CUSTOMER_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -690,11 +676,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Newsletter Registrations', null, null, false);
|
||||
$helper->subtitle = $this->l('All Time', null, null, false);
|
||||
if (ConfigurationKPI::get('NEWSLETTER_REGISTRATIONS') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('NEWSLETTER_REGISTRATIONS');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=newsletter_registrations';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('NEWSLETTER_REGISTRATIONS_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
|
||||
@@ -235,6 +235,11 @@ class AdminDashboardControllerCore extends AdminController
|
||||
$calendar_helper->setCompareDateTo($stats_compare_to);
|
||||
$calendar_helper->setCompareOption(Tools::getValue('compare_date_option', $this->context->employee->stats_compare_option));
|
||||
|
||||
Media::addJsDef(array(
|
||||
'date_subtitle' => $this->l('(from %s to %s)'),
|
||||
'date_format' => $this->context->language->date_format_lite,
|
||||
));
|
||||
|
||||
$params = array(
|
||||
'date_from' => $this->context->employee->stats_date_from,
|
||||
'date_to' => $this->context->employee->stats_date_to,
|
||||
@@ -270,7 +275,7 @@ class AdminDashboardControllerCore extends AdminController
|
||||
'PS_DASHBOARD_SIMULATION' => Configuration::get('PS_DASHBOARD_SIMULATION'),
|
||||
'datepickerFrom' => Tools::getValue('datepickerFrom', $this->context->employee->stats_date_from),
|
||||
'datepickerTo' => Tools::getValue('datepickerTo', $this->context->employee->stats_date_to),
|
||||
'preselect_date_range' => Tools::getValue('preselectDateRange', $this->context->employee->preselect_date_range)
|
||||
'preselect_date_range' => Tools::getValue('preselectDateRange', $this->context->employee->preselect_date_range),
|
||||
);
|
||||
return parent::renderView();
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class AdminLogsControllerCore extends AdminController
|
||||
)
|
||||
);
|
||||
$this->list_no_link = true;
|
||||
$this->_select .= 'CONCAT(LEFT(e.firstname, 1), \'. \', e.lastname) employee';
|
||||
$this->_select .= 'CONCAT(e.firstname, \' \', e.lastname) employee';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'employee e ON (a.id_employee = e.id_employee)';
|
||||
$this->_use_found_rows = false;
|
||||
parent::__construct();
|
||||
@@ -124,8 +124,8 @@ class AdminLogsControllerCore extends AdminController
|
||||
$template = $this->context->smarty->createTemplate('controllers/logs/employee_field.tpl', $this->context->smarty);
|
||||
$employee = new Employee((int)$tr['id_employee']);
|
||||
$template->assign(array(
|
||||
'employee_image' => $employee->getImage(),
|
||||
'employee_name' => $value
|
||||
'employee_name' => $value,
|
||||
'employee_email' => $employee->email,
|
||||
));
|
||||
return $template->fetch();
|
||||
}
|
||||
|
||||
@@ -741,7 +741,6 @@ class AdminMetaControllerCore extends AdminController
|
||||
{
|
||||
$this->addFieldRoute('product_rule', $this->l('Route to products'));
|
||||
$this->addFieldRoute('category_rule', $this->l('Route to category'));
|
||||
$this->addFieldRoute('layered_rule', $this->l('Route to category which has the "selected_filter" attribute for the "Layered Navigation" (blocklayered) module'));
|
||||
$this->addFieldRoute('supplier_rule', $this->l('Route to supplier'));
|
||||
$this->addFieldRoute('manufacturer_rule', $this->l('Route to manufacturer'));
|
||||
$this->addFieldRoute('cms_rule', $this->l('Route to CMS page'));
|
||||
|
||||
@@ -29,7 +29,6 @@ class AdminModulesControllerCore extends AdminController
|
||||
private $_modules_ad = array(
|
||||
'blockcart' => array('cartabandonmentpro'),
|
||||
/* 'bloctopmenu' => array('advancedtopmenu'), */
|
||||
'blocklayered' => array('pm_advancedsearch4')
|
||||
);
|
||||
/*
|
||||
** @var array map with $_GET keywords and their callback
|
||||
@@ -1301,18 +1300,12 @@ class AdminModulesControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-installed-modules';
|
||||
$helper->icon = 'icon-puzzle-piece';
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Installed Modules', null, null, false);
|
||||
if (ConfigurationKPI::get('INSTALLED_MODULES') !== false && ConfigurationKPI::get('INSTALLED_MODULES') != '') {
|
||||
$helper->value = ConfigurationKPI::get('INSTALLED_MODULES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=installed_modules';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('INSTALLED_MODULES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -1320,11 +1313,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
$helper->icon = 'icon-off';
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Disabled Modules', null, null, false);
|
||||
if (ConfigurationKPI::get('DISABLED_MODULES') !== false && ConfigurationKPI::get('DISABLED_MODULES') != '') {
|
||||
$helper->value = ConfigurationKPI::get('DISABLED_MODULES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=disabled_modules';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('DISABLED_MODULES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -1332,11 +1321,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
$helper->icon = 'icon-refresh';
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Modules to Update', null, null, false);
|
||||
if (ConfigurationKPI::get('UPDATE_MODULES') !== false && ConfigurationKPI::get('UPDATE_MODULES') != '') {
|
||||
$helper->value = ConfigurationKPI::get('UPDATE_MODULES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=update_modules';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('UPDATE_MODULES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
@@ -1585,8 +1570,6 @@ class AdminModulesControllerCore extends AdminController
|
||||
$this->confirmations[] = sprintf($this->l('The following module(s) were upgraded successfully: %s.'), $html);
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('UPDATE_MODULES', count($upgrade_available));
|
||||
|
||||
if (count($upgrade_available) == 0 && (int)Tools::getValue('check') == 1) {
|
||||
$this->confirmations[] = $this->l('Everything is up-to-date');
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'remove_onclick' => true
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
$this->shopLinkType = 'shop';
|
||||
$this->shopShareDatas = Shop::SHARE_ORDER;
|
||||
|
||||
@@ -321,7 +321,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
$this->addJqueryUI('ui.datepicker');
|
||||
$this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js');
|
||||
|
||||
|
||||
if ($this->tabAccess['edit'] == 1 && $this->display == 'view') {
|
||||
$this->addJS(_PS_JS_DIR_.'admin/orders.js');
|
||||
$this->addJS(_PS_JS_DIR_.'tools.js');
|
||||
@@ -1244,8 +1244,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-conversion-rate';
|
||||
$helper->icon = 'icon-sort-by-attributes-alt';
|
||||
@@ -1253,14 +1251,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Conversion Rate', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('CONVERSION_RATE') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('CONVERSION_RATE');
|
||||
}
|
||||
if (ConfigurationKPI::get('CONVERSION_RATE_CHART') !== false) {
|
||||
$helper->data = ConfigurationKPI::get('CONVERSION_RATE_CHART');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=conversion_rate';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('CONVERSION_RATE_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -1270,11 +1264,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->title = $this->l('Abandoned Carts', null, null, false);
|
||||
$helper->subtitle = $this->l('Today', null, null, false);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts';
|
||||
if (ConfigurationKPI::get('ABANDONED_CARTS') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('ABANDONED_CARTS');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('ABANDONED_CARTS_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -1283,11 +1273,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Average Order Value', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('AVG_ORDER_VALUE') !== false) {
|
||||
$helper->value = sprintf($this->l('%s tax excl.'), ConfigurationKPI::get('AVG_ORDER_VALUE'));
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=average_order_value';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('AVG_ORDER_VALUE_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -1296,11 +1282,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Net Profit per Visit', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('NETPROFIT_VISIT') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('NETPROFIT_VISIT');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=netprofit_visit';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('NETPROFIT_VISIT_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpiRow();
|
||||
@@ -1607,78 +1589,85 @@ class AdminOrdersControllerCore extends AdminController
|
||||
{
|
||||
Context::getContext()->customer = new Customer((int)Tools::getValue('id_customer'));
|
||||
$currency = new Currency((int)Tools::getValue('id_currency'));
|
||||
if ($products = Product::searchByName((int)$this->context->language->id, pSQL(Tools::getValue('product_search')))) {
|
||||
foreach ($products as &$product) {
|
||||
// Formatted price
|
||||
$product['formatted_price'] = Tools::displayPrice(Tools::convertPrice($product['price_tax_incl'], $currency), $currency);
|
||||
// Concret price
|
||||
$product['price_tax_incl'] = Tools::ps_round(Tools::convertPrice($product['price_tax_incl'], $currency), 2);
|
||||
$product['price_tax_excl'] = Tools::ps_round(Tools::convertPrice($product['price_tax_excl'], $currency), 2);
|
||||
$productObj = new Product((int)$product['id_product'], false, (int)$this->context->language->id);
|
||||
$combinations = array();
|
||||
$attributes = $productObj->getAttributesGroups((int)$this->context->language->id);
|
||||
$to_return = array('found' => false);
|
||||
if (Validate::isLoadedObject($order = new Order(Tools::getValue('id_order')))) {
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$hotelBookingDetail = $objBookingDetail->getOrderCurrentDataByOrderId($order->id);
|
||||
if (count($hotelBookingDetail)) {
|
||||
$idHotel = reset($hotelBookingDetail)['id_hotel'];
|
||||
} else {
|
||||
$idHotel = false;
|
||||
}
|
||||
|
||||
// Tax rate for this customer
|
||||
if (Tools::isSubmit('id_address')) {
|
||||
$product['tax_rate'] = $productObj->getTaxesRate(new Address(Tools::getValue('id_address')));
|
||||
}
|
||||
if ($products = Product::searchByName((int)$this->context->language->id, pSQL(Tools::getValue('product_search')), null, $idHotel)) {
|
||||
foreach ($products as &$product) {
|
||||
// Formatted price
|
||||
$product['formatted_price'] = Tools::displayPrice(Tools::convertPrice($product['price_tax_incl'], $currency), $currency);
|
||||
// Concret price
|
||||
$product['price_tax_incl'] = Tools::ps_round(Tools::convertPrice($product['price_tax_incl'], $currency), 2);
|
||||
$product['price_tax_excl'] = Tools::ps_round(Tools::convertPrice($product['price_tax_excl'], $currency), 2);
|
||||
$productObj = new Product((int)$product['id_product'], false, (int)$this->context->language->id);
|
||||
$combinations = array();
|
||||
$attributes = $productObj->getAttributesGroups((int)$this->context->language->id);
|
||||
|
||||
$product['warehouse_list'] = array();
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
if (!isset($combinations[$attribute['id_product_attribute']]['attributes'])) {
|
||||
$combinations[$attribute['id_product_attribute']]['attributes'] = '';
|
||||
// Tax rate for this customer
|
||||
if (Tools::isSubmit('id_address')) {
|
||||
$product['tax_rate'] = $productObj->getTaxesRate(new Address(Tools::getValue('id_address')));
|
||||
}
|
||||
$combinations[$attribute['id_product_attribute']]['attributes'] .= $attribute['attribute_name'].' - ';
|
||||
$combinations[$attribute['id_product_attribute']]['id_product_attribute'] = $attribute['id_product_attribute'];
|
||||
$combinations[$attribute['id_product_attribute']]['default_on'] = $attribute['default_on'];
|
||||
if (!isset($combinations[$attribute['id_product_attribute']]['price'])) {
|
||||
$price_tax_incl = Product::getPriceStatic((int)$product['id_product'], true, $attribute['id_product_attribute']);
|
||||
$price_tax_excl = Product::getPriceStatic((int)$product['id_product'], false, $attribute['id_product_attribute']);
|
||||
$combinations[$attribute['id_product_attribute']]['price_tax_incl'] = Tools::ps_round(Tools::convertPrice($price_tax_incl, $currency), 2);
|
||||
$combinations[$attribute['id_product_attribute']]['price_tax_excl'] = Tools::ps_round(Tools::convertPrice($price_tax_excl, $currency), 2);
|
||||
$combinations[$attribute['id_product_attribute']]['formatted_price'] = Tools::displayPrice(Tools::convertPrice($price_tax_excl, $currency), $currency);
|
||||
}
|
||||
if (!isset($combinations[$attribute['id_product_attribute']]['qty_in_stock'])) {
|
||||
$combinations[$attribute['id_product_attribute']]['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct((int)$product['id_product'], $attribute['id_product_attribute'], (int)$this->context->shop->id);
|
||||
|
||||
$product['warehouse_list'] = array();
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
if (!isset($combinations[$attribute['id_product_attribute']]['attributes'])) {
|
||||
$combinations[$attribute['id_product_attribute']]['attributes'] = '';
|
||||
}
|
||||
$combinations[$attribute['id_product_attribute']]['attributes'] .= $attribute['attribute_name'].' - ';
|
||||
$combinations[$attribute['id_product_attribute']]['id_product_attribute'] = $attribute['id_product_attribute'];
|
||||
$combinations[$attribute['id_product_attribute']]['default_on'] = $attribute['default_on'];
|
||||
if (!isset($combinations[$attribute['id_product_attribute']]['price'])) {
|
||||
$price_tax_incl = Product::getPriceStatic((int)$product['id_product'], true, $attribute['id_product_attribute']);
|
||||
$price_tax_excl = Product::getPriceStatic((int)$product['id_product'], false, $attribute['id_product_attribute']);
|
||||
$combinations[$attribute['id_product_attribute']]['price_tax_incl'] = Tools::ps_round(Tools::convertPrice($price_tax_incl, $currency), 2);
|
||||
$combinations[$attribute['id_product_attribute']]['price_tax_excl'] = Tools::ps_round(Tools::convertPrice($price_tax_excl, $currency), 2);
|
||||
$combinations[$attribute['id_product_attribute']]['formatted_price'] = Tools::displayPrice(Tools::convertPrice($price_tax_excl, $currency), $currency);
|
||||
}
|
||||
if (!isset($combinations[$attribute['id_product_attribute']]['qty_in_stock'])) {
|
||||
$combinations[$attribute['id_product_attribute']]['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct((int)$product['id_product'], $attribute['id_product_attribute'], (int)$this->context->shop->id);
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && (int)$product['advanced_stock_management'] == 1) {
|
||||
$product['warehouse_list'][$attribute['id_product_attribute']] = Warehouse::getProductWarehouseList($product['id_product'], $attribute['id_product_attribute']);
|
||||
} else {
|
||||
$product['warehouse_list'][$attribute['id_product_attribute']] = array();
|
||||
}
|
||||
|
||||
$product['stock'][$attribute['id_product_attribute']] = Product::getRealQuantity($product['id_product'], $attribute['id_product_attribute']);
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && (int)$product['advanced_stock_management'] == 1) {
|
||||
$product['warehouse_list'][$attribute['id_product_attribute']] = Warehouse::getProductWarehouseList($product['id_product'], $attribute['id_product_attribute']);
|
||||
$product['warehouse_list'][0] = Warehouse::getProductWarehouseList($product['id_product']);
|
||||
} else {
|
||||
$product['warehouse_list'][$attribute['id_product_attribute']] = array();
|
||||
$product['warehouse_list'][0] = array();
|
||||
}
|
||||
|
||||
$product['stock'][$attribute['id_product_attribute']] = Product::getRealQuantity($product['id_product'], $attribute['id_product_attribute']);
|
||||
}
|
||||
$product['stock'][0] = StockAvailable::getQuantityAvailableByProduct((int)$product['id_product'], 0, (int)$this->context->shop->id);
|
||||
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && (int)$product['advanced_stock_management'] == 1) {
|
||||
$product['warehouse_list'][0] = Warehouse::getProductWarehouseList($product['id_product']);
|
||||
} else {
|
||||
$product['warehouse_list'][0] = array();
|
||||
}
|
||||
foreach ($combinations as &$combination) {
|
||||
$combination['attributes'] = rtrim($combination['attributes'], ' - ');
|
||||
}
|
||||
$product['combinations'] = $combinations;
|
||||
|
||||
$product['stock'][0] = StockAvailable::getQuantityAvailableByProduct((int)$product['id_product'], 0, (int)$this->context->shop->id);
|
||||
|
||||
foreach ($combinations as &$combination) {
|
||||
$combination['attributes'] = rtrim($combination['attributes'], ' - ');
|
||||
}
|
||||
$product['combinations'] = $combinations;
|
||||
|
||||
if ($product['customizable']) {
|
||||
$product_instance = new Product((int)$product['id_product']);
|
||||
$product['customization_fields'] = $product_instance->getCustomizationFields($this->context->language->id);
|
||||
if ($product['customizable']) {
|
||||
$product_instance = new Product((int)$product['id_product']);
|
||||
$product['customization_fields'] = $product_instance->getCustomizationFields($this->context->language->id);
|
||||
}
|
||||
}
|
||||
$to_return = array(
|
||||
'products' => $products,
|
||||
'found' => true
|
||||
);
|
||||
}
|
||||
|
||||
$to_return = array(
|
||||
'products' => $products,
|
||||
'found' => true
|
||||
);
|
||||
} else {
|
||||
$to_return = array('found' => false);
|
||||
}
|
||||
|
||||
$this->content = json_encode($to_return);
|
||||
}
|
||||
|
||||
@@ -1867,6 +1856,35 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->context->cart = $cart;
|
||||
$this->context->customer = new Customer($order->id_customer);
|
||||
|
||||
// always add taxes even if there are not displayed to the customer
|
||||
$use_taxes = true;
|
||||
$initial_product_price_tax_incl = Product::getPriceStatic(
|
||||
$product->id,
|
||||
$use_taxes,
|
||||
isset($combination) ? $combination->id : null,
|
||||
2,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
1,
|
||||
false,
|
||||
$order->id_customer,
|
||||
$cart->id,
|
||||
$order->{Configuration::get('PS_TAX_ADDRESS_TYPE', null, null, $order->id_shop)}
|
||||
);
|
||||
|
||||
// create feature price if needed
|
||||
$createFeaturePrice = $product_informations['product_price_tax_incl'] != $initial_product_price_tax_incl;
|
||||
$featurePriceParams = array();
|
||||
if ($createFeaturePrice) {
|
||||
$featurePriceParams = array(
|
||||
'id_cart' => $this->context->cart->id,
|
||||
'id_guest' => $this->context->cookie->id_guest,
|
||||
'price' => $product_informations['product_price_tax_excl'],
|
||||
'id_product' => $product->id,
|
||||
);
|
||||
}
|
||||
|
||||
/*By Webkul to make entries in HotelCartBookingData */
|
||||
$hotel_room_info_arr = $hotel_room_data['rm_data'][0]['data']['available'];
|
||||
$chkQty = 0;
|
||||
@@ -1887,54 +1905,19 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$obj_htl_cart_booking_data->date_to = $date_to;
|
||||
$obj_htl_cart_booking_data->save();
|
||||
++$chkQty;
|
||||
|
||||
// create feature price if needed
|
||||
if ($createFeaturePrice) {
|
||||
$featurePriceParams['id_room'] = $room_info['id_room'];
|
||||
$featurePriceParams = array_merge($featurePriceParams, array('date_from' => $date_from, 'date_to' => $date_to));
|
||||
$this->createFeaturePrice($featurePriceParams);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*END*/
|
||||
// always add taxes even if there are not displayed to the customer
|
||||
$use_taxes = true;
|
||||
|
||||
$initial_product_price_tax_incl = Product::getPriceStatic(
|
||||
$product->id,
|
||||
$use_taxes,
|
||||
isset($combination) ? $combination->id : null,
|
||||
2,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
1,
|
||||
false,
|
||||
$order->id_customer,
|
||||
$cart->id,
|
||||
$order->id_address_tax
|
||||
);
|
||||
|
||||
// Creating specific price if needed
|
||||
if ($product_informations['product_price_tax_incl'] != $initial_product_price_tax_incl) {
|
||||
$specific_price = new SpecificPrice();
|
||||
$specific_price->id_shop = 0;
|
||||
$specific_price->id_shop_group = 0;
|
||||
$specific_price->id_currency = 0;
|
||||
$specific_price->id_country = 0;
|
||||
$specific_price->id_group = 0;
|
||||
$specific_price->id_customer = $order->id_customer;
|
||||
$specific_price->id_product = $product->id;
|
||||
if (isset($combination)) {
|
||||
$specific_price->id_product_attribute = $combination->id;
|
||||
} else {
|
||||
$specific_price->id_product_attribute = 0;
|
||||
}
|
||||
$specific_price->price = $product_informations['product_price_tax_excl'];
|
||||
$specific_price->from_quantity = 1;
|
||||
$specific_price->reduction = 0;
|
||||
$specific_price->reduction_type = 'amount';
|
||||
$specific_price->reduction_tax = 0;
|
||||
$specific_price->from = '0000-00-00 00:00:00';
|
||||
$specific_price->to = '0000-00-00 00:00:00';
|
||||
$specific_price->add();
|
||||
}
|
||||
|
||||
// Add product to cart
|
||||
$update_quantity = $cart->updateQty(
|
||||
@@ -2079,11 +2062,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// Update Tax lines
|
||||
$order_detail->updateTaxAmount($order);
|
||||
|
||||
// Delete specific price if exists
|
||||
if (isset($specific_price)) {
|
||||
$specific_price->delete();
|
||||
}
|
||||
|
||||
$products = $this->getProducts($order);
|
||||
|
||||
// Get the last product
|
||||
@@ -2199,7 +2177,18 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
$objHtlBkDtl->date_from = $obj_cart_bk_data->date_from;
|
||||
$objHtlBkDtl->date_to = $obj_cart_bk_data->date_to;
|
||||
$total_price = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($idProduct, $obj_cart_bk_data->date_from, $obj_cart_bk_data->date_to);
|
||||
|
||||
$total_price = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$obj_cart_bk_data->date_from,
|
||||
$obj_cart_bk_data->date_to,
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$this->context->cart->id,
|
||||
$this->context->cookie->id_guest,
|
||||
$obj_cart_bk_data->id_room
|
||||
);
|
||||
|
||||
$objHtlBkDtl->total_price_tax_excl = $total_price['total_price_tax_excl'];
|
||||
$objHtlBkDtl->total_price_tax_incl = $total_price['total_price_tax_incl'];
|
||||
$objHtlBkDtl->total_paid_amount = Tools::ps_round($total_price['total_price_tax_incl'], 5);
|
||||
@@ -2232,6 +2221,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// delete cart feature prices after room addition success
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($cart->id);
|
||||
|
||||
die(json_encode(array(
|
||||
'result' => true,
|
||||
//'view' => $this->createTemplate('_product_line.tpl')->fetch(),
|
||||
@@ -2294,12 +2286,40 @@ class AdminOrdersControllerCore extends AdminController
|
||||
)));
|
||||
}
|
||||
|
||||
protected function createFeaturePrice($params)
|
||||
{
|
||||
$feature_price_name = array();
|
||||
foreach (Language::getIDs(true) as $id_lang) {
|
||||
$feature_price_name[$id_lang] = 'Auto-generated';
|
||||
}
|
||||
|
||||
$hrt_feature_price = new HotelRoomTypeFeaturePricing();
|
||||
$hrt_feature_price->id_product = (int) $params['id_product'];
|
||||
$hrt_feature_price->id_cart = (int) $params['id_cart'];
|
||||
$hrt_feature_price->id_guest = (int) $params['id_guest'];
|
||||
$hrt_feature_price->id_room = (int) $params['id_room'];
|
||||
$hrt_feature_price->feature_price_name = $feature_price_name;
|
||||
$hrt_feature_price->date_selection_type = HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE;
|
||||
$hrt_feature_price->date_from = date('Y-m-d', strtotime($params['date_from']));
|
||||
$hrt_feature_price->date_to = date('Y-m-d', strtotime($params['date_to']));
|
||||
$hrt_feature_price->is_special_days_exists = 0;
|
||||
$hrt_feature_price->special_days = json_encode(false);
|
||||
$hrt_feature_price->impact_way = HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE;
|
||||
$hrt_feature_price->impact_type = HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE;
|
||||
$hrt_feature_price->impact_value = $params['price'];
|
||||
$hrt_feature_price->active = 1;
|
||||
$hrt_feature_price->groupBox = array_column(Group::getGroups($this->context->language->id), 'id_group');
|
||||
$hrt_feature_price->add();
|
||||
}
|
||||
|
||||
public function ajaxProcessEditProductOnOrder()
|
||||
{
|
||||
// Return value
|
||||
$res = true;
|
||||
$id_order = (int) Tools::getValue('id_order');
|
||||
$order = new Order($id_order);
|
||||
$cart = new Cart($order->id_cart);
|
||||
$customer = new Cart($order->id_customer);
|
||||
//$order_detail = new OrderDetail((int)Tools::getValue('product_id_order_detail'));
|
||||
$order_detail = new OrderDetail((int) Tools::getValue('order_detail_id'));//by webkul id_order_detail from our table
|
||||
$this->doEditProductValidation($order_detail, $order, isset($order_invoice) ? $order_invoice : null);
|
||||
@@ -2316,11 +2336,12 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$id_hotel = trim(Tools::getValue('id_hotel'));
|
||||
$id_room = trim(Tools::getValue('id_room'));
|
||||
$id_product = trim(Tools::getValue('id_product'));
|
||||
$room_unit_price = trim(Tools::getValue('room_unit_price'));
|
||||
$obj_booking_detail = new HotelBookingDetail();
|
||||
$product_quantity = (int) $obj_booking_detail->getNumberOfDays($new_date_from, $new_date_to);
|
||||
$old_product_quantity = (int) $obj_booking_detail->getNumberOfDays($old_date_from, $old_date_to);
|
||||
$qty_diff = $product_quantity - $old_product_quantity;
|
||||
|
||||
|
||||
/*By webkul to validate fields before deleting the cart and order data form the tables*/
|
||||
if ($id_hotel == '') {
|
||||
die(json_encode(array(
|
||||
@@ -2362,6 +2383,16 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Check out Date Should be after Check In date.'),
|
||||
)));
|
||||
} elseif ($room_unit_price == '') {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Please enter unit price.'),
|
||||
)));
|
||||
} elseif (!Validate::isPrice($room_unit_price)) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Please enter a valid unit price.'),
|
||||
)));
|
||||
} elseif (!Validate::isUnsignedInt($product_quantity)) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
@@ -2377,28 +2408,58 @@ class AdminOrdersControllerCore extends AdminController
|
||||
)));
|
||||
}
|
||||
|
||||
// By webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
// By webkul to calculate rates of the product from hotelreservationsystem tables with feature prices....
|
||||
// add feature price for updated price
|
||||
|
||||
$hotelCartBookingData = new HotelCartBookingData();
|
||||
$totalProductPriceBeforeTE = (float) $order_detail->total_price_tax_excl;
|
||||
$totalProductPriceBeforeTI = (float) $order_detail->total_price_tax_incl;
|
||||
$totalProductPriceAfterTE = 0;
|
||||
$totalProductPriceAfterTI = 0;
|
||||
$totalRoomPriceAfterTE = 0;
|
||||
$totalRoomPriceAfterTI = 0;
|
||||
$bookedRooms = $obj_booking_detail->getBookedRoomsByIdOrderDetail((int) Tools::getValue('order_detail_id'), $id_product);
|
||||
if ($bookedRooms) {
|
||||
$params = array(
|
||||
'id_cart' => $cart->id,
|
||||
'id_guest' => $cart->id_guest,
|
||||
'price' => $room_unit_price,
|
||||
);
|
||||
|
||||
foreach ($bookedRooms as $roomInfo) {
|
||||
$params['id_product'] = $roomInfo['id_product'];
|
||||
$params['id_room'] = $roomInfo['id_room'];
|
||||
|
||||
if ($roomInfo['id_room'] == $id_room && (strtotime($roomInfo['date_from']) == strtotime($old_date_from))) {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($roomInfo['id_product'], $new_date_from, $new_date_to);
|
||||
$params = array_merge($params, array('date_from' => $new_date_from, 'date_to' => $new_date_to));
|
||||
$this->createFeaturePrice($params);
|
||||
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$roomInfo['id_product'],
|
||||
$new_date_from,
|
||||
$new_date_to,
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$cart->id,
|
||||
$cart->id_guest,
|
||||
$roomInfo['id_room']
|
||||
);
|
||||
|
||||
$totalProductPriceAfterTE += (float) $roomTotalPrice['total_price_tax_excl'];
|
||||
$totalProductPriceAfterTI += (float) $roomTotalPrice['total_price_tax_incl'];
|
||||
|
||||
$totalRoomPriceAfterTE += (float) $roomTotalPrice['total_price_tax_excl'];
|
||||
$totalRoomPriceAfterTI += (float) $roomTotalPrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($roomInfo['id_product'], $roomInfo['date_from'], $roomInfo['date_to']);
|
||||
$totalProductPriceAfterTE += (float) $roomInfo['total_price_tax_excl'];
|
||||
$totalProductPriceAfterTI += (float) $roomInfo['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// END
|
||||
|
||||
// delete cart feature prices after booking update success
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($cart->id);
|
||||
// END
|
||||
|
||||
/*This code is commented by webkul because in our case quantity of the product will be number of days for which room is booked*/
|
||||
// If multiple product_quantity, the order details concern a product customized
|
||||
@@ -2566,13 +2627,18 @@ class AdminOrdersControllerCore extends AdminController
|
||||
);
|
||||
|
||||
/*By webkul to edit the Hotel Cart and Hotel Order tables when editing the room for the order detail page*/
|
||||
$new_total_price = array(
|
||||
'tax_excl' => $totalRoomPriceAfterTE,
|
||||
'tax_incl' => $totalRoomPriceAfterTI,
|
||||
);
|
||||
if ($update_htl_tables = $obj_booking_detail->UpdateHotelCartHotelOrderOnOrderEdit(
|
||||
$id_order,
|
||||
$id_room,
|
||||
$old_date_from,
|
||||
$old_date_to,
|
||||
$new_date_from,
|
||||
$new_date_to
|
||||
$new_date_to,
|
||||
$new_total_price
|
||||
)) {
|
||||
// update extra demands total prices if dates are changes (price calc method for each day)
|
||||
if ($extraDemands) {
|
||||
|
||||
@@ -108,6 +108,14 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
'cast' => 'intval',
|
||||
'required' => false,
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_LOS_RESTRICTION_BO' => array(
|
||||
'title' => $this->l('Apply Min and Max lenght of stay restrictions for back-office bookings'),
|
||||
'hint' => $this->l('While creating bookings from back-office, apply minimum and maximum lenght of stay restrictions'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'required' => false,
|
||||
'type' => 'bool'
|
||||
)
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
@@ -213,6 +221,13 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
'required' => false,
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_HOTEL_IMAGES_PER_PAGE' => array(
|
||||
'title' => $this->l('Number of hotel images per page'),
|
||||
'hint' => $this->l('Number of hotel images displayed per page. Default is 9.'),
|
||||
'validation' => 'isUnsignedInt',
|
||||
'cast' => 'intval',
|
||||
'type' => 'text'
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
|
||||
@@ -112,6 +112,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
'Warehouses' => $this->l('Warehouses'),
|
||||
'Configuration' => $this->l('Configuration'),
|
||||
'Occupancy' => $this->l('Occupancy'),
|
||||
'LengthOfStay' => $this->l('Length of Stay'),
|
||||
'Booking' => $this->l('Booking Information'),
|
||||
);
|
||||
|
||||
@@ -133,7 +134,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
//'Suppliers' => 13,
|
||||
'Configuration' => 14,
|
||||
'Occupancy' => 15,
|
||||
'Booking' => 16,
|
||||
'LengthOfStay' => 16,
|
||||
'Booking' => 17,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1590,7 +1592,9 @@ class AdminProductsControllerCore extends AdminController
|
||||
_PS_JS_DIR_.'admin/products.js',
|
||||
));
|
||||
|
||||
if ($this->display == 'edit' || $this->display == 'add') {
|
||||
if (in_array($this->display, array('add', 'edit'))
|
||||
&& $this->tabAccess[$this->display] == '1'
|
||||
) {
|
||||
$this->addJqueryUI(array(
|
||||
'ui.core',
|
||||
'ui.widget'
|
||||
@@ -2223,6 +2227,9 @@ class AdminProductsControllerCore extends AdminController
|
||||
if ($this->isTabSubmitted('Occupancy')) {
|
||||
$this->processOccupancy();
|
||||
}
|
||||
if ($this->isTabSubmitted('LengthOfStay')) {
|
||||
$this->processLengthOfStay();
|
||||
}
|
||||
if ($this->isTabSubmitted('Configuration')) {
|
||||
$this->processConfiguration();
|
||||
}
|
||||
@@ -2695,8 +2702,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
// used to build the new url when changing category
|
||||
$this->tpl_list_vars['base_url'] = preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex).'&token='.$this->token;
|
||||
}
|
||||
// @todo module free
|
||||
$this->tpl_form_vars['vat_number'] = file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php');
|
||||
|
||||
parent::initContent();
|
||||
}
|
||||
@@ -2706,8 +2711,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
// if (Configuration::get('PS_STOCK_MANAGEMENT')) {
|
||||
// $helper = new HelperKpi();
|
||||
// $helper->id = 'box-products-stock';
|
||||
@@ -2729,12 +2732,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
$helper->icon = 'icon-tags';
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Average Gross Margin %', null, null, false);
|
||||
if (ConfigurationKPI::get('PRODUCT_AVG_GROSS_MARGIN') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('PRODUCT_AVG_GROSS_MARGIN');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=product_avg_gross_margin';
|
||||
$helper->tooltip = $this->l('Gross margin expressed in percentage assesses how cost-effectively you sell your room types. Out of $100, you will retain $X to cover profit and expenses.', null, null, false);
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('PRODUCT_AVG_GROSS_MARGIN_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -2743,12 +2742,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Purchased References', null, null, false);
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('8020_SALES_CATALOG') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('8020_SALES_CATALOG');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=8020_sales_catalog';
|
||||
$helper->tooltip = $this->l('X% of your references have been purchased for the past 30 days', null, null, false);
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('8020_SALES_CATALOG_EXPIRE') < $time);
|
||||
$helper->tooltip = $this->l('X% of your references have been purchased for the past 30 days.', null, null, false);
|
||||
if (Module::isInstalled('statsbestproducts')) {
|
||||
$helper->href = Context::getContext()->link->getAdminLink('AdminStats').'&module=statsbestproducts&datepickerFrom='.date('Y-m-d', strtotime('-30 days')).'&datepickerTo='.date('Y-m-d');
|
||||
}
|
||||
@@ -2760,12 +2755,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
$helper->color = 'color4';
|
||||
$helper->href = $this->context->link->getAdminLink('AdminProducts');
|
||||
$helper->title = $this->l('Disabled Room Types', null, null, false);
|
||||
if (ConfigurationKPI::get('DISABLED_PRODUCTS') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('DISABLED_PRODUCTS');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=disabled_products';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('DISABLED_PRODUCTS_EXPIRE') < $time);
|
||||
$helper->tooltip = $this->l('X% of your room types are disabled and not visible to your customers', null, null, false);
|
||||
$helper->tooltip = $this->l('X% of your room types are disabled and not visible to your customers.', null, null, false);
|
||||
$helper->href = Context::getContext()->link->getAdminLink('AdminProducts').'&productFilter_active=0&submitFilterproduct=1';
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
@@ -3487,6 +3478,141 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// send information for the length of stay tab
|
||||
public function initFormLengthOfStay($product)
|
||||
{
|
||||
$data = $this->createTemplate($this->tpl_form);
|
||||
if ($product->id) {
|
||||
if ($this->product_exists_in_shop) {
|
||||
// Check if any hotel is created or not
|
||||
$objRoomType = new HotelRoomType();
|
||||
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($product->id)) {
|
||||
if ($roomTypeInfo['id_hotel']) {
|
||||
// send length of stay date ranges for this room type
|
||||
$objRoomTypeRestrictionDates = new HotelRoomTypeRestrictionDateRange();
|
||||
$roomTypeInfo['restrictionDataRange'] = $objRoomTypeRestrictionDates->getRoomTypeLengthOfStayRestriction($product->id);
|
||||
$smartyVars['roomTypeInfo'] = $roomTypeInfo;
|
||||
} else {
|
||||
$this->displayWarning($this->l('No hotel is attached to this room type.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('Room type information is missing.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save room type before managing length of stay.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save room type before managing length of stay.'));
|
||||
}
|
||||
|
||||
$smartyVars['product'] = $product;
|
||||
$data->assign($smartyVars);
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
public function processLengthOfStay()
|
||||
{
|
||||
if ($this->tabAccess['edit'] == 1) {
|
||||
|
||||
$idProduct = Tools::getValue('id_product');
|
||||
if (Validate::isLoadedObject($product = new Product((int)$idProduct))) {
|
||||
$objRoomType = new HotelRoomType();
|
||||
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
|
||||
$roomTypeMinLos = Tools::getValue('min_los');
|
||||
$roomTypeMaxLos = Tools::getValue('max_los');
|
||||
|
||||
// validate length of stay global values for room type
|
||||
if (!$roomTypeMinLos || $roomTypeMinLos == null) {
|
||||
$this->errors[] = Tools::displayError('Global minimum length of stay is a required field.');
|
||||
} elseif (!Validate::isUnsignedInt($roomTypeMinLos)) {
|
||||
$this->errors[] = Tools::displayError('Global minimum length of stay value is invalid. Please enter integer value. Set 1 day incase of setting no limit on global minimum length of stay.');
|
||||
}
|
||||
|
||||
if ($roomTypeMaxLos == null) {
|
||||
$this->errors[] = Tools::displayError('Global maximum length of stay is a required field.');
|
||||
} elseif (!Validate::isUnsignedInt($roomTypeMaxLos)) {
|
||||
$this->errors[] = Tools::displayError('Invalid value entered for global maximum length of stay field. Please enter integer value. Set 0 day incase of setting no limit on maximum length of stay.');
|
||||
} elseif ($roomTypeMinLos && $roomTypeMaxLos > 0 && ($roomTypeMinLos > $roomTypeMaxLos)) {
|
||||
$this->errors[] = Tools::displayError('Value of global maximum length of stay must be greater than global minimum length of stay.');
|
||||
}
|
||||
|
||||
if (Tools::getValue('active_restriction_dates')) {
|
||||
if (Tools::getValue('restriction_date_from') && Tools::getValue('restriction_date_to')) {
|
||||
$objRoomTypeRestrictDateRange = new HotelRoomTypeRestrictionDateRange();
|
||||
$dateFromRestriction = Tools::getValue('restriction_date_from');
|
||||
$dateToRestriction = Tools::getValue('restriction_date_to');
|
||||
$minLosDays = Tools::getValue('restriction_min_los');
|
||||
$maxLosDays = Tools::getValue('restriction_max_los');
|
||||
|
||||
$this->errors = array_merge($this->errors, $objRoomTypeRestrictDateRange->validateRoomTypeLengthOfStayRestriction($dateFromRestriction, $dateToRestriction, $minLosDays, $maxLosDays));
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Please add at least one Minimum & maximum length of stay restriction for date range if \'Length of stay for date ranges\' option is enable.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->errors) {
|
||||
$objRoomType = new HotelRoomType($roomTypeInfo['id']);
|
||||
$objRoomType->min_los = $roomTypeMinLos;
|
||||
$objRoomType->max_los = $roomTypeMaxLos;
|
||||
if ($objRoomType->save()) {
|
||||
if (Tools::getValue('active_restriction_dates') && Tools::getValue('restriction_date_from')) {
|
||||
// @ToDo: we should validate this room type restriction ids belongs to this room type
|
||||
$idRoomTypeRestriction = Tools::getValue('id_rt_restriction');
|
||||
|
||||
foreach ($dateFromRestriction as $restrictionKey => $dateFrom) {
|
||||
// change into database compatible format
|
||||
$dateFrom = date('Y-m-d', strtotime($dateFrom));
|
||||
$dateTo = date('Y-m-d', strtotime($dateToRestriction[$restrictionKey]));
|
||||
|
||||
if ($idRoomTypeRestriction[$restrictionKey]) {
|
||||
$objRoomTypeRestrictDateRange = new HotelRoomTypeRestrictionDateRange($idRoomTypeRestriction[$restrictionKey]);
|
||||
} else {
|
||||
$objRoomTypeRestrictDateRange = new HotelRoomTypeRestrictionDateRange();
|
||||
}
|
||||
|
||||
$objRoomTypeRestrictDateRange->id_product = $idProduct;
|
||||
$objRoomTypeRestrictDateRange->date_from = $dateFrom;
|
||||
$objRoomTypeRestrictDateRange->date_to = $dateTo;
|
||||
$objRoomTypeRestrictDateRange->min_los = $minLosDays[$restrictionKey];
|
||||
$objRoomTypeRestrictDateRange->max_los = $maxLosDays[$restrictionKey];
|
||||
$objRoomTypeRestrictDateRange->save();
|
||||
}
|
||||
} else {
|
||||
// if disabled length of stay for date ranges then delete all previously saved
|
||||
$objRoomTypeRestrictDateRange = new HotelRoomTypeRestrictionDateRange();
|
||||
if ($losRestrictions = $objRoomTypeRestrictDateRange->getRoomTypeLengthOfStayRestriction($idProduct)) {
|
||||
foreach ($losRestrictions as $losDate) {
|
||||
$objRoomTypeRestrictDateRange = new HotelRoomTypeRestrictionDateRange($losDate['id_rt_restriction']);
|
||||
$objRoomTypeRestrictDateRange->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Something went wrong while saving global minimum & maximum length of stay values. Please try again !!');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('You do not have the right permission.');
|
||||
}
|
||||
}
|
||||
|
||||
// delete the rows of length of stay on date range
|
||||
public function ajaxProcessDeleteRoomTypeLengthOfStayRestriction()
|
||||
{
|
||||
if ($this->tabAccess['edit'] == 1) {
|
||||
$objRoomTypeRestrictionDates = new HotelRoomTypeRestrictionDateRange(Tools::getValue('id_rt_restriction'));
|
||||
if ($objRoomTypeRestrictionDates->delete()) {
|
||||
die(json_encode(array('success' => $this->l('Successfully deleted'))));
|
||||
} else {
|
||||
die(json_encode(array('error' => $this->l('Something went wrong. Please reload the page and try again !!'))));
|
||||
}
|
||||
} else {
|
||||
die(json_encode(array('error' => $this->l('You do not have the right permission'))));
|
||||
}
|
||||
}
|
||||
|
||||
public function validateDisableDateRanges($disableDates)
|
||||
{
|
||||
if (count($disableDates)) {
|
||||
@@ -5497,7 +5623,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
public function getModalDuplicateOptions()
|
||||
{
|
||||
$tpl = $this->createTemplate('modal-duplicate-options.tpl');
|
||||
$idsHotel = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
|
||||
$hotelsInfo = array();
|
||||
foreach ($idsHotel as $idHotel) {
|
||||
@@ -5513,13 +5638,15 @@ class AdminProductsControllerCore extends AdminController
|
||||
$hotelsInfo[] = $hotelInfo;
|
||||
}
|
||||
}
|
||||
|
||||
$formAction = $this->context->link->getAdminLink('AdminProducts', true).'&duplicateproduct';
|
||||
$tpl->assign(array(
|
||||
$this->context->smarty->assign(array(
|
||||
'action' => $formAction,
|
||||
'hotels_info' => $hotelsInfo,
|
||||
'duplicate_images' => 1,
|
||||
));
|
||||
|
||||
$modalContent = $this->context->smarty->fetch('controllers/products/modal-duplicate-options.tpl');
|
||||
$modalActions = array(
|
||||
array(
|
||||
'type' => 'button',
|
||||
@@ -5534,9 +5661,10 @@ class AdminProductsControllerCore extends AdminController
|
||||
'modal_id' => 'modal-duplicate-options',
|
||||
'modal_class' => 'modal-md',
|
||||
'modal_title' => $this->l('Duplication options'),
|
||||
'modal_content' => $tpl->fetch(),
|
||||
'modal_content' => $modalContent,
|
||||
'modal_actions' => $modalActions,
|
||||
);
|
||||
|
||||
return $modal;
|
||||
}
|
||||
|
||||
|
||||
@@ -230,17 +230,6 @@ class AdminReferrersControllerCore extends AdminController
|
||||
'submit' => array('title' => $this->l('Save')),
|
||||
));
|
||||
|
||||
if (Module::isInstalled('trackingfront')) {
|
||||
$this->fields_form[0]['form']['desc'] = array(
|
||||
$this->l('Affiliates can access their data with this name and password.'),
|
||||
$this->l('Front access:').' <a class="btn btn-link" href="'.$uri.'modules/trackingfront/stats.php" onclick="return !window.open(this.href);"><i class="icon-external-link-sign"></i> '.$uri.'modules/trackingfront/stats.php</a>'
|
||||
);
|
||||
} else {
|
||||
$this->fields_form[0]['form']['desc'] = array(
|
||||
sprintf($this->l('Please install the "%s" module in order to give your affiliates access their own statistics.'), Module::getModuleName('trackingfront'))
|
||||
);
|
||||
}
|
||||
|
||||
$this->fields_form[1] = array('form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Commission plan'),
|
||||
|
||||
@@ -538,9 +538,23 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
}
|
||||
|
||||
public function displayAjaxGetKpi()
|
||||
{
|
||||
$value = $this->getLatestKpiValue(Tools::getValue('kpi'));
|
||||
if ($value !== false) {
|
||||
$array = array('value' => $value);
|
||||
if (isset($data)) {
|
||||
$array['data'] = $data;
|
||||
}
|
||||
die(json_encode($array));
|
||||
}
|
||||
die(json_encode(array('has_errors' => true)));
|
||||
}
|
||||
|
||||
public function getLatestKpiValue($kpi)
|
||||
{
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
switch (Tools::getValue('kpi')) {
|
||||
$value = false;
|
||||
switch ($kpi) {
|
||||
case 'conversion_rate':
|
||||
$visitors = AdminStatsController::getVisits(true, date('Y-m-d', strtotime('-31 day')), date('Y-m-d', strtotime('-1 day')), false /*'day'*/);
|
||||
$orders = AdminStatsController::getOrders(date('Y-m-d', strtotime('-31 day')), date('Y-m-d', strtotime('-1 day')), false /*'day'*/);
|
||||
@@ -566,32 +580,22 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$value .= '%';
|
||||
|
||||
// ConfigurationKPI::updateValue('CONVERSION_RATE_CHART', Tools::jsonEncode($data));
|
||||
ConfigurationKPI::updateValue('CONVERSION_RATE', $value);
|
||||
ConfigurationKPI::updateValue('CONVERSION_RATE_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
|
||||
break;
|
||||
|
||||
case 'abandoned_cart':
|
||||
$value = AdminStatsController::getAbandonedCarts(date('Y-m-d H:i:s', strtotime('-2 day')), date('Y-m-d H:i:s', strtotime('-1 day')));
|
||||
ConfigurationKPI::updateValue('ABANDONED_CARTS', $value);
|
||||
ConfigurationKPI::updateValue('ABANDONED_CARTS_EXPIRE', strtotime('+1 hour'));
|
||||
break;
|
||||
|
||||
case 'installed_modules':
|
||||
$value = AdminStatsController::getInstalledModules();
|
||||
ConfigurationKPI::updateValue('INSTALLED_MODULES', $value);
|
||||
ConfigurationKPI::updateValue('INSTALLED_MODULES_EXPIRE', strtotime('+2 min'));
|
||||
break;
|
||||
|
||||
case 'disabled_modules':
|
||||
$value = AdminStatsController::getDisabledModules();
|
||||
ConfigurationKPI::updateValue('DISABLED_MODULES', $value);
|
||||
ConfigurationKPI::updateValue('DISABLED_MODULES_EXPIRE', strtotime('+2 min'));
|
||||
break;
|
||||
|
||||
case 'update_modules':
|
||||
$value = AdminStatsController::getModulesToUpdate();
|
||||
ConfigurationKPI::updateValue('UPDATE_MODULES', $value);
|
||||
ConfigurationKPI::updateValue('UPDATE_MODULES_EXPIRE', strtotime('+2 min'));
|
||||
break;
|
||||
|
||||
case 'percent_product_stock':
|
||||
@@ -608,33 +612,23 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
|
||||
case 'product_avg_gross_margin':
|
||||
$value = AdminStatsController::getProductAverageGrossMargin();
|
||||
ConfigurationKPI::updateValue('PRODUCT_AVG_GROSS_MARGIN', $value);
|
||||
ConfigurationKPI::updateValue('PRODUCT_AVG_GROSS_MARGIN_EXPIRE', strtotime('+6 hour'));
|
||||
break;
|
||||
|
||||
case 'disabled_categories':
|
||||
$value = AdminStatsController::getDisabledCategories();
|
||||
ConfigurationKPI::updateValue('DISABLED_CATEGORIES', $value);
|
||||
ConfigurationKPI::updateValue('DISABLED_CATEGORIES_EXPIRE', strtotime('+2 hour'));
|
||||
break;
|
||||
|
||||
case 'disabled_products':
|
||||
$value = round(100 * AdminStatsController::getDisabledProducts() / AdminStatsController::getTotalProducts(), 2).'%';
|
||||
ConfigurationKPI::updateValue('DISABLED_PRODUCTS', $value);
|
||||
ConfigurationKPI::updateValue('DISABLED_PRODUCTS_EXPIRE', strtotime('+2 hour'));
|
||||
break;
|
||||
|
||||
case '8020_sales_catalog':
|
||||
$value = AdminStatsController::get8020SalesCatalog(date('Y-m-d', strtotime('-30 days')), date('Y-m-d'));
|
||||
$value = sprintf($this->l('%d%% of your catalog'), $value);
|
||||
ConfigurationKPI::updateValue('8020_SALES_CATALOG', $value);
|
||||
ConfigurationKPI::updateValue('8020_SALES_CATALOG_EXPIRE', strtotime('+12 hour'));
|
||||
$value = sprintf($this->l('%d%% of your Catalog'), $value);
|
||||
break;
|
||||
|
||||
case 'empty_categories':
|
||||
$value = AdminStatsController::getEmptyCategories();
|
||||
ConfigurationKPI::updateValue('EMPTY_CATEGORIES', $value);
|
||||
ConfigurationKPI::updateValue('EMPTY_CATEGORIES_EXPIRE', strtotime('+2 hour'));
|
||||
break;
|
||||
|
||||
case 'customer_main_gender':
|
||||
@@ -650,20 +644,14 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$value = sprintf($this->l('%d%% Neutral customers', null, null, false), $value['value']);
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('CUSTOMER_MAIN_GENDER', array($this->context->language->id => $value));
|
||||
ConfigurationKPI::updateValue('CUSTOMER_MAIN_GENDER_EXPIRE', array($this->context->language->id => strtotime('+1 day')));
|
||||
break;
|
||||
|
||||
case 'avg_customer_age':
|
||||
$value = sprintf($this->l('%d years', null, null, false), AdminStatsController::getAverageCustomerAge(), 1);
|
||||
ConfigurationKPI::updateValue('AVG_CUSTOMER_AGE', array($this->context->language->id => $value));
|
||||
ConfigurationKPI::updateValue('AVG_CUSTOMER_AGE_EXPIRE', array($this->context->language->id => strtotime('+1 day')));
|
||||
break;
|
||||
|
||||
case 'pending_messages':
|
||||
$value = (int)AdminStatsController::getPendingMessages();
|
||||
ConfigurationKPI::updateValue('PENDING_MESSAGES', $value);
|
||||
ConfigurationKPI::updateValue('PENDING_MESSAGES_EXPIRE', strtotime('+5 min'));
|
||||
break;
|
||||
|
||||
case 'avg_msg_response_time':
|
||||
@@ -678,39 +666,30 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
} else {
|
||||
$value = sprintf($this->l('%.1f hours', null, null, false), $value / 3600);
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('AVG_MSG_RESPONSE_TIME', $value);
|
||||
ConfigurationKPI::updateValue('AVG_MSG_RESPONSE_TIME_EXPIRE', strtotime('+4 hour'));
|
||||
break;
|
||||
|
||||
case 'messages_per_thread':
|
||||
$value = round(AdminStatsController::getMessagesPerThread(date('Y-m-d', strtotime('-31 day')), date('Y-m-d', strtotime('-1 day'))), 1);
|
||||
ConfigurationKPI::updateValue('MESSAGES_PER_THREAD', $value);
|
||||
ConfigurationKPI::updateValue('MESSAGES_PER_THREAD_EXPIRE', strtotime('+12 hour'));
|
||||
break;
|
||||
|
||||
case 'newsletter_registrations':
|
||||
$value = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE newsletter = 1
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE newsletter = 1
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||
if (Module::isInstalled('blocknewsletter')) {
|
||||
$value += Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'newsletter`
|
||||
WHERE active = 1
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'newsletter`
|
||||
WHERE active = 1
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('NEWSLETTER_REGISTRATIONS', $value);
|
||||
ConfigurationKPI::updateValue('NEWSLETTER_REGISTRATIONS_EXPIRE', strtotime('+6 hour'));
|
||||
break;
|
||||
|
||||
case 'enabled_languages':
|
||||
$value = Language::countActiveLanguages();
|
||||
ConfigurationKPI::updateValue('ENABLED_LANGUAGES', $value);
|
||||
ConfigurationKPI::updateValue('ENABLED_LANGUAGES_EXPIRE', strtotime('+1 min'));
|
||||
break;
|
||||
|
||||
case 'frontoffice_translations':
|
||||
@@ -729,41 +708,35 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$value = sprintf($this->l('%d%% %s', null, null, false), $row['orders'], $country->name);
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('MAIN_COUNTRY', array($this->context->language->id => $value));
|
||||
ConfigurationKPI::updateValue('MAIN_COUNTRY_EXPIRE', array($this->context->language->id => strtotime('+1 day')));
|
||||
break;
|
||||
|
||||
case 'orders_per_customer':
|
||||
$value = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'customer` c
|
||||
WHERE c.active = 1
|
||||
'.Shop::addSqlRestriction());
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'customer` c
|
||||
WHERE c.active = 1
|
||||
'.Shop::addSqlRestriction());
|
||||
if ($value) {
|
||||
$orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
WHERE o.valid = 1
|
||||
'.Shop::addSqlRestriction());
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
WHERE o.valid = 1
|
||||
'.Shop::addSqlRestriction());
|
||||
$value = round($orders / $value, 2);
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('ORDERS_PER_CUSTOMER', $value);
|
||||
ConfigurationKPI::updateValue('ORDERS_PER_CUSTOMER_EXPIRE', strtotime('+1 day'));
|
||||
break;
|
||||
|
||||
case 'average_order_value':
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT
|
||||
COUNT(o.`id_order`) as orders,
|
||||
SUM(o.`total_paid_tax_excl` / o.`conversion_rate`) as total_paid_tax_excl
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
SELECT
|
||||
COUNT(o.`id_order`) as orders,
|
||||
SUM(o.`total_paid_tax_excl` / o.`conversion_rate`) as total_paid_tax_excl
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON os.`id_order_state` = o.`current_state`
|
||||
WHERE o.`invoice_date` BETWEEN "'.pSQL(date('Y-m-d', strtotime('-31 day'))).' 00:00:00" AND "'.pSQL(date('Y-m-d', strtotime('-1 day'))).' 23:59:59" AND os.`logable` = 1
|
||||
'.Shop::addSqlRestriction());
|
||||
WHERE o.`invoice_date` BETWEEN "'.pSQL(date('Y-m-d', strtotime('-31 day'))).' 00:00:00" AND "'.pSQL(date('Y-m-d', strtotime('-1 day'))).' 23:59:59" AND os.`logable` = 1
|
||||
'.Shop::addSqlRestriction());
|
||||
$value = Tools::displayPrice($row['orders'] ? $row['total_paid_tax_excl'] / $row['orders'] : 0, $currency);
|
||||
ConfigurationKPI::updateValue('AVG_ORDER_VALUE', $value);
|
||||
ConfigurationKPI::updateValue('AVG_ORDER_VALUE_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
|
||||
break;
|
||||
|
||||
case 'netprofit_visit':
|
||||
@@ -783,30 +756,23 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$value = Tools::displayPrice(0, $currency);
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('NETPROFIT_VISIT', $value);
|
||||
ConfigurationKPI::updateValue('NETPROFIT_VISIT_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
|
||||
break;
|
||||
|
||||
case 'products_per_category':
|
||||
$products = AdminStatsController::getTotalProducts();
|
||||
$categories = AdminStatsController::getTotalCategories();
|
||||
$value = round($products / $categories);
|
||||
ConfigurationKPI::updateValue('PRODUCTS_PER_CATEGORY', $value);
|
||||
ConfigurationKPI::updateValue('PRODUCTS_PER_CATEGORY_EXPIRE', strtotime('+1 hour'));
|
||||
break;
|
||||
case 'products_per_category':
|
||||
$products = AdminStatsController::getTotalProducts();
|
||||
$categories = AdminStatsController::getTotalCategories();
|
||||
$value = round($products / $categories);
|
||||
break;
|
||||
|
||||
case 'top_category':
|
||||
if (!($id_category = AdminStatsController::getBestCategory(date('Y-m-d', strtotime('-1 month')), date('Y-m-d')))) {
|
||||
$value = $this->l('No category', null, null, false);
|
||||
} else {
|
||||
$category = new Category($id_category, $this->context->language->id);
|
||||
$value = $category->name;
|
||||
}
|
||||
|
||||
ConfigurationKPI::updateValue('TOP_CATEGORY', array($this->context->language->id => $value));
|
||||
ConfigurationKPI::updateValue('TOP_CATEGORY_EXPIRE', array($this->context->language->id => strtotime('+1 day')));
|
||||
break;
|
||||
case 'top_category':
|
||||
if (!($id_category = AdminStatsController::getBestCategory(date('Y-m-d', strtotime('-1 month')), date('Y-m-d')))) {
|
||||
$value = $this->l('No category', null, null, false);
|
||||
} else {
|
||||
$category = new Category($id_category, $this->context->language->id);
|
||||
$value = $category->name;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$value = false;
|
||||
}
|
||||
|
||||
@@ -2085,45 +2085,17 @@ class AdminThemesControllerCore extends AdminController
|
||||
return array(
|
||||
'addsharethis',
|
||||
'bankwire',
|
||||
'blockadvertising',
|
||||
'blockbanner',
|
||||
'blockbestsellers',
|
||||
'blockcart',
|
||||
'blockcategories',
|
||||
'blockcms',
|
||||
'blockcmsinfo',
|
||||
'blockcontact',
|
||||
'blockcontactinfos',
|
||||
'blockcurrencies',
|
||||
'blockcustomerprivacy',
|
||||
'blockfacebook',
|
||||
'blocklanguages',
|
||||
'blocklayered',
|
||||
'blocklink',
|
||||
'blockmanufacturer',
|
||||
'qloblockcontact',
|
||||
'blockmyaccount',
|
||||
'blockmyaccountfooter',
|
||||
'blocknewproducts',
|
||||
'blocknewsletter',
|
||||
'blockpaymentlogo',
|
||||
'blockpermanentlinks',
|
||||
'blockreinsurance',
|
||||
'blockrss',
|
||||
'blocksearch',
|
||||
'blocksharefb',
|
||||
'blocksocial',
|
||||
'blockspecials',
|
||||
'blockstore',
|
||||
'blocksupplier',
|
||||
'blocktags',
|
||||
'blocktopmenu',
|
||||
'blockuserinfo',
|
||||
'blockviewed',
|
||||
'blockwishlist',
|
||||
'carriercompare',
|
||||
'cashondelivery',
|
||||
'cheque',
|
||||
'crossselling',
|
||||
'dashactivity',
|
||||
'dashgoals',
|
||||
'dashproducts',
|
||||
@@ -2135,22 +2107,13 @@ class AdminThemesControllerCore extends AdminController
|
||||
'followup',
|
||||
'gapi',
|
||||
'graphnvd3',
|
||||
'gridhtml',
|
||||
'homefeatured',
|
||||
'homeslider',
|
||||
'loyalty',
|
||||
'mailalerts',
|
||||
'newsletter',
|
||||
'pagesnotfound',
|
||||
'productcomments',
|
||||
'productpaymentlogos',
|
||||
'productscategory',
|
||||
'producttooltip',
|
||||
'pscleaner',
|
||||
'referralprogram',
|
||||
'sekeywords',
|
||||
'sendtoafriend',
|
||||
'socialsharing',
|
||||
'statsbestcategories',
|
||||
'statsbestcustomers',
|
||||
'statsbestmanufacturers',
|
||||
@@ -2170,12 +2133,8 @@ class AdminThemesControllerCore extends AdminController
|
||||
'statsproduct',
|
||||
'statsregistrations',
|
||||
'statssales',
|
||||
'statssearch',
|
||||
'statsstock',
|
||||
'statsvisits',
|
||||
'themeconfigurator',
|
||||
'trackingfront',
|
||||
'vatnumber',
|
||||
'watermark'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1318,19 +1318,13 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-languages';
|
||||
$helper->icon = 'icon-microphone';
|
||||
$helper->color = 'color1';
|
||||
$helper->href = $this->context->link->getAdminLink('AdminLanguages');
|
||||
$helper->title = $this->l('Enabled Languages', null, null, false);
|
||||
if (ConfigurationKPI::get('ENABLED_LANGUAGES') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('ENABLED_LANGUAGES');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=enabled_languages';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('ENABLED_LANGUAGES_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
@@ -1338,11 +1332,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$helper->icon = 'icon-list';
|
||||
$helper->color = 'color3';
|
||||
$helper->title = $this->l('Front office Translations', null, null, false);
|
||||
if (ConfigurationKPI::get('FRONTOFFICE_TRANSLATIONS') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('FRONTOFFICE_TRANSLATIONS');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=frontoffice_translations';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('FRONTOFFICE_TRANSLATIONS_EXPIRE') < $time);
|
||||
$kpis[] = $helper->generate();
|
||||
|
||||
$helper = new HelperKpi();
|
||||
|
||||
@@ -45,7 +45,6 @@ class AddressControllerCore extends FrontController
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools/vatManagement.js',
|
||||
_THEME_JS_DIR_.'tools/statesManagement.js',
|
||||
_PS_JS_DIR_.'validate.js'
|
||||
));
|
||||
@@ -257,7 +256,6 @@ class AddressControllerCore extends FrontController
|
||||
parent::initContent();
|
||||
|
||||
$this->assignCountries();
|
||||
$this->assignVatNumber();
|
||||
$this->assignAddressFormat();
|
||||
|
||||
// Assign common vars
|
||||
@@ -331,32 +329,6 @@ class AddressControllerCore extends FrontController
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign template vars related to vat number
|
||||
* @todo move this in vatnumber module !
|
||||
*/
|
||||
protected function assignVatNumber()
|
||||
{
|
||||
$vat_number_exists = file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
|
||||
$vat_number_management = Configuration::get('VATNUMBER_MANAGEMENT');
|
||||
if ($vat_number_management && $vat_number_exists) {
|
||||
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
|
||||
}
|
||||
|
||||
if ($vat_number_management && $vat_number_exists && VatNumber::isApplicable((int)Tools::getCountry())) {
|
||||
$vat_display = 2;
|
||||
} elseif ($vat_number_management) {
|
||||
$vat_display = 1;
|
||||
} else {
|
||||
$vat_display = 0;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'vatnumber_ajax_call' => file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'),
|
||||
'vat_display' => $vat_display,
|
||||
));
|
||||
}
|
||||
|
||||
public function displayAjax()
|
||||
{
|
||||
if (count($this->errors)) {
|
||||
|
||||
@@ -85,7 +85,6 @@ class AddressesControllerCore extends FrontController
|
||||
|
||||
$addresses_style = array(
|
||||
'company' => 'address_company',
|
||||
'vat_number' => 'address_company',
|
||||
'firstname' => 'address_name',
|
||||
'lastname' => 'address_name',
|
||||
'address1' => 'address_address1',
|
||||
|
||||
@@ -70,7 +70,6 @@ class AuthControllerCore extends FrontController
|
||||
|
||||
$this->addJqueryPlugin('typewatch');
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools/vatManagement.js',
|
||||
_THEME_JS_DIR_.'tools/statesManagement.js',
|
||||
_THEME_JS_DIR_.'authentication.js',
|
||||
_PS_JS_DIR_.'validate.js'
|
||||
@@ -217,7 +216,6 @@ class AuthControllerCore extends FrontController
|
||||
'countries' => $countries,
|
||||
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
|
||||
'sl_country' => (int)$this->id_country,
|
||||
'vat_management' => Configuration::get('VATNUMBER_MANAGEMENT')
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class CategoryControllerCore extends FrontController
|
||||
if (!$this->category->active || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')))) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
header('Status: 404 Not Found');
|
||||
$this->errors[] = Tools::displayError('Category not found');
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
} else
|
||||
// Check if category can be accessible by current customer and return 403 if not
|
||||
if (!$this->category->checkAccess($this->context->customer->id)) {
|
||||
@@ -218,6 +218,8 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
public function displayAjaxFilterResults()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
|
||||
$this->display_header = false;
|
||||
$this->display_footer = false;
|
||||
|
||||
@@ -286,9 +288,13 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
array_multisort($indi_arr, $direction, $booking_data['rm_data']);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array('booking_data' => $booking_data));
|
||||
$html = $this->context->smarty->fetch('_partials/room_type_list.tpl');
|
||||
$response['status'] = true;
|
||||
$response['html_room_type_list'] = $html;
|
||||
}
|
||||
die($this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/room_type_list.tpl'));
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -332,12 +332,13 @@ class OrderDetailControllerCore extends FrontController
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
$num_days = $cartHotelData[$type_key]['date_diff'][$date_join]['num_days'];
|
||||
$var_quant = (int) $cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'];
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl']*$var_quant;
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] = $data_v['total_price_tax_excl']*$var_quant;
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += $data_v['total_price_tax_excl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order'];
|
||||
if ($data_v['is_back_order']) {
|
||||
$anyBackOrder = 1;
|
||||
@@ -351,6 +352,8 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] = $data_v['total_price_tax_excl'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order'];
|
||||
@@ -406,6 +409,15 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
$cartHotelData[$type_key]['hotel_name'] = $data_v['hotel_name'];
|
||||
}
|
||||
|
||||
// calculate averages now
|
||||
foreach ($cartHotelData[$type_key]['date_diff'] as $key => &$value) {
|
||||
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
|
||||
$value['avg_paid_unit_price_tax_incl'] = Tools::ps_round($value['avg_paid_unit_price_tax_incl'] / $value['num_rm'], 6);
|
||||
|
||||
$value['avg_price_diff_tax_excl'] = abs(Tools::ps_round($value['avg_paid_unit_price_tax_excl'] - $value['product_price_tax_excl'], 6));
|
||||
$value['avg_price_diff_tax_incl'] = abs(Tools::ps_round($value['avg_paid_unit_price_tax_incl'] - $value['product_price_tax_incl'], 6));
|
||||
}
|
||||
}
|
||||
|
||||
$redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
|
||||
|
||||
@@ -345,7 +345,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
}
|
||||
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools/vatManagement.js',
|
||||
_THEME_JS_DIR_.'tools/statesManagement.js',
|
||||
_THEME_JS_DIR_.'order-carrier.js',
|
||||
_PS_JS_DIR_.'validate.js'
|
||||
@@ -597,7 +596,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'company' => Tools::htmlentitiesUTF8($address_delivery->company),
|
||||
'lastname' => Tools::htmlentitiesUTF8($address_delivery->lastname),
|
||||
'firstname' => Tools::htmlentitiesUTF8($address_delivery->firstname),
|
||||
'vat_number' => Tools::htmlentitiesUTF8($address_delivery->vat_number),
|
||||
'dni' => Tools::htmlentitiesUTF8($address_delivery->dni),
|
||||
'address1' => Tools::htmlentitiesUTF8($address_delivery->address1),
|
||||
'postcode' => Tools::htmlentitiesUTF8($address_delivery->postcode),
|
||||
@@ -613,7 +611,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'company_invoice' => Tools::htmlentitiesUTF8($address_invoice->company),
|
||||
'lastname_invoice' => Tools::htmlentitiesUTF8($address_invoice->lastname),
|
||||
'firstname_invoice' => Tools::htmlentitiesUTF8($address_invoice->firstname),
|
||||
'vat_number_invoice' => Tools::htmlentitiesUTF8($address_invoice->vat_number),
|
||||
'dni_invoice' => Tools::htmlentitiesUTF8($address_invoice->dni),
|
||||
'address1_invoice' => Tools::htmlentitiesUTF8($address_invoice->address1),
|
||||
'address2_invoice' => Tools::htmlentitiesUTF8($address_invoice->address2),
|
||||
@@ -627,7 +624,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'invoice_company' => Tools::htmlentitiesUTF8($address_invoice->company),
|
||||
'invoice_lastname' => Tools::htmlentitiesUTF8($address_invoice->lastname),
|
||||
'invoice_firstname' => Tools::htmlentitiesUTF8($address_invoice->firstname),
|
||||
'invoice_vat_number' => Tools::htmlentitiesUTF8($address_invoice->vat_number),
|
||||
'invoice_dni' => Tools::htmlentitiesUTF8($address_invoice->dni),
|
||||
'invoice_address' => $this->context->cart->id_address_invoice !== $this->context->cart->id_address_delivery,
|
||||
'invoice_address1' => Tools::htmlentitiesUTF8($address_invoice->address1),
|
||||
|
||||
@@ -158,7 +158,7 @@ class ProductControllerCore extends FrontController
|
||||
$id_category = (int)$this->product->id_category_default;
|
||||
}
|
||||
$this->category = new Category((int)$id_category, (int)$this->context->cookie->id_lang);
|
||||
if (isset($this->context->cookie) && isset($this->category->id_category) && !(Module::isInstalled('blockcategories') && Module::isEnabled('blockcategories'))) {
|
||||
if (isset($this->context->cookie) && isset($this->category->id_category)) {
|
||||
$this->context->cookie->last_visited_category = (int)$this->category->id_category;
|
||||
}
|
||||
}
|
||||
@@ -304,19 +304,6 @@ class ProductControllerCore extends FrontController
|
||||
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
|
||||
}
|
||||
|
||||
$obj_htl_cart_booking_data = new HotelCartBookingData();
|
||||
$obj_booking_detail = new HotelBookingDetail();
|
||||
$num_days = $obj_booking_detail->getNumberOfDays($date_from, $date_to);
|
||||
//$price_tax_incl = Product::getPriceStatic($this->product->id, HotelBookingDetail::useTax());
|
||||
//$total_price = $price_tax_incl * $num_days;
|
||||
//// By webkul New way to calculate product prices with feature Prices
|
||||
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($this->product->id, $date_from, $date_to);
|
||||
if ($useTax) {
|
||||
$total_price = $roomTypeDateRangePrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$total_price = $roomTypeDateRangePrice['total_price_tax_excl'];
|
||||
}
|
||||
//END
|
||||
$obj_booking_dtl = new HotelBookingDetail();
|
||||
$hotel_room_data = $obj_booking_dtl->DataForFrontSearch($date_from, $date_to, $hotel_id, $this->product->id, 1);
|
||||
|
||||
@@ -324,12 +311,6 @@ class ProductControllerCore extends FrontController
|
||||
$total_available_rooms = $hotel_room_data['stats']['num_avail'];
|
||||
}
|
||||
$hotel_branch_obj = new HotelBranchInformation($hotel_id);
|
||||
if (isset($this->context->cart->id)) {
|
||||
$num_cart_rooms = $obj_htl_cart_booking_data->getCountRoomsByIdCartIdProduct($this->context->cart->id, $this->product->id, $date_from, $date_to);
|
||||
if ($num_cart_rooms) {
|
||||
$total_available_rooms = $total_available_rooms - $num_cart_rooms;
|
||||
}
|
||||
}
|
||||
/*Max date of ordering for order restrict*/
|
||||
$order_date_restrict = false;
|
||||
$max_order_date = HotelOrderRestrictDate::getMaxOrderDate($hotel_id);
|
||||
@@ -362,9 +343,7 @@ class ProductControllerCore extends FrontController
|
||||
'warning_num' => Configuration::get('WK_ROOM_LEFT_WARNING_NUMBER'),
|
||||
'ratting_img_path' => _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png',
|
||||
'total_available_rooms' => $total_available_rooms,
|
||||
'total_price' => $total_price,
|
||||
'product_controller_url' => $this->context->link->getPageLink('product'),
|
||||
'num_days' => $num_days,
|
||||
'date_from' => $date_from,
|
||||
'date_to' => $date_to,
|
||||
'hotel_check_in' => date('h:i a', strtotime($hotel_branch_obj->check_in)),
|
||||
@@ -373,10 +352,14 @@ class ProductControllerCore extends FrontController
|
||||
'hotel_name' => $hotel_name,
|
||||
'hotel_policies' => $hotel_policies,
|
||||
'hotel_features' => $htl_features,
|
||||
'hotel_has_images' => (bool) HotelImage::getCover($hotel_id),
|
||||
'ftr_img_src' => _PS_IMG_.'rf/',
|
||||
'order_date_restrict' => $order_date_restrict
|
||||
)
|
||||
);
|
||||
|
||||
$this->assignBookingFormVars($this->product->id, $date_from, $date_to);
|
||||
|
||||
// product price after imposing feature prices...
|
||||
if ($useTax) {
|
||||
$priceProduct = Product::getPriceStatic($this->product->id, true);
|
||||
@@ -457,6 +440,138 @@ class ProductControllerCore extends FrontController
|
||||
$this->setTemplate(_PS_THEME_DIR_.'product.tpl');
|
||||
}
|
||||
|
||||
public function assignBookingFormVars(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$quantity = 1,
|
||||
$jsonDemands = ''
|
||||
) {
|
||||
$objProduct = new Product($idProduct, true, $this->context->language->id, $this->context->shop->id);
|
||||
if (!Validate::isLoadedObject($objProduct)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$smartyVars = array();
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$objHotel = new HotelBranchInformation();
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$objHRTDemand = new HotelRoomTypeDemand();
|
||||
$objHRTDemandPrice = new HotelRoomTypeDemandPrice();
|
||||
|
||||
$idCart = (int) $this->context->cart->id;
|
||||
$idGuest = (int) $this->context->cart->id_guest;
|
||||
$warningCount = (int) Configuration::get('WK_ROOM_LEFT_WARNING_NUMBER');
|
||||
|
||||
$roomType = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$idHotel = $roomType['id_hotel'];
|
||||
$hotel = $objHotel->hotelBranchesInfo(false, 2, 1, $idHotel);
|
||||
$hotelLocation = $hotel['city'].', '.(isset($hotel['state_name']) ? ' '.$hotel['state_name'].', ' : '').
|
||||
' '.$hotel['country_name'];
|
||||
|
||||
$orderDateRestrict = false;
|
||||
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($idHotel);
|
||||
if ($maxOrderDate) {
|
||||
$maxOrderDate = date('Y-m-d', strtotime($maxOrderDate));
|
||||
if (strtotime('-1 day', strtotime($maxOrderDate)) < strtotime($dateFrom)
|
||||
|| strtotime($maxOrderDate) < strtotime($dateTo)
|
||||
) {
|
||||
$orderDateRestrict = true;
|
||||
}
|
||||
}
|
||||
|
||||
$numDays = $objBookingDetail->getNumberOfDays($dateFrom, $dateTo);
|
||||
|
||||
$hotelRoomData = $objBookingDetail->DataForFrontSearch(
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$idHotel,
|
||||
$idProduct,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
0,
|
||||
$idCart,
|
||||
$idGuest
|
||||
);
|
||||
|
||||
if ($hotelRoomData) {
|
||||
$totalAvailableRooms = $hotelRoomData['stats']['num_avail'];
|
||||
$quantity = ($quantity > $totalAvailableRooms) ? $totalAvailableRooms : $quantity;
|
||||
}
|
||||
|
||||
// calculate room type price first
|
||||
$useTax = HotelBookingDetail::useTax();
|
||||
$totalPrice = 0;
|
||||
$productPriceWithoutReduction = $objProduct->getPriceWithoutReduct(!$useTax);
|
||||
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
);
|
||||
|
||||
$featurePrice = 0;
|
||||
if ($useTax) {
|
||||
$featurePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
true
|
||||
);
|
||||
$roomTypeDateRangePrice = $roomTypeDateRangePrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$featurePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
false
|
||||
);
|
||||
$roomTypeDateRangePrice = $roomTypeDateRangePrice['total_price_tax_excl'];
|
||||
}
|
||||
$featurePriceDiff = (float) ($productPriceWithoutReduction - $featurePrice);
|
||||
|
||||
$totalRoomPrice = $roomTypeDateRangePrice * $quantity;
|
||||
|
||||
// calculate demand price now
|
||||
$demandsPrice = 0;
|
||||
$roomTypeDemands = $objHRTDemand->getRoomTypeDemands($idProduct);
|
||||
if ($jsonDemands !== '') {
|
||||
$cartDemands = json_decode($jsonDemands, true);
|
||||
$demandsPrice = $objHRTDemandPrice->getRoomTypeDemandsTotalPrice(
|
||||
$idProduct,
|
||||
$cartDemands,
|
||||
$useTax,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
);
|
||||
|
||||
$demandsPrice *= $quantity;
|
||||
}
|
||||
|
||||
// calculate total price
|
||||
$totalPrice = $totalRoomPrice + $demandsPrice;
|
||||
|
||||
$smartyVars['hotel_location'] = $hotelLocation;
|
||||
$smartyVars['order_date_restrict'] = $orderDateRestrict;
|
||||
$smartyVars['max_order_date'] = $maxOrderDate;
|
||||
$smartyVars['date_from'] = $dateFrom;
|
||||
$smartyVars['date_to'] = $dateTo;
|
||||
$smartyVars['allow_oosp'] = $objProduct->isAvailableWhenOutOfStock((int) $objProduct->out_of_stock);
|
||||
$smartyVars['quantity'] = $quantity;
|
||||
$smartyVars['num_days'] = $numDays;
|
||||
$smartyVars['warning_count'] = $warningCount;
|
||||
$smartyVars['total_available_rooms'] = $totalAvailableRooms;
|
||||
$smartyVars['has_room_type_demands'] = $roomTypeDemands ? true : false; // whether to show price breakup
|
||||
$smartyVars['rooms_price'] = $totalRoomPrice;
|
||||
$smartyVars['demands_price'] = $demandsPrice;
|
||||
$smartyVars['total_price'] = $totalPrice;
|
||||
$this->context->smarty->assign($smartyVars);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign price and tax to the template
|
||||
*/
|
||||
@@ -922,6 +1037,33 @@ class ProductControllerCore extends FrontController
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
public function displayAjaxRefreshBookingForm()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
$idProduct = (int) Tools::getValue('id_product');
|
||||
$dateFrom = Tools::getValue('date_from');
|
||||
$dateTo = Tools::getValue('date_to');
|
||||
$quantity = (int) Tools::getValue('quantity');
|
||||
$roomTypeDemands = Tools::getValue('room_type_demands');
|
||||
|
||||
$dateFrom = date('Y-m-d', strtotime($dateFrom));
|
||||
$dateTo = date('Y-m-d', strtotime($dateTo));
|
||||
|
||||
if ($this->assignBookingFormVars(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$quantity,
|
||||
$roomTypeDemands
|
||||
)) {
|
||||
$html = $this->context->smarty->fetch('_partials/booking-form.tpl');
|
||||
$response['status'] = true;
|
||||
$response['html_booking_form'] = $html;
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function displayAjaxCheckRoomAvailabilityAndRate()
|
||||
{
|
||||
$result = array();
|
||||
@@ -1017,4 +1159,40 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
die(json_encode($result));
|
||||
}
|
||||
|
||||
public function displayAjaxGetHotelImages()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
$idProduct = (int) Tools::getValue('id_product');
|
||||
$page = (int) Tools::getValue('page');
|
||||
$imagesPerPage = (int) Configuration::get('PS_HOTEL_IMAGES_PER_PAGE');
|
||||
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$objHotelImage = new HotelImage();
|
||||
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$hotelImages = $objHotelImage->getImagesByHotelId($idHotel, $page, $imagesPerPage);
|
||||
$hasNextPage = ($objHotelImage->getImagesByHotelId($idHotel, $page + 1, $imagesPerPage)) ? true : false;
|
||||
$hotelImagesBaseDir = _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_img/';
|
||||
foreach ($hotelImages as &$hotelImage) {
|
||||
$hotelImage['link'] = $this->context->link->getMediaLink(
|
||||
$hotelImagesBaseDir.$hotelImage['hotel_image_id'].'.jpg'
|
||||
);
|
||||
}
|
||||
|
||||
if (is_array($hotelImages) && count($hotelImages)) {
|
||||
$this->context->smarty->assign(array('hotel_images' => $hotelImages));
|
||||
$html = $this->context->smarty->fetch(
|
||||
$this->getTemplatePath('_partials/hotel_images.tpl')
|
||||
);
|
||||
|
||||
$response['html'] = $html;
|
||||
$response['status'] = true;
|
||||
$response['has_next_page'] = $hasNextPage;
|
||||
$response['message'] = 'HTML_OK';
|
||||
}
|
||||
|
||||
die(json_encode($response));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,22 +46,6 @@ class SitemapControllerCore extends FrontController
|
||||
$this->context->smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0));
|
||||
$this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1));
|
||||
$this->context->smarty->assign('voucherAllowed', (int)CartRule::isFeatureActive());
|
||||
|
||||
if (Module::isInstalled('blockmanufacturer') && Module::isEnabled('blockmanufacturer')) {
|
||||
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
|
||||
$this->context->smarty->assign('display_manufacturer_link', isset($blockmanufacturer->active) ? (bool)$blockmanufacturer->active : false);
|
||||
} else {
|
||||
$this->context->smarty->assign('display_manufacturer_link', 0);
|
||||
}
|
||||
|
||||
if (Module::isInstalled('blocksupplier') && Module::isEnabled('blocksupplier')) {
|
||||
$blocksupplier = Module::getInstanceByName('blocksupplier');
|
||||
$this->context->smarty->assign('display_supplier_link', isset($blocksupplier->active) ? (bool)$blocksupplier->active : false);
|
||||
} else {
|
||||
$this->context->smarty->assign('display_supplier_link', 0);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
|
||||
$this->context->smarty->assign('PS_DISPLAY_BEST_SELLERS', Configuration::get('PS_DISPLAY_BEST_SELLERS'));
|
||||
$this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
|
||||
|
||||
|
||||
BIN
img/logo.jpg
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -43,6 +43,7 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
|
||||
$this->session->install_type = Tools::getValue('db_mode');
|
||||
$this->session->shop_country = Tools::getValue('shop_country');
|
||||
$this->session->shop_timezone = Tools::getValue('shop_timezone');
|
||||
$this->session->enable_ssl = Tools::getValue('enable_ssl');
|
||||
|
||||
// Save admin configuration
|
||||
$this->session->admin_firstname = trim(Tools::getValue('admin_firstname'));
|
||||
@@ -306,6 +307,11 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
|
||||
// Install type
|
||||
$this->install_type = ($this->session->install_type) ? $this->session->install_type : 'full';
|
||||
|
||||
// Detect SSL mode
|
||||
if (!isset($this->session->enable_ssl)) {
|
||||
$this->session->enable_ssl = Tools::usingSecureMode() ? '1' : '0';
|
||||
}
|
||||
|
||||
$this->displayTemplate('configure');
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,7 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
'shop_activity' => $this->session->shop_activity,
|
||||
'shop_country' => $this->session->shop_country,
|
||||
'shop_timezone' => $this->session->shop_timezone,
|
||||
'enable_ssl' => $this->session->enable_ssl,
|
||||
'admin_firstname' => $this->session->admin_firstname,
|
||||
'admin_lastname' => $this->session->admin_lastname,
|
||||
'admin_password' => $this->session->admin_password,
|
||||
|
||||
@@ -2,6 +2,7 @@ SET NAMES 'utf8';
|
||||
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_CONDITIONS';
|
||||
UPDATE `PREFIX_configuration` SET value = '12' WHERE name = 'PS_PRODUCTS_PER_PAGE';
|
||||
UPDATE `PREFIX_configuration` SET value = '9' WHERE name = 'PS_HOTEL_IMAGES_PER_PAGE';
|
||||
UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'PS_PRODUCTS_ORDER_WAY';
|
||||
UPDATE `PREFIX_configuration` SET value = '4' WHERE name = 'PS_PRODUCTS_ORDER_BY';
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_DISPLAY_QTIES';
|
||||
@@ -28,7 +29,7 @@ UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'PS_BLOCK_SPECIALS_DI
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_STORES_DISPLAY_CMS';
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_STORES_DISPLAY_FOOTER';
|
||||
UPDATE `PREFIX_configuration` SET value = '243' WHERE name = 'SHOP_LOGO_WIDTH';
|
||||
UPDATE `PREFIX_configuration` SET value = '61' WHERE name = 'SHOP_LOGO_HEIGHT';
|
||||
UPDATE `PREFIX_configuration` SET value = '120' WHERE name = 'SHOP_LOGO_HEIGHT';
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_DISPLAY_SUPPLIERS';
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_DISPLAY_BEST_SELLERS';
|
||||
UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'PS_LEGACY_IMAGES';
|
||||
@@ -42,12 +43,10 @@ UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'MANUFACTURER_DISPLAY
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'MANUFACTURER_DISPLAY_TEXT';
|
||||
UPDATE `PREFIX_configuration` SET value = '5' WHERE name = 'MANUFACTURER_DISPLAY_TEXT_NB';
|
||||
UPDATE `PREFIX_configuration` SET value = '8' WHERE name = 'NEW_PRODUCTS_NBR';
|
||||
UPDATE `PREFIX_configuration` SET value = '10' WHERE name = 'BLOCKTAGS_NBR';
|
||||
UPDATE `PREFIX_configuration` SET value = '0_3|0_4' WHERE name = 'FOOTER_CMS';
|
||||
UPDATE `PREFIX_configuration` SET value = '0_3|0_4' WHERE name = 'FOOTER_BLOCK_ACTIVATION';
|
||||
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'FOOTER_POWEREDBY';
|
||||
UPDATE `PREFIX_configuration` SET value = 'https://qloapps.com/' WHERE name = 'BLOCKADVERT_LINK';
|
||||
UPDATE `PREFIX_configuration` SET value = 'store.jpg' WHERE name = 'BLOCKSTORE_IMG';
|
||||
UPDATE `PREFIX_configuration` SET value = 'jpg' WHERE name = 'BLOCKADVERT_IMG_EXT';
|
||||
UPDATE `PREFIX_configuration` SET value = 'CAT3,CAT8,CAT5,LNK1' WHERE name = 'MOD_BLOCKTOPMENU_ITEMS';
|
||||
UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'MOD_BLOCKTOPMENU_SEARCH';
|
||||
@@ -106,9 +105,6 @@ AND id_hook = @id_hook;
|
||||
|
||||
/* displayTop */
|
||||
SET @id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayTop');
|
||||
UPDATE `PREFIX_hook_module` SET position = 1
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blocksearch')
|
||||
AND id_hook = @id_hook;
|
||||
|
||||
UPDATE `PREFIX_hook_module` SET position = 3
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blocktopmenu')
|
||||
@@ -130,10 +126,6 @@ UPDATE `PREFIX_hook_module` SET position = 1
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blocknewproducts')
|
||||
AND id_hook IN (@id_hook, @id_hook2);
|
||||
|
||||
UPDATE `PREFIX_hook_module` SET position = 2
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'homefeatured')
|
||||
AND id_hook IN (@id_hook, @id_hook2);
|
||||
|
||||
UPDATE `PREFIX_hook_module` SET position = 3
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockbestsellers')
|
||||
AND id_hook IN (@id_hook, @id_hook2);
|
||||
@@ -148,14 +140,6 @@ UPDATE `PREFIX_hook_module` SET position = 2
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blocksocial')
|
||||
AND id_hook = @id_hook;
|
||||
|
||||
UPDATE `PREFIX_hook_module` SET position = 3
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcategories')
|
||||
AND id_hook = @id_hook;
|
||||
|
||||
UPDATE `PREFIX_hook_module` SET position = 4
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcms')
|
||||
AND id_hook = @id_hook;
|
||||
|
||||
UPDATE `PREFIX_hook_module` SET position = 5
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockmyaccountfooter')
|
||||
AND id_hook = @id_hook;
|
||||
@@ -169,9 +153,6 @@ SET @id_hook = (SELECT id_hook FROM `PREFIX_hook` WHERE name = 'displayProductBu
|
||||
UPDATE `PREFIX_hook_module` SET position = 1
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockwishlist')
|
||||
AND id_hook = @id_hook;
|
||||
UPDATE `PREFIX_hook_module` SET position = 2
|
||||
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'productpaymentlogos')
|
||||
AND id_hook = @id_hook;
|
||||
|
||||
INSERT INTO `PREFIX_hook_module_exceptions` (`id_shop`, `id_module`, `id_hook`, `file_name`)
|
||||
(
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
<configuration id="PS_PRODUCTS_PER_PAGE" name="PS_PRODUCTS_PER_PAGE">
|
||||
<value>12</value>
|
||||
</configuration>
|
||||
<configuration id="PS_HOTEL_IMAGES_PER_PAGE" name="PS_HOTEL_IMAGES_PER_PAGE">
|
||||
<value>9</value>
|
||||
</configuration>
|
||||
<configuration id="PS_PURCHASE_MINIMUM" name="PS_PURCHASE_MINIMUM">
|
||||
<value>0</value>
|
||||
</configuration>
|
||||
@@ -605,7 +608,7 @@
|
||||
<configuration id="BLOCKTAGS_NBR" name="BLOCKTAGS_NBR">
|
||||
<value>10</value>
|
||||
</configuration>
|
||||
<configuration id="HOTEL_CHECKUP_DESCRIPTIONS_LT" name="HOTEL_CHECKUP_DESCRIPTIONS_LT">
|
||||
<configuration id="HOTEL_CHECKUP_DESCRIPTIONS_LT" name="HOTEL_CHECKUP_DESCRIPTIONS_LT">
|
||||
<value>100</value>
|
||||
</configuration>
|
||||
<configuration id="HOTEL_CHECKUP_DESCRIPTIONS_GT" name="HOTEL_CHECKUP_DESCRIPTIONS_GT">
|
||||
@@ -665,9 +668,6 @@
|
||||
<configuration id="BLOCKADVERT_LINK" name="BLOCKADVERT_LINK">
|
||||
<value>http://www.qloapps.com</value>
|
||||
</configuration>
|
||||
<configuration id="BLOCKSTORE_IMG" name="BLOCKSTORE_IMG">
|
||||
<value>store.jpg</value>
|
||||
</configuration>
|
||||
<configuration id="BLOCKADVERT_IMG_EXT" name="BLOCKADVERT_IMG_EXT">
|
||||
<value>jpg</value>
|
||||
</configuration>
|
||||
@@ -683,26 +683,6 @@
|
||||
<configuration id="blocksocial_twitter" name="BLOCKSOCIAL_TWITTER">
|
||||
<value>http://www.twitter.com/qloapps</value>
|
||||
</configuration>
|
||||
<configuration id="blockcontactinfos_company" name="BLOCKCONTACTINFOS_COMPANY">
|
||||
<value>Your company</value>
|
||||
</configuration>
|
||||
<configuration id="blockcontactinfos_address" name="BLOCKCONTACTINFOS_ADDRESS">
|
||||
<value>Address line 1
|
||||
City
|
||||
Country</value>
|
||||
</configuration>
|
||||
<configuration id="blockcontactinfos_phone" name="BLOCKCONTACTINFOS_PHONE">
|
||||
<value>0123-456-789</value>
|
||||
</configuration>
|
||||
<configuration id="blockcontactinfos_email" name="BLOCKCONTACTINFOS_EMAIL">
|
||||
<value>pub@qloapps.com</value>
|
||||
</configuration>
|
||||
<configuration id="blockcontact_telnumber" name="BLOCKCONTACT_TELNUMBER">
|
||||
<value>0123-456-789</value>
|
||||
</configuration>
|
||||
<configuration id="blockcontact_email" name="BLOCKCONTACT_EMAIL">
|
||||
<value>pub@qloapps.com</value>
|
||||
</configuration>
|
||||
<configuration id="SUPPLIER_DISPLAY_TEXT" name="SUPPLIER_DISPLAY_TEXT">
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
@@ -724,18 +704,6 @@ Country</value>
|
||||
<configuration id="BLOCKREINSURANCE_NBBLOCKS" name="BLOCKREINSURANCE_NBBLOCKS">
|
||||
<value>5</value>
|
||||
</configuration>
|
||||
<configuration id="HOMESLIDER_WIDTH" name="HOMESLIDER_WIDTH">
|
||||
<value>535</value>
|
||||
</configuration>
|
||||
<configuration id="HOMESLIDER_SPEED" name="HOMESLIDER_SPEED">
|
||||
<value>1300</value>
|
||||
</configuration>
|
||||
<configuration id="HOMESLIDER_PAUSE" name="HOMESLIDER_PAUSE">
|
||||
<value>7700</value>
|
||||
</configuration>
|
||||
<configuration id="HOMESLIDER_LOOP" name="HOMESLIDER_LOOP">
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
<configuration id="PS_BASE_DISTANCE_UNIT" name="PS_BASE_DISTANCE_UNIT">
|
||||
<value>m</value>
|
||||
</configuration>
|
||||
|
||||
@@ -443,6 +443,7 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
'shop_activity' => '',
|
||||
'shop_country' => 'us',
|
||||
'shop_timezone' => 'US/Eastern',
|
||||
'enable_ssl' => false,
|
||||
'use_smtp' => false,
|
||||
'smtp_encryption' => 'off',
|
||||
'smtp_port' => 25,
|
||||
@@ -477,6 +478,10 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
Configuration::updateGlobalValue('PS_TIMEZONE', $data['shop_timezone']);
|
||||
Configuration::updateGlobalValue('PS_CONFIGURATION_AGREMENT', (int)$data['configuration_agrement']);
|
||||
|
||||
// Set SSL configuration
|
||||
Configuration::updateGlobalValue('PS_SSL_ENABLED', (int) $data['enable_ssl']);
|
||||
Configuration::updateGlobalValue('PS_SSL_ENABLED_EVERYWHERE', (int) $data['enable_ssl']);
|
||||
|
||||
// Set mails configuration
|
||||
Configuration::updateGlobalValue('PS_MAIL_METHOD', ($data['use_smtp']) ? 2 : 1);
|
||||
Configuration::updateGlobalValue('PS_MAIL_SMTP_ENCRYPTION', $data['smtp_encryption']);
|
||||
@@ -654,8 +659,9 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
'bankwire',
|
||||
'cheque',
|
||||
'blockmyaccount',
|
||||
'blocklanguages',
|
||||
'qloblockcontact',
|
||||
'blockcurrencies',
|
||||
'blocklanguages',
|
||||
'productcomments',
|
||||
'wkfooterlangcurrencyblock',
|
||||
'wkfooterpaymentinfoblockcontainer',
|
||||
|
||||
@@ -36,10 +36,9 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
|
||||
</div>
|
||||
*/ ?>
|
||||
|
||||
<?php if (_PS_MODE_DEV_): ?>
|
||||
<!-- Install type (with fixtures or not) -->
|
||||
<div class="field clearfix">
|
||||
<label class="aligned"><?php echo $this->l('Install demo products') ?></label>
|
||||
<label class="aligned"><?php echo $this->l('Install demo data') ?></label>
|
||||
<div class="contentinput">
|
||||
<label>
|
||||
<input value="full" type="radio" name="db_mode" style="vertical-align: middle;" <?php if ($this->install_type == 'full'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
|
||||
@@ -50,11 +49,8 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
|
||||
<?php echo $this->l('No'); ?>
|
||||
</label>
|
||||
</div>
|
||||
<p class="userInfos aligned"><?php echo $this->l('Demo data are a good way to learn how to use QloApps. You should install them if you are not familiar with it.') ?></p>
|
||||
<p class="userInfos aligned"><?php echo $this->l('Installing demo data is a good way to learn how to use QloApps if you have not used it before. This demo data can later be erased using module QloApps Data Cleaner which comes pre-installed with this installation.') ?></p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<input value="full" name="db_mode" type="hidden" />
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Country list -->
|
||||
<div class="field clearfix">
|
||||
@@ -86,6 +82,21 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
|
||||
<?php echo $this->displayError('shop_timezone') ?>
|
||||
</div>
|
||||
|
||||
<!-- Enable SSL -->
|
||||
<div class="field clearfix">
|
||||
<label class="aligned"><?php echo $this->l('Enable SSL') ?></label>
|
||||
<div class="contentinput">
|
||||
<label>
|
||||
<input value="1" type="radio" name="enable_ssl" style="vertical-align: middle;" <?php if ($this->session->enable_ssl == '1'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
|
||||
<?php echo $this->l('Yes') ?>
|
||||
</label>
|
||||
<label>
|
||||
<input value="0" type="radio" name="enable_ssl" style="vertical-align: middle;" <?php if ($this->session->enable_ssl == '0'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
|
||||
<?php echo $this->l('No'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Shop logo
|
||||
<div class="field clearfix">
|
||||
<label for="uploadedImage" class="aligned logo"><?php echo $this->l('Shop logo') ?></label>
|
||||
|
||||
19
js/admin.js
@@ -1321,21 +1321,6 @@ function ajaxStates(id_state_selected)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (module_dir && vat_number)
|
||||
{
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: window.location.origin + module_dir + "vatnumber/ajax.php?id_country=" + $('#id_country').val(),
|
||||
success: function(isApplicable)
|
||||
{
|
||||
if(isApplicable == 1)
|
||||
$('#vat_area').show();
|
||||
else
|
||||
$('#vat_area').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function check_for_all_accesses(tabsize, tabnumber)
|
||||
@@ -1528,14 +1513,14 @@ function parseDate(date){
|
||||
return $.datepicker.parseDate("yy-mm-dd", date);
|
||||
}
|
||||
|
||||
function refresh_kpis(callFunction)
|
||||
function refresh_kpis()
|
||||
{
|
||||
$('.box-stats').each(function() {
|
||||
if ($(this).attr('id')) {
|
||||
var functionName = 'refresh_' + $(this).attr('id').replace(/-/g, '_');
|
||||
|
||||
if (typeof window[functionName] === 'function') {
|
||||
window[functionName](callFunction);
|
||||
window[functionName]();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -326,16 +326,17 @@ function init()
|
||||
|
||||
$('.edit_product_fields, .standard_refund_fields, .partial_refund_fields, .order_action').hide();
|
||||
$('tr#new_product').slideDown('fast', function () {
|
||||
$('tr#new_product td').fadeIn('fast', function() {
|
||||
$('tr#new_product td').fadeIn('fast').promise().done(function () {
|
||||
$('#add_product_product_name').focus();
|
||||
scroll_if_anchor('#new_product');
|
||||
scroll_if_anchor('#new_product', 360);
|
||||
});
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#cancelAddProduct').unbind('click').click(function() {
|
||||
$('.order_action').show();
|
||||
$('.order_action').not('.standard_refund_fields').show();
|
||||
$('tr#new_product td').fadeOut('fast');
|
||||
});
|
||||
|
||||
@@ -366,6 +367,7 @@ function init()
|
||||
id_currency: id_currency,
|
||||
id_address: id_address,
|
||||
id_customer: id_customer,
|
||||
id_order: id_order,
|
||||
product_search: function() { return $('#add_product_product_name').val(); }
|
||||
}
|
||||
}
|
||||
@@ -539,7 +541,7 @@ function init()
|
||||
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
jAlert("Impossible to add the room to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
complete: function() {
|
||||
$('#submitAddProduct').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
@@ -641,6 +643,8 @@ function init()
|
||||
element_list.find('td .booking_duration_show').hide();
|
||||
element_list.find('td .booking_duration_edit').show();
|
||||
}
|
||||
element_list.find('td .room_unit_price_show').hide();
|
||||
element_list.find('td .room_unit_price_edit').show();
|
||||
//element_list.find('td .product_price_show').hide();
|
||||
//element_list.find('td .product_price_edit').show();
|
||||
element_list.find('td.cancelCheck').hide();
|
||||
@@ -679,6 +683,8 @@ function init()
|
||||
element_list.find('td .booking_duration_show').show();
|
||||
element_list.find('td .product_price_edit').hide();
|
||||
element_list.find('td .booking_duration_edit').hide();
|
||||
element_list.find('td .room_unit_price_show').show();
|
||||
element_list.find('td .room_unit_price_edit').hide();
|
||||
element_list.find('td.product_invoice').hide();
|
||||
element_list.find('td.cancelCheck').show();
|
||||
element_list.find('td.cancelQuantity').show();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
{$data_v['adult']} {l s='Adults'}, {$data_v['children']} {l s='Children'}
|
||||
|
||||
{convertPrice price=$data_v['unit_price']}
|
||||
{convertPrice price=$rm_v['avg_paid_unit_price_tax_incl']}
|
||||
|
||||
{$rm_v['num_rm']}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
{$rm_v['data_to']|date_format:"%d-%b-%G"}
|
||||
|
||||
{$rm_v['amount']}
|
||||
{$rm_v['amount_tax_incl']}
|
||||
|
||||
|
||||
{/foreach}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
------------------------------
|
||||
# V0.10.1 to V0.10.2
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
* [CO] :Images link are now generated dynamically
|
||||
|
||||
_____________________________________________________________________________
|
||||
|
||||
2014-04-22 18:56:48 +0200 // Changelog updated
|
||||
2014-04-15 17:23:48 +0200 [*] MO : blockadvertising - Changed the way images are stocked to avoid overwrite on update
|
||||
2014-03-24 10:44:25 +0100 // MO BlockAdvertising : ps_versions_compliancy added
|
||||
2014-03-20 14:19:12 +0100 Initial commit
|
||||
@@ -1,292 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class BlockAdvertising extends Module
|
||||
{
|
||||
/* Title associated to the image */
|
||||
public $adv_title;
|
||||
|
||||
/* Link associated to the image */
|
||||
public $adv_link;
|
||||
|
||||
/* Name of the image without extension */
|
||||
public $adv_imgname;
|
||||
|
||||
/* Image path with extension */
|
||||
public $adv_img;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockadvertising';
|
||||
$this->tab = 'advertising_marketing';
|
||||
$this->version = '0.10.2';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Advertising block');
|
||||
$this->description = $this->l('Adds an advertisement block to selected sections of your e-commerce website.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
|
||||
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the properties of the module, like the link to the image and the title (contextual to the current shop context)
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
$this->adv_imgname = 'advertising';
|
||||
if ((Shop::getContext() == Shop::CONTEXT_GROUP || Shop::getContext() == Shop::CONTEXT_SHOP)
|
||||
&& (bool)Tools::file_get_contents($this->context->link->getMediaLink(_MODULE_DIR_.$this->name.'/img/'.$this->adv_imgname.'-g'.$this->context->shop->getContextShopGroupID().'.'.Configuration::get('BLOCKADVERT_IMG_EXT'))) //bywebkul
|
||||
)
|
||||
$this->adv_imgname .= '-g'.$this->context->shop->getContextShopGroupID();
|
||||
if (Shop::getContext() == Shop::CONTEXT_SHOP
|
||||
&& (bool)Tools::file_get_contents($this->context->link->getMediaLink(_MODULE_DIR_.$this->name.'/img/'.$this->adv_imgname.'-s'.$this->context->shop->getContextShopID().'.'.Configuration::get('BLOCKADVERT_IMG_EXT'))) // by webkul
|
||||
)
|
||||
$this->adv_imgname .= '-s'.$this->context->shop->getContextShopID();
|
||||
|
||||
// If none of them available go default
|
||||
if ($this->adv_imgname == 'advertising')
|
||||
$this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/img/fixtures/'.$this->adv_imgname.'.jpg';
|
||||
else
|
||||
$this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/img/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT');
|
||||
$this->adv_link = htmlentities(Configuration::get('BLOCKADVERT_LINK'), ENT_QUOTES, 'UTF-8');
|
||||
$this->adv_title = htmlentities(Configuration::get('BLOCKADVERT_TITLE'), ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install())
|
||||
return false;
|
||||
|
||||
// Hook the module either on the left or right column
|
||||
$theme = new Theme(Context::getContext()->shop->id_theme);
|
||||
if ((!$theme->default_left_column || !$this->registerHook('leftColumn'))
|
||||
&& (!$theme->default_right_column || !$this->registerHook('rightColumn'))
|
||||
)
|
||||
{
|
||||
// If there are no colums implemented by the template, throw an error and uninstall the module
|
||||
$this->_errors[] = $this->l('This module needs to be hooked to a column, but your theme does not implement one');
|
||||
parent::uninstall();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Configuration::updateGlobalValue('BLOCKADVERT_LINK', 'http://www.prestashop.com/');
|
||||
Configuration::updateGlobalValue('BLOCKADVERT_TITLE', 'PrestaShop');
|
||||
// Try to update with the extension of the image that exists in the module directory
|
||||
foreach (scandir(_PS_MODULE_DIR_.$this->name) as $file)
|
||||
if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png')))
|
||||
Configuration::updateGlobalValue('BLOCKADVERT_IMG_EXT', substr($file, strrpos($file, '.') + 1));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
Configuration::deleteByName('BLOCKADVERT_LINK');
|
||||
Configuration::deleteByName('BLOCKADVERT_TITLE');
|
||||
Configuration::deleteByName('BLOCKADVERT_IMG_EXT');
|
||||
|
||||
return (parent::uninstall());
|
||||
}
|
||||
|
||||
/**
|
||||
* delete the contextual image (it is not allowed to delete the default image)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _deleteCurrentImg()
|
||||
{
|
||||
// Delete the image file
|
||||
if ($this->adv_imgname != 'advertising' && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_PS_MODULE_DIR_.$this->name.'/img/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT')))) // by webkul
|
||||
Tools::deleteFile(_PS_MODULE_DIR_.$this->name.'/img/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'));
|
||||
|
||||
// Update the extension to the global value or the shop group value if available
|
||||
Configuration::deleteFromContext('BLOCKADVERT_IMG_EXT');
|
||||
Configuration::updateValue('BLOCKADVERT_IMG_EXT', Configuration::get('BLOCKADVERT_IMG_EXT'));
|
||||
|
||||
// Reset the properties of the module
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitDeleteImgConf'))
|
||||
$this->_deleteCurrentImg();
|
||||
|
||||
$errors = '';
|
||||
if (Tools::isSubmit('submitAdvConf'))
|
||||
{
|
||||
if (isset($_FILES['adv_img']) && isset($_FILES['adv_img']['tmp_name']) && !empty($_FILES['adv_img']['tmp_name']))
|
||||
{
|
||||
if ($error = ImageManager::validateUpload($_FILES['adv_img'], Tools::convertBytes(ini_get('upload_max_filesize'))))
|
||||
$errors .= $error;
|
||||
else
|
||||
{
|
||||
Configuration::updateValue('BLOCKADVERT_IMG_EXT', substr($_FILES['adv_img']['name'], strrpos($_FILES['adv_img']['name'], '.') + 1));
|
||||
|
||||
// Set the image name with a name contextual to the shop context
|
||||
$this->adv_imgname = 'advertising';
|
||||
if (Shop::getContext() == Shop::CONTEXT_GROUP)
|
||||
$this->adv_imgname = 'advertising-g'.(int)$this->context->shop->getContextShopGroupID();
|
||||
elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
|
||||
$this->adv_imgname = 'advertising-s'.(int)$this->context->shop->getContextShopID();
|
||||
|
||||
// Copy the image in the module directory with its new name
|
||||
if(!ImageManager::resize($_FILES['adv_img']['tmp_name'], _PS_MODULE_DIR_.$this->name.'/img/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'))) { //by webkul
|
||||
$errors .= $this->l('File upload error.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If the link is not set, then delete it in order to use the next default value (either the global value or the group value)
|
||||
if ($link = Tools::getValue('adv_link'))
|
||||
Configuration::updateValue('BLOCKADVERT_LINK', $link);
|
||||
elseif (Shop::getContext() == Shop::CONTEXT_SHOP || Shop::getContext() == Shop::CONTEXT_GROUP)
|
||||
Configuration::deleteFromContext('BLOCKADVERT_LINK');
|
||||
|
||||
// If the title is not set, then delete it in order to use the next default value (either the global value or the group value)
|
||||
if ($title = Tools::getValue('adv_title'))
|
||||
Configuration::updateValue('BLOCKADVERT_TITLE', $title);
|
||||
elseif (Shop::getContext() == Shop::CONTEXT_SHOP || Shop::getContext() == Shop::CONTEXT_GROUP)
|
||||
Configuration::deleteFromContext('BLOCKADVERT_TITLE');
|
||||
|
||||
// Reset the module properties
|
||||
$this->initialize();
|
||||
$this->_clearCache('blockadvertising.tpl');
|
||||
|
||||
if (!$errors)
|
||||
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&conf=6');
|
||||
echo $this->displayError($errors);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* getContent used to display admin module form
|
||||
*
|
||||
* @return string content
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
$this->postProcess();
|
||||
|
||||
return $this->renderForm();
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
if (!$this->isCached('blockadvertising.tpl', $this->getCacheId()))
|
||||
$this->smarty->assign(
|
||||
array(
|
||||
'image' => $this->context->link->protocol_content.$this->adv_img,
|
||||
'adv_link' => $this->adv_link,
|
||||
'adv_title' => $this->adv_title,
|
||||
)
|
||||
);
|
||||
|
||||
return $this->display(__FILE__, 'blockadvertising.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
return $this->hookRightColumn($params);
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'blockadvertising.css', 'all');
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Configuration'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Image for the advertisement'),
|
||||
'name' => 'adv_img',
|
||||
'desc' => $this->l('By default the image will appear in the left column. The recommended dimensions are 155 x 163px.'),
|
||||
'thumb' => $this->context->link->protocol_content.$this->adv_img,
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Target link for the image'),
|
||||
'name' => 'adv_link',
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Title of the target link'),
|
||||
'name' => 'adv_title',
|
||||
'desc' => $this->l('This title will be displayed when you mouse over the advertisement block in your shop.')
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$this->fields_form = array();
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitAdvConf';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return array(
|
||||
'adv_link' => Tools::getValue('adv_link', Configuration::get('BLOCKADVERT_LINK')),
|
||||
'adv_title' => Tools::getValue('adv_title', Configuration::get('BLOCKADVERT_TITLE')),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- MODULE Block advertising -->
|
||||
<div class="advertising_block">
|
||||
<a href="{$adv_link}" title="{$adv_title}"><img src="{$image}" alt="{$adv_title}" title="{$adv_title}" width="155" height="163" /></a>
|
||||
</div>
|
||||
<!-- /MODULE Block advertising -->
|
||||
|
Before Width: | Height: | Size: 5.1 KiB |
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_0_9($module)
|
||||
{
|
||||
$module_path = $module->getLocalPath();
|
||||
$img_folder_path = $module->getLocalPath().'img';
|
||||
$fixture_img_path = $module->getLocalPath().'img'.DIRECTORY_SEPARATOR.'fixtures';
|
||||
|
||||
if (!Tools::file_exists_cache($img_folder_path))
|
||||
mkdir($img_folder_path);
|
||||
|
||||
if (!Tools::file_exists_cache($fixture_img_path))
|
||||
mkdir($fixture_img_path);
|
||||
|
||||
$files = scandir($module->getLocalPath());
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if (strncmp($file, 'advertising', 11) == 0)
|
||||
{
|
||||
if ($file == 'advertising.jpg')
|
||||
copy($module_path.$file, $fixture_img_path.DIRECTORY_SEPARATOR.$file);
|
||||
else
|
||||
copy($module_path.$file, $img_folder_path.DIRECTORY_SEPARATOR.$file);
|
||||
|
||||
unlink($module_path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
Tools::clearCache(Context::getContext()->smarty, $module->getTemplatePath('blockadvertising.tpl'));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
------------------------------
|
||||
# V1.4.1 to V1.4.2
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
* [CO] :Images link are now generated dynamically
|
||||
|
||||
_____________________________________________________________________________
|
||||
|
||||
2014-04-22 18:56:51 +0200 // Changelog updated
|
||||
2014-03-24 11:43:28 +0100 / MO blockbanner : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 10:55:56 +0100 / MO blockbanner : ps_versions_compliancy added
|
||||
2014-03-20 14:19:15 +0100 Initial commit
|
||||
@@ -1,253 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class BlockBanner extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockbanner';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.4.2';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Banner block');
|
||||
$this->description = $this->l('Displays a banner at the top of the shop.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return
|
||||
parent::install() &&
|
||||
$this->registerHook('displayBanner') &&
|
||||
$this->registerHook('displayHeader') &&
|
||||
$this->registerHook('actionObjectLanguageAddAfter') &&
|
||||
$this->installFixtures() &&
|
||||
$this->disableDevice(Context::DEVICE_MOBILE);
|
||||
}
|
||||
|
||||
public function hookActionObjectLanguageAddAfter($params)
|
||||
{
|
||||
return $this->installFixture((int)$params['object']->id, Configuration::get('BLOCKBANNER_IMG', (int)Configuration::get('PS_LANG_DEFAULT')));
|
||||
}
|
||||
|
||||
protected function installFixtures()
|
||||
{
|
||||
$languages = Language::getLanguages(false);
|
||||
foreach ($languages as $lang)
|
||||
$this->installFixture((int)$lang['id_lang'], 'sale70.png');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function installFixture($id_lang, $image = null)
|
||||
{
|
||||
$values['BLOCKBANNER_IMG'][(int)$id_lang] = $image;
|
||||
$values['BLOCKBANNER_LINK'][(int)$id_lang] = '';
|
||||
$values['BLOCKBANNER_DESC'][(int)$id_lang] = '';
|
||||
Configuration::updateValue('BLOCKBANNER_IMG', $values['BLOCKBANNER_IMG']);
|
||||
Configuration::updateValue('BLOCKBANNER_LINK', $values['BLOCKBANNER_LINK']);
|
||||
Configuration::updateValue('BLOCKBANNER_DESC', $values['BLOCKBANNER_DESC']);
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
Configuration::deleteByName('BLOCKBANNER_IMG');
|
||||
Configuration::deleteByName('BLOCKBANNER_LINK');
|
||||
Configuration::deleteByName('BLOCKBANNER_DESC');
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
public function hookDisplayTop($params)
|
||||
{
|
||||
if (!$this->isCached('blockbanner.tpl', $this->getCacheId()))
|
||||
{
|
||||
$imgname = Configuration::get('BLOCKBANNER_IMG', $this->context->language->id);
|
||||
$imgUrl = $this->context->link->getMediaLink($this->_path.'img/'.$imgname); // by webkul
|
||||
|
||||
if ($imgname && (bool)Tools::file_get_contents($imgUrl)) // by webkul
|
||||
$this->smarty->assign('banner_img', $imgUrl);
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'banner_link' => Configuration::get('BLOCKBANNER_LINK', $this->context->language->id),
|
||||
'banner_desc' => Configuration::get('BLOCKBANNER_DESC', $this->context->language->id)
|
||||
));
|
||||
}
|
||||
|
||||
return $this->display(__FILE__, 'blockbanner.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookDisplayBanner($params)
|
||||
{
|
||||
return $this->hookDisplayTop($params);
|
||||
}
|
||||
|
||||
public function hookDisplayFooter($params)
|
||||
{
|
||||
return $this->hookDisplayTop($params);
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'blockbanner.css', 'all');
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitStoreConf'))
|
||||
{
|
||||
$languages = Language::getLanguages(false);
|
||||
$values = array();
|
||||
$update_images_values = false;
|
||||
|
||||
foreach ($languages as $lang)
|
||||
{
|
||||
if (isset($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']])
|
||||
&& isset($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']]['tmp_name'])
|
||||
&& !empty($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']]['tmp_name']))
|
||||
{
|
||||
if ($error = ImageManager::validateUpload($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']], 4000000))
|
||||
return $error;
|
||||
else
|
||||
{
|
||||
$ext = substr($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']]['name'], strrpos($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']]['name'], '.') + 1);
|
||||
$file_name = md5($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']]['name']).'.'.$ext;
|
||||
|
||||
if (!ImageManager::resize($_FILES['BLOCKBANNER_IMG_'.$lang['id_lang']]['tmp_name'], dirname(__FILE__).DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.$file_name)) { // by webkul
|
||||
return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
|
||||
} else {
|
||||
if (Configuration::hasContext('BLOCKBANNER_IMG', $lang['id_lang'], Shop::getContext())
|
||||
&& Configuration::get('BLOCKBANNER_IMG', $lang['id_lang']) != $file_name)
|
||||
Tools::deleteFile(dirname(__FILE__).DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.Configuration::get('BLOCKBANNER_IMG', $lang['id_lang']));
|
||||
|
||||
$values['BLOCKBANNER_IMG'][$lang['id_lang']] = $file_name;
|
||||
}
|
||||
}
|
||||
|
||||
$update_images_values = true;
|
||||
}
|
||||
|
||||
$values['BLOCKBANNER_LINK'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_LINK_'.$lang['id_lang']);
|
||||
$values['BLOCKBANNER_DESC'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_DESC_'.$lang['id_lang']);
|
||||
}
|
||||
|
||||
if ($update_images_values)
|
||||
Configuration::updateValue('BLOCKBANNER_IMG', $values['BLOCKBANNER_IMG']);
|
||||
|
||||
Configuration::updateValue('BLOCKBANNER_LINK', $values['BLOCKBANNER_LINK']);
|
||||
Configuration::updateValue('BLOCKBANNER_DESC', $values['BLOCKBANNER_DESC']);
|
||||
|
||||
$this->_clearCache('blockbanner.tpl');
|
||||
return $this->displayConfirmation($this->l('The settings have been updated.'));
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
return $this->postProcess().$this->renderForm();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'file_lang',
|
||||
'label' => $this->l('Top banner image'),
|
||||
'name' => 'BLOCKBANNER_IMG',
|
||||
'desc' => $this->l('Upload an image for your top banner. The recommended dimensions are 1170 x 65px if you are using the default theme.'),
|
||||
'lang' => true,
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'lang' => true,
|
||||
'label' => $this->l('Banner Link'),
|
||||
'name' => 'BLOCKBANNER_LINK',
|
||||
'desc' => $this->l('Enter the link associated to your banner. When clicking on the banner, the link opens in the same window. If no link is entered, it redirects to the homepage.')
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'lang' => true,
|
||||
'label' => $this->l('Banner description'),
|
||||
'name' => 'BLOCKBANNER_DESC',
|
||||
'desc' => $this->l('Please enter a short but meaningful description for the banner.')
|
||||
)
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save')
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->module = $this;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitStoreConf';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'uri' => $this->context->link->getMediaLink($this->getPathUri()), // by webkul
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
$languages = Language::getLanguages(false);
|
||||
$fields = array();
|
||||
|
||||
foreach ($languages as $lang)
|
||||
{
|
||||
$fields['BLOCKBANNER_IMG'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_IMG_'.$lang['id_lang'], Configuration::get('BLOCKBANNER_IMG', $lang['id_lang']));
|
||||
$fields['BLOCKBANNER_LINK'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_LINK_'.$lang['id_lang'], Configuration::get('BLOCKBANNER_LINK', $lang['id_lang']));
|
||||
$fields['BLOCKBANNER_DESC'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_DESC_'.$lang['id_lang'], Configuration::get('BLOCKBANNER_DESC', $lang['id_lang']));
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<a href="{if $banner_link}{$banner_link|escape:'htmlall':'UTF-8'}{else}{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}{/if}" title="{$banner_desc|escape:'htmlall':'UTF-8'}">
|
||||
{if isset($banner_img)}
|
||||
<img class="img-responsive" src="{$banner_img|escape:'htmlall':'UTF-8'}" alt="{$banner_desc|escape:'htmlall':'UTF-8'}" title="{$banner_desc|escape:'htmlall':'UTF-8'}" width="1170" height="65" />
|
||||
{else}
|
||||
{$banner_desc|escape:'htmlall':'UTF-8'}
|
||||
{/if}
|
||||
</a>
|
||||
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
|
Before Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 1.9 KiB |