addition of signals about price and nb product

This commit is contained in:
Marion Muszynski 2016-10-24 14:27:50 +02:00
parent a598bb04f4
commit bfbfd14bd6
4 changed files with 400 additions and 15 deletions

View File

@ -78,11 +78,13 @@ class AdminCustomerThreads extends AdminTab
'id_customer_thread' => array('title' => $this->l('ID'), 'width' => 25),
'customer' => array('title' => $this->l('Customer'), 'width' => 100, 'filter_key' => 'customer', 'tmpTableFilter' => true),
'email' => array('title' => $this->l('E-mail'), 'width' => 100, 'filter_key' => 'a!email'),
'contact' => array('title' => $this->l('Type'), 'width' => 75, 'type' => 'select', 'select' => $contactArray, 'filter_key' => 'cl!id_contact', 'filter_type' => 'int'),
'contact' => array('title' => $this->l('Type'), 'width' => 75, 'type' => 'select', 'select' => $contactArray, 'filter_key' => 'cl!id_contact', 'filter_type' => 'int', 'align' =>'text-bold'),
'language' => array('title' => $this->l('Language'), 'width' => 60, 'type' => 'select', 'select' => $languageArray, 'filter_key' => 'l!id_lang', 'filter_type' => 'int'),
'status' => array('title' => $this->l('Status'), 'width' => 50, 'type' => 'select', 'select' => $statusArray, 'icon' => $imagesArray, 'align' => 'center', 'filter_key' => 'a!status', 'filter_type' => 'string'),
'employee' => array('title' => $this->l('Employee'), 'width' => 100, 'filter_key' => 'employee', 'tmpTableFilter' => true),
'messages' => array('title' => $this->l('Messages'), 'width' => 50, 'filter_key' => 'messages', 'tmpTableFilter' => true, 'maxlength' => 0),
'id_product' => array('title' => $this->l('> 10€'), 'width' => 50, 'maxlength' => 0, 'align' =>'center'),
'id_order' => array('title' => $this->l('Nb products'), 'width' => 50, 'maxlength' => 0, 'align' =>'center text-bold'),
'order' => array('title' => $this->l('Total cmd'), 'width' => 50, 'maxlength' => 0, 'align' =>'center text-bold'),
'date_upd' => array('title' => $this->l('Last message'), 'width' => 90)
);
@ -244,7 +246,7 @@ class AdminCustomerThreads extends AdminTab
WHERE ct.customer_service = 1');
$dim = count($categories);
echo '<div style="float:left;border:0;width:640px;">';
echo '<div style="float:left;border:0;width:640px;" class="tab_customer_thread">';
foreach ($categories as $key => $val)
{
$totalThread = 0;
@ -256,8 +258,8 @@ class AdminCustomerThreads extends AdminTab
$id_customer_thread = $tmp2['id_customer_thread'];
break;
}
echo '<div style="background-color:#EFEFEF;float:left;margin:0 10px 10px 0;width:'.($dim > 6 ? '200' : '300').'px;border:1px solid #CFCFCF" >
<h3 style="overflow:hidden;line-height:25px;color:#812143;height:25px;margin:0;">&nbsp;'.$val['name'].'</h3>'.
echo '<div style="background-color:rgba(226,110,162,0.2);float:left;margin:0 10px 10px 0;width:'.($dim > 6 ? '200' : '300').'px;border:1px solid #CFCFCF" >
<h3 style="overflow:hidden;line-height:25px;color:#e36ea2;height:25px;margin:0;">&nbsp;'.$val['name'].'</h3>'.
($dim > 6 ? '' : '<p style="overflow:hidden;line-height:15px;height:45px;margin:0;padding:0 5px;">'.$val['description'].'</p>').
($totalThread == 0 ? '<h3 style="padding:0 5px;margin:0;height:23px;line-height:23px;background-color:#DEDEDE">'.$this->l('No new message').'</h3>'
: '<a href="'.$currentIndex.'&token='.Tools::getValue('token').'&id_customer_thread='.$id_customer_thread.'&viewcustomer_thread" style="padding:0 5px;display:block;height:23px;line-height:23px;border:0;" class="button">'.$totalThread.' '.($totalThread > 1 ? $this->l('new messages'): $this->l('new message')).'</a>').'
@ -273,7 +275,7 @@ class AdminCustomerThreads extends AdminTab
$this->l('Threads unread') => $unread = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_thread WHERE status = "open"'),
$this->l('Threads closed') => $all - ($unread + $pending));
echo '<div style="float:right;padding 0px;border:1px solid #CFCFCF;width:280px;">
echo '<div style="float:right;padding 0px;border:1px solid #CFCFCF;width:280px;" class="tab_customer_thread">
<h3 class="button" style="margin:0;line-height:23px;height:23px;border:0;padding:0 5px;">'.$this->l('Customer service').' : '.$this->l('Statistics').'</h3>
<table cellspacing="1" class="table" style="border-collapse:separate;width:280px;border:0">';
$count = 0;
@ -281,7 +283,335 @@ class AdminCustomerThreads extends AdminTab
echo '<tr '.(++$count % 2 == 0 ? 'class="alt_row"' : '').'><td>'.$key.'</td><td>'.$val.'</td></tr>';
echo ' </table>
</div><p class="clear">&nbsp;</p>';
parent::displayListHeader($token);
$this->displayListHeaderBis($token);
}
public function displayListHeaderBis($token = NULL)
{
global $currentIndex, $cookie;
$isCms = false;
if (preg_match('/cms/Ui', $this->identifier))
$isCms = true;
$id_cat = Tools::getValue('id_'.($isCms ? 'cms_' : '').'category');
if (!isset($token) OR empty($token))
$token = $this->token;
/* Determine total page number */
$totalPages = ceil($this->_listTotal / Tools::getValue('pagination', (isset($cookie->{$this->table.'_pagination'}) ? $cookie->{$this->table.'_pagination'} : $this->_pagination[0])));
if (!$totalPages) $totalPages = 1;
echo '<a name="'.$this->table.'">&nbsp;</a>';
echo '<form id="form_customer_thread" method="post" action="'.$currentIndex;
if (Tools::getIsset($this->identifier))
echo '&'.$this->identifier.'='.(int)(Tools::getValue($this->identifier));
echo '&token='.$token;
if (Tools::getIsset($this->table.'Orderby'))
echo '&'.$this->table.'Orderby='.urlencode($this->_orderBy).'&'.$this->table.'Orderway='.urlencode(strtolower($this->_orderWay));
echo '#'.$this->table.'" class="form">
<input type="hidden" id="submitFilter'.$this->table.'" name="submitFilter'.$this->table.'" value="0">
<table>
<tr>
<td style="vertical-align: bottom;">
<span style="float: left;">';
/* Determine current page number */
$page = (int)(Tools::getValue('submitFilter'.$this->table));
if (!$page) $page = 1;
if ($page > 1)
echo '
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE(\'submitFilter'.$this->table.'\').value=1"/>
&nbsp; <input type="image" src="../img/admin/list-prev.gif" onclick="getE(\'submitFilter'.$this->table.'\').value='.($page - 1).'"/> ';
echo $this->l('Page').' <b>'.$page.'</b> / '.$totalPages;
if ($page < $totalPages)
echo '
<input type="image" src="../img/admin/list-next.gif" onclick="getE(\'submitFilter'.$this->table.'\').value='.($page + 1).'"/>
&nbsp;<input type="image" src="../img/admin/list-next2.gif" onclick="getE(\'submitFilter'.$this->table.'\').value='.$totalPages.'"/>';
echo ' | '.$this->l('Display').'
<select name="pagination">';
/* Choose number of results per page */
$selectedPagination = Tools::getValue('pagination', (isset($cookie->{$this->table.'_pagination'}) ? $cookie->{$this->table.'_pagination'} : NULL));
foreach ($this->_pagination AS $value)
echo '<option value="'.(int)($value).'"'.($selectedPagination == $value ? ' selected="selected"' : (($selectedPagination == NULL && $value == $this->_pagination[1]) ? ' selected="selected2"' : '')).'>'.(int)($value).'</option>';
echo '
</select>
/ '.(int)($this->_listTotal).' '.$this->l('result(s)').'
</span>
<span style="float: right;">
<input type="submit" name="submitReset'.$this->table.'" value="'.$this->l('Reset').'" class="button" />
<input type="submit" id="submitFilterButton_'.$this->table.'" name="submitFilter" value="'.$this->l('Filter').'" class="button" />
</span>
<span class="clear"></span>
</td>
</tr>
<tr>
<td>';
/* Display column names and arrows for ordering (ASC, DESC) */
if (array_key_exists($this->identifier,$this->identifiersDnd) AND $this->_orderBy == 'position')
{
echo '
<script type="text/javascript" src="../js/jquery/jquery.tablednd_0_5.js"></script>
<script type="text/javascript">
var token = \''.($token!=NULL ? $token : $this->token).'\';
var come_from = \''.$this->table.'\';
var alternate = \''.($this->_orderWay == 'DESC' ? '1' : '0' ).'\';
</script>
<script type="text/javascript" src="../js/admin-dnd.js"></script>
';
}
echo '<table'.(array_key_exists($this->identifier,$this->identifiersDnd) ? ' id="'.(((int)(Tools::getValue($this->identifiersDnd[$this->identifier], 1))) ? substr($this->identifier,3,strlen($this->identifier)) : '').'"' : '' ).' class="table'.((array_key_exists($this->identifier,$this->identifiersDnd) AND ($this->_orderBy != 'position 'AND $this->_orderWay != 'DESC')) ? ' tableDnD' : '' ).'" cellpadding="0" cellspacing="0">
<thead>
<tr class="nodrag nodrop">
<th>';
if ($this->delete)
echo ' <input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \''.$this->table.'Box[]\', this.checked)" />';
echo ' </th>';
foreach ($this->fieldsDisplay AS $key => $params)
{
echo ' <th '.(isset($params['widthColumn']) ? 'style="width: '.$params['widthColumn'].'px"' : '').'>'.$params['title'];
if (!isset($params['orderby']) OR $params['orderby'])
{
// Cleaning links
if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway'))
$currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', $currentIndex);
echo ' <br />
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id_cat.'&'.$this->table.'Orderby='.urlencode($key).'&'.$this->table.'Orderway=desc&token='.$token.'"><img border="0" src="../img/admin/down'.((isset($this->_orderBy) AND ($key == $this->_orderBy) AND ($this->_orderWay == 'DESC')) ? '_d' : '').'.gif" /></a>
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id_cat.'&'.$this->table.'Orderby='.urlencode($key).'&'.$this->table.'Orderway=asc&token='.$token.'"><img border="0" src="../img/admin/up'.((isset($this->_orderBy) AND ($key == $this->_orderBy) AND ($this->_orderWay == 'ASC')) ? '_d' : '').'.gif" /></a>';
}
echo ' </th>';
}
/* Check if object can be modified, deleted or detailed */
if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn'))
echo ' <th style="width: 52px">'.$this->l('Actions').'</th>';
echo ' </tr>
<tr class="nodrag nodrop" style="height: 35px;">
<td class="center">';
if ($this->delete)
echo ' --';
echo ' </td>';
/* Javascript hack in order to catch ENTER keypress event */
$keyPress = 'onkeypress="formSubmit(event, \'submitFilterButton_'.$this->table.'\');"';
/* Filters (input, select, date or bool) */
foreach ($this->fieldsDisplay AS $key => $params)
{
$width = (isset($params['width']) ? ' style="width: '.(int)($params['width']).'px;"' : '');
echo '<td'.(isset($params['align']) ? ' class="'.$params['align'].'"' : '').'>';
if (!isset($params['type']))
$params['type'] = 'text';
$value = Tools::getValue($this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key));
if (isset($params['search']) AND !$params['search'])
{
echo '--</td>';
continue;
}
switch ($params['type'])
{
case 'bool':
echo '
<select name="'.$this->table.'Filter_'.$key.'">
<option value="">--</option>
<option value="1"'.($value == 1 ? ' selected="selected"' : '').'>'.$this->l('Yes').'</option>
<option value="0"'.(($value == 0 AND $value != '') ? ' selected="selected"' : '').'>'.$this->l('No').'</option>
</select>';
break;
case 'date':
case 'datetime':
if (is_string($value))
$value = unserialize($value);
if (!Validate::isCleanHtml($value[0]) OR !Validate::isCleanHtml($value[1]))
$value = '';
$name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key);
$nameId = str_replace('!', '__', $name);
includeDatepicker(array($nameId.'_0', $nameId.'_1'));
echo $this->l('From').' <input type="text" id="'.$nameId.'_0" name="'.$name.'[0]" value="'.(isset($value[0]) ? $value[0] : '').'"'.$width.' '.$keyPress.' /><br />
'.$this->l('To').' <input type="text" id="'.$nameId.'_1" name="'.$name.'[1]" value="'.(isset($value[1]) ? $value[1] : '').'"'.$width.' '.$keyPress.' />';
break;
case 'select':
if (isset($params['filter_key']))
{
echo '<select onchange="$(\'#submitFilter'.$this->table.'\').focus();$(\'#submitFilter'.$this->table.'\').click();" name="'.$this->table.'Filter_'.$params['filter_key'].'" '.(isset($params['width']) ? 'style="width: '.$params['width'].'px"' : '').'>
<option value=""'.(($value == 0 AND $value != '') ? ' selected="selected"' : '').'>--</option>';
if (isset($params['select']) AND is_array($params['select']))
foreach ($params['select'] AS $optionValue => $optionDisplay)
{
echo '<option value="'.$optionValue.'"'.((isset($_POST[$this->table.'Filter_'.$params['filter_key']]) AND Tools::getValue($this->table.'Filter_'.$params['filter_key']) == $optionValue AND Tools::getValue($this->table.'Filter_'.$params['filter_key']) != '') ? ' selected="selected"' : '').'>'.$optionDisplay.'</option>';
}
echo '</select>';
break;
}
case 'text':
default:
if (!Validate::isCleanHtml($value))
$value = '';
echo '<input type="text" name="'.$this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key).'" value="'.htmlentities($value, ENT_COMPAT, 'UTF-8').'"'.$width.' '.$keyPress.' />';
}
echo '</td>';
}
if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn'))
echo '<td class="center">--</td>';
echo '</tr>
</thead>';
}
public function displayListContent($token = NULL)
{
/* Display results in a table
*
* align : determine value alignment
* prefix : displayed before value
* suffix : displayed after value
* image : object image
* icon : icon determined by values
* active : allow to toggle status
*/
global $currentIndex, $cookie;
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$id_category = 1; // default categ
$irow = 0;
if ($this->_list AND isset($this->fieldsDisplay['position']))
{
$positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list);
sort($positions);
}
if ($this->_list)
{
$isCms = false;
if (preg_match('/cms/Ui', $this->identifier))
$isCms = true;
$keyToGet = 'id_'.($isCms ? 'cms_' : '').'category'.(in_array($this->identifier, array('id_category', 'id_cms_category')) ? '_parent' : '');
foreach ($this->_list AS $tr)
{
$id = $tr[$this->identifier];
echo '<tr'.(array_key_exists($this->identifier,$this->identifiersDnd) ? ' id="tr_'.(($id_category = (int)(Tools::getValue('id_'.($isCms ? 'cms_' : '').'category', '1'))) ? $id_category : '').'_'.$id.'_'.$tr['position'].'"' : '').($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($tr['color']) AND $this->colorOnBackground) ? 'style="background-color: '.$tr['color'].'"' : '').'>
<td class="center">';
if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete)))
echo '<input type="checkbox" name="'.$this->table.'Box[]" value="'.$id.'" class="noborder" />';
echo '</td>';
foreach ($this->fieldsDisplay AS $key => $params)
{
$tmp = explode('!', $key);
$key = isset($tmp[1]) ? $tmp[1] : $tmp[0];
echo '
<td '.(isset($params['position']) ? ' id="td_'.(isset($id_category) AND $id_category ? $id_category : 0).'_'.$id.'"' : '').' class="'.((!isset($this->noLink) OR !$this->noLink) ? 'pointer' : '').((isset($params['position']) AND $this->_orderBy == 'position')? ' dragHandle' : ''). (isset($params['align']) ? ' '.$params['align'] : '').'" ';
if (!isset($params['position']) AND (!isset($this->noLink) OR !$this->noLink))
echo ' onclick="document.location = \''.$currentIndex.'&'.$this->identifier.'='.$id.($this->view? '&view' : '&update').$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'">'.(isset($params['prefix']) ? $params['prefix'] : '');
else
echo '>';
if ($key == 'id_product' AND isset($tr[$key]) AND isset($tr['id_order'])) {
$order = new Order((int)$tr['id_order']);
$cart = new Cart((int)$order->id_cart);
$products = DB::getInstance()->executeS('
SELECT * FROM `'._DB_PREFIX_.'support_product_customerthread`
WHERE `id_customer_thread` = '.(int)$tr['id_customer_thread']
);
$supTo10 = false;
$supTo100 = false;
if(!empty($products)) {
foreach ($products as $product) {
$price = Product::getPriceStatic((int)$product['id_product'], false, (int)$product['id_product_attribute'], 6, NULL, false, true, 1, false, ((int)($tr['id_customer']) ? (int)($tr['id_customer']) : NULL), (int)($order->id_cart), ((int)($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL), $specificPriceOutput);
$supTo10 = ($price>10)?true:false;
$supTo100 = ($price>100)?true:false;
}
}
echo ($supTo10?'<p class="bg-green-light text-green-light"><span class="anticon anticon-coin-euro"></span>'.($supTo100?'<span class="anticon anticon-coin-euro"></span>':'').'</p>':'<p>--</p>');
} elseif ($key == 'id_order' AND isset($tr[$key])) {
$order = new Order((int)$tr[$key]);
$cart = new Cart((int)$order->id_cart);
$nb_products = $cart->nbProducts();
echo '<p>'.($nb_products>0?$nb_products:'--').'</p>';
} elseif ($key == 'order' AND isset($tr['id_order']) AND (int)$tr['id_order']!=0) {
$currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT')));
$order = new Order((int)$tr['id_order']);
$cart = new Cart((int)$order->id_cart);
echo '<p>'.($order?Tools::displayPrice($cart->getOrderTotal(TRUE),$currency):'--').'</p>';
} elseif (isset($params['active']) AND isset($tr[$key])) {
$this->_displayEnableLink($token, $id, $tr[$key], $params['active'], Tools::getValue('id_category'), Tools::getValue('id_product'));
} elseif (isset($params['activeVisu']) AND isset($tr[$key])) {
echo '<img src="../img/admin/'.($tr[$key] ? 'enabled.gif' : 'disabled.gif').'"
alt="'.($tr[$key] ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.($tr[$key] ? $this->l('Enabled') : $this->l('Disabled')).'" />';
} elseif (isset($params['position'])) {
if ($this->_orderBy == 'position' AND $this->_orderWay != 'DESC')
{
echo '<a'.(!($tr[$key] != $positions[sizeof($positions) - 1]) ? ' style="display: none;"' : '').' href="'.$currentIndex.
'&'.$keyToGet.'='.(int)($id_category).'&'.$this->identifiersDnd[$this->identifier].'='.$id.'
&way=1&position='.(int)($tr['position'] + 1).'&token='.($token!=NULL ? $token : $this->token).'">
<img src="../img/admin/'.($this->_orderWay == 'ASC' ? 'down' : 'up').'.gif"
alt="'.$this->l('Down').'" title="'.$this->l('Down').'" /></a>';
echo '<a'.(!($tr[$key] != $positions[0]) ? ' style="display: none;"' : '').' href="'.$currentIndex.
'&'.$keyToGet.'='.(int)($id_category).'&'.$this->identifiersDnd[$this->identifier].'='.$id.'
&way=0&position='.(int)($tr['position'] - 1).'&token='.($token!=NULL ? $token : $this->token).'">
<img src="../img/admin/'.($this->_orderWay == 'ASC' ? 'up' : 'down').'.gif"
alt="'.$this->l('Up').'" title="'.$this->l('Up').'" /></a>'; }
else
echo (int)($tr[$key] + 1);
}
elseif (isset($params['image']))
{
// item_id is the product id in a product image context, else it is the image id.
$item_id = isset($params['image_id']) ? $tr[$params['image_id']] : $id;
// If it's a product image
if (isset($tr['id_image']))
{
$image = new Image((int)$tr['id_image']);
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$image->getExistingImgPath().'.'.$this->imageType;
}else
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)($tr['id_image']) : '').'.'.$this->imageType;
echo cacheImage($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType);
}
elseif (isset($params['icon']) AND (isset($params['icon'][$tr[$key]]) OR isset($params['icon']['default'])))
echo '<img src="../img/admin/'.(isset($params['icon'][$tr[$key]]) ? $params['icon'][$tr[$key]] : $params['icon']['default'].'" alt="'.$tr[$key]).'" title="'.$tr[$key].'" />';
elseif (isset($params['price']))
echo Tools::displayPrice($tr[$key], (isset($params['currency']) ? Currency::getCurrencyInstance((int)($tr['id_currency'])) : $currency), false);
elseif (isset($params['float']))
echo rtrim(rtrim($tr[$key], '0'), '.');
elseif (isset($params['type']) AND $params['type'] == 'date')
echo Tools::displayDate($tr[$key], (int)$cookie->id_lang);
elseif (isset($params['type']) AND $params['type'] == 'datetime')
echo Tools::displayDate($tr[$key], (int)$cookie->id_lang, true);
elseif (isset($tr[$key]))
{
$echo = ($key == 'price' ? round($tr[$key], 2) : isset($params['maxlength']) ? Tools::substr($tr[$key], 0, $params['maxlength']).'...' : $tr[$key]);
echo isset($params['callback']) ? call_user_func_array(array($this->className, $params['callback']), array($echo, $tr)) : $echo;
}
else
echo '--';
echo (isset($params['suffix']) ? $params['suffix'] : '').
'</td>';
}
if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn'))
{
echo '<td class="center" style="white-space: nowrap;">';
if ($this->view)
$this->_displayViewLink($token, $id);
if ($this->edit)
$this->_displayEditLink($token, $id);
if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete)))
$this->_displayDeleteLink($token, $id);
if ($this->duplicate)
$this->_displayDuplicate($token, $id);
echo '</td>';
}
echo '</tr>';
}
}
}
private function openUploadedFile()

View File

@ -3602,8 +3602,9 @@ form.form-forward-message .button:focus{
.panel-answer textarea:focus {
background-color: #F1F1F1;
}
#form_customer_thread table table,
.table.customerThread-table {
width: 700px;
width: 100%;
border: 1px solid #565485;
background: #fff;
padding: 20px;
@ -3616,13 +3617,55 @@ form.form-forward-message .button:focus{
border-spacing: 0;
margin-bottom: 20px;
}
.table.customerThread-table {
width: 700px;
}
#form_customer_thread table table tr th,
.tab_customer_thread table tr th,
.table.customerThread-table tr th {
background: rgba(86,84,133,0.9);
color: #fff;
font-weight: 300;
}
#form_customer_thread table table tr td,
.tab_customer_thread table tr td,
.table.customerThread-table tr td {
border-bottom: 1px solid #DEDEDE;
color: #000;
padding: 0 4px 0 6px;
}
#form_customer_thread table table tr td.text-bold{
font-weight: 600;
}
#form_customer_thread p.text-green-light{
color: #55b239;
}
#form_customer_thread table table tr td p {
margin: 0;
padding: 5px 0;
text-align: center;
}
#form_customer_thread table table tr td p.bg-green-light{
background: #C0E3B5;
}
.tab_customer_thread .button {
background-color: rgba(86,84,133,0.7);
border: 1px solid #565485;
border-left: 1px solid rgba(86,84,133,0.6);
border-top: 1px solid rgba(86,84,133,0.6);
color: rgba(255,255,255,0.9);
padding: 3px;
}
.tab_customer_thread .button:hover {
background-color: #565485;
border: 1px solid rgba(86,84,133,0.6);
border-left: 1px solid #565485;
border-top: 1px solid #565485;
color: #fff;
padding: 3px;
}
.tab_customer_thread .button:focus{
background-color: rgba(86,84,133,0.6);
}

View File

@ -2,7 +2,7 @@
if (!defined('_PS_VERSION_'))
exit;
class Ant_Support_Form extends Module
class Ant_Support_Form extends Module
{
public function __construct()
@ -19,7 +19,7 @@ class Ant_Support_Form extends Module
$this->description = $this->l('Adding forms for cancellations and problemes, adding reasons for cancellation');
}
public function install()
public function install()
{
$query = '
@ -54,6 +54,17 @@ class Ant_Support_Form extends Module
if(!Db::getInstance()->Execute($query)) {
return false;
}
$query = '
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'support_product_customerthread` (
`id_product` int(11) NOT NULL,
`id_product_attribute` int(11) NOT NULL,
`id_customer_thread` int(11) NOT NULL,
PRIMARY KEY (`id_product`,`id_product_attribute`,`id_customer_thread`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
';
if(!Db::getInstance()->Execute($query)) {
return false;
}
if(!(parent::install())) {
return false;

View File

@ -165,6 +165,7 @@ class BlockOrderSummary extends Module {
</style>";
$currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT')));
echo '<div id="blockordersummary">
<div class="content">
<h4>'.$this->l('Summary of my order' ).'</h4>
@ -172,17 +173,17 @@ class BlockOrderSummary extends Module {
<h5>'.$this->l('My Cart' ).'</h5>
<ul>';
foreach ($cart->getProducts() as $key => $product) {
echo '<li>'.$product['quantity'].' x '.$product['name'].' <span class="price">'.$product['total_wt'].'</span></li>';
echo '<li>'.$product['quantity'].' x '.$product['name'].' <span class="price">'.Tools::displayPrice($product['total_wt'],$currency).'</span></li>';
}
echo '</ul>
<p>'.$this->l('Products total').' <span class="price price_total">'.$cart->getOrderTotal(TRUE, 1).'</span></p>';
<p>'.$this->l('Products total').' <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE,1),$currency).'</span></p>';
if ($cart->getOrderTotal(TRUE, 2) != 0){
echo '<p>'.$this->l('Discounts total').' <span class="price price_total">'.$cart->getOrderTotal(TRUE, 2).'</span></p>';
echo '<p>'.$this->l('Discounts total').' <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE,2),$currency).'</span></p>';
}
echo '</div>
<div>
<h5>'.$this->l('Shipping').'</h5>
<p class="carrier-info"><span class="carrier-name">'.$data['carrier_name'].'</span> <span class="price price_total">'.$cart->getOrderTotal(TRUE, 5).'</span></p>
<p class="carrier-info"><span class="carrier-name">'.$data['carrier_name'].'</span> <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE, 5),$currency).'</span></p>
</div>
<div>
<h5>'.$this->l('Delivery delays').'</h5>
@ -205,7 +206,7 @@ class BlockOrderSummary extends Module {
</div>
<div>
<h5>'.$this->l('My payment').'</h5>
<p class="order_total">'.$this->l('Total to pay').' <span class="price price_total">'.$cart->getOrderTotal(TRUE).'</span></p>
<p class="order_total">'.$this->l('Total to pay').' <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE),$currency).'</span></p>
</div>
</div>
</div>';