Spade
Mini Shell
PK��[wtW�
index.htmlnu�[���<html><body></body></html>PK��['*6���tmpl/create.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order');?>"
method="post" name="hikamarket_form"
id="hikamarket_order_create_form">
<dl class="hikam_options">
<dt
class="hikamarket_order_customer"><label><?php echo
JText::_('CUSTOMER'); ?></label></dt>
<dd class="hikamarket_order_customer"><?php
echo $this->nameboxType->display(
'data[order][order_user_id]',
'',
hikamarketNameboxType::NAMEBOX_SINGLE,
'user',
array(
'customer' => true,
'delete' => true,
'default_text' =>
'<em>'.JText::_('HIKA_NONE').'</em>',
'id' =>
'hikamarket_order_create_customer_namebox'
)
);
?></dd>
<dt
class="hikamarket_order_currency"><label><?php echo
JText::_('CURRENCY'); ?></label></dt>
<dd class="hikamarket_order_currency"><?php
echo
$this->currencyType->display('data[order][order_currency_id]',
$this->main_currency);
?></dd>
</dl>
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="create" />
<input type="hidden" name="ctrl"
value="<?php echo hikaInput::get()->getCmd('ctrl');
?>" />
<?php echo JHTML::_('form.token'); ?>
</form>
PK��[�P����tmpl/customer_set.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order&task=customer_save')
;?>" method="post" name="hikamarket_form"
id="hikamarket_form">
<div class="hikam_confirm">
<?php echo JText::_('HIKA_CONFIRM_USER')?><br/>
<table class="hikam_options">
<tbody>
<tr>
<td class="key"><label><?php echo
JText::_('HIKA_NAME'); ?></label></td>
<td id="hikamarket_order_customer_name"><?php echo
$this->rows->name; ?></td>
</tr>
<tr>
<td class="key"><label><?php echo
JText::_('HIKA_EMAIL'); ?></label></td>
<td id="hikamarket_order_customer_email"><?php echo
$this->rows->email; ?></td>
</tr>
<tr>
<td class="key"><label><?php echo
JText::_('ID'); ?></label></td>
<td id="hikamarket_order_customer_id"><?php echo
$this->rows->user_id; ?></td>
</tr>
<?php if(hikamarket::acl('order/edit/billingaddress')) {
?>
<tr>
<td class="key"><label><?php echo
JText::_('SET_USER_ADDRESS'); ?></label></td>
<td><?php echo JHTML::_('hikaselect.booleanlist',
'set_user_address', '', 0); ?></td>
</tr>
<?php } ?>
<?php if(hikamarket::acl('order/edit/history')) { ?>
<tr>
<td class="key"><label><?php echo
JText::_('HISTORY'); ?></label></td>
<td>
<span><input
onchange="window.orderMgr.orderadditional_history_changed(this);"
type="checkbox"
id="hikamarket_history_orderadditional_store"
name="data[history][store_data]"
value="1"/><label
for="hikamarket_history_orderadditional_store"
style="display:inline-block"><?php echo
JText::_('SET_HISTORY_MESSAGE');?></label></span><br/>
<textarea id="hikamarket_history_orderadditional_msg"
name="data[history][history_data]"
style="display:none;"></textarea>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<input type="hidden"
name="data[order][order_user_id]" value="<?php echo
$this->rows->user_id; ?>"/>
<input type="hidden" name="cid"
value="<?php echo $this->order_id; ?>"/>
<input type="hidden" name="order_id"
value="<?php echo $this->order_id; ?>"/>
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="customer_save" />
<input type="hidden" name="finalstep"
value="1" />
<input type="hidden" name="single"
value="1" />
<input type="hidden" name="ctrl"
value="order" />
<input type="hidden" name="tmpl"
value="component" />
<?php echo JHTML::_('form.token'); ?>
<div class="hikam_confirm_btn">
<button onclick="hikamarket.submitform('customer_save',
'hikamarket_form');" class="hikabtn
hikabtn-success"><i class="fas fa-check"></i>
<span><?php echo Jtext::_('HIKA_OK');
?></span></button>
</div>
</div>
<script type="text/javascript">
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.orderadditional_history_changed = function(el) {
var fields = ['hikamarket_history_orderadditional_msg'],
displayValue = '';
if(!el.checked) displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
}
</script>
</form>
PK��[�4��t*t*tmpl/edit_additional.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order&task=save&subtask=additional&tmpl=component');
?>" name="hikamarket_order_additional_form"
id="hikamarket_order_additional_form" method="post"
enctype="multipart/form-data">
<dl class="hikam_options">
<dt
class="hikamarket_order_additional_subtotal"><label><?php
echo JText::_('SUBTOTAL'); ?></label></dt>
<dd
class="hikamarket_order_additional_subtotal"><span><?php
echo
$this->currencyHelper->format($this->order->order_subtotal,$this->order->order_currency_id);
?></span></dd>
<?php if(isset($this->edit) && $this->edit === true
&& hikamarket::acl('order/edit/coupon')) { ?>
<dt
class="hikamarket_order_additional_coupon"><label><?php
echo JText::_('HIKASHOP_COUPON'); ?></label></dt>
<dd class="hikamarket_order_additional_coupon">
<input type="text"
name="data[order][order_discount_code]" value="<?php echo
$this->escape(@$this->order->order_discount_code); ?>"
/><br/>
<input type="text"
name="data[order][order_discount_price]" value="<?php
echo @$this->order->order_discount_price; ?>"
/><br/>
<input type="text"
name="data[order][order_discount_tax]" value="<?php echo
@$this->order->order_discount_tax; ?>" />
<?php echo $this->ratesType->display(
"data[order][order_discount_tax_namekey]" ,
@$this->order->order_discount_tax_namekey ); ?>
</dd>
<?php } else { ?>
<dt
class="hikamarket_order_additional_coupon"><label><?php
echo JText::_('HIKASHOP_COUPON'); ?></label></dt>
<dd
class="hikamarket_order_additional_coupon"><span><?php
echo
$this->currencyHelper->format($this->order->order_discount_price*-1.0,$this->order->order_currency_id);
?> <?php echo $this->order->order_discount_code;
?></span></dd>
<?php }
if(isset($this->edit) && $this->edit === true &&
hikamarket::acl('order/edit/shipping')) { ?>
<dt
class="hikamarket_order_additional_shipping"><label><?php
echo JText::_('SHIPPING'); ?></label></dt>
<dd class="hikamarket_order_additional_shipping">
<?php if(strpos($this->order->order_shipping_id, ';')
=== false) { ?>
<?php echo
$this->shippingPlugins->display('data[order][shipping]',$this->order->order_shipping_method,$this->order->order_shipping_id);
?><br/>
<?php } ?>
<input type="text"
name="data[order][order_shipping_price]" value="<?php
echo $this->order->order_shipping_price; ?>"
/><br/>
<input type="text"
name="data[order][order_shipping_tax]" value="<?php echo
@$this->order->order_shipping_tax; ?>" />
<?php echo $this->ratesType->display(
"data[order][order_shipping_tax_namekey]" ,
@$this->order->order_shipping_tax_namekey ); ?><br/>
<?php
if(strpos($this->order->order_shipping_id, ';') !==
false) {
?>
<table class="hikam_table table table-striped">
<thead>
<tr>
<th><?php echo JText::_('WAREHOUSE');
?></th>
<th><?php echo
JText::_('HIKASHOP_SHIPPING_METHOD'); ?></th>
<th><?php echo JText::_('PRICE');
?></th>
<th><?php echo JText::_('SHIPPING_TAX');
?></th>
</tr>
</thead>
<tbody>
<?php
$warehouses = array(
JHTML::_('select.option', 0,
JText::_('HIKA_NONE'))
);
$shipping_ids = explode(';',
$this->order->order_shipping_id);
foreach($shipping_ids as $shipping_key) {
$shipping_warehouse = 0;
if(strpos($shipping_key, '@') !== false)
list($shipping_id, $shipping_warehouse) = explode('@',
$shipping_key, 2);
else
$shipping_id = (int)$shipping_key;
$warehouses[] = JHTML::_('select.option',
$shipping_warehouse, $shipping_warehouse);
$shipping_method = '';
foreach($this->order->shippings as $s) {
if((int)$s->shipping_id == $shipping_id) {
$shipping_method = $s->shipping_type;
break;
}
}
$k = $shipping_id.'_'.$shipping_warehouse;
$prices =
@$this->order->order_shipping_params->prices[$shipping_key];
?>
<tr>
<td><?php echo $shipping_warehouse; ?></td>
<td><?php echo
$this->shippingPlugins->display('data[order][shipping]['.$shipping_warehouse.']',
$shipping_method,$shipping_id, true, '
style="max-width:160px;"'); ?></td>
<td><input type="text"
name="data[order][order_shipping_prices][<?php echo
$shipping_warehouse; ?>]" value="<?php echo
@$prices->price_with_tax; ?>" /></td>
<td><input type="text"
name="data[order][order_shipping_taxs][<?php echo
$shipping_warehouse; ?>]" value="<?php echo
@$prices->tax; ?>" /></td>
</tr>
<?php
}
?> </tbody>
</table>
<table class="hikam_table table table-striped">
<thead>
<tr>
<th><?php echo JText::_('PRODUCT');
?></th>
<th><?php echo JText::_('WAREHOUSE');
?></th>
</tr>
</thead>
<tbody>
<?php
foreach($this->order->products as $k => $product) {
$map =
'data[order][warehouses]['.$product->order_product_id.']';
$value = 0;
if(strpos($product->order_product_shipping_id, '@') !==
false)
$value = substr($product->order_product_shipping_id,
strpos($product->order_product_shipping_id, '@')+1);
?>
<tr>
<td><?php echo $product->order_product_name;
?></td>
<td><?php echo JHTML::_('select.genericlist',
$warehouses, $map, 'class="inputbox"',
'value', 'text', $value); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} ?>
</dd>
<?php } else { ?>
<dt
class="hikamarket_order_additional_shipping"><label><?php
echo JText::_('SHIPPING'); ?></label></dt>
<dd
class="hikamarket_order_additional_shipping"><span><?php
echo
$this->currencyHelper->format($this->order->order_shipping_price,
$this->order->order_currency_id); ?> - <?php
if(empty($this->order->order_shipping_method))
echo
'<em>'.JText::_('NONE').'</em>';
else
echo $this->order->order_shipping_method;
?></span></dd>
<?php }
if(isset($this->edit) && $this->edit === true &&
hikamarket::acl('order/edit/payment')) { ?>
<dt
class="hikamarket_order_additional_payment"><label><?php
echo JText::_('HIKASHOP_PAYMENT');
?></label></dt>
<dd class="hikamarket_order_additional_payment">
<?php echo
$this->paymentPlugins->display('data[order][payment]',$this->order->order_payment_method,$this->order->order_payment_id);
?><br/>
<input type="text"
name="data[order][order_payment_price]" value="<?php echo
$this->order->order_payment_price; ?>" /><br/>
<input type="text"
name="data[order][order_payment_tax]" value="<?php echo
@$this->order->order_payment_tax; ?>" />
<?php echo $this->ratesType->display(
"data[order][order_payment_tax_namekey]" ,
@$this->order->order_payment_tax_namekey); ?>
</dd>
<?php } else { ?>
<dt
class="hikamarket_order_additional_payment_fee"><label><?php
echo JText::_('HIKASHOP_PAYMENT');
?></label></dt>
<dd
class="hikamarket_order_additional_payment_fee"><span><?php
echo
$this->currencyHelper->format($this->order->order_payment_price,
$this->order->order_currency_id); ?> - <?php
if(empty($this->order->order_payment_method))
echo
'<em>'.JText::_('NONE').'</em>';
else
echo $this->order->order_payment_method;
?></span></dd>
<?php }
if(!empty($this->order->additional)) {
foreach($this->order->additional as $additional) {
?>
<dt
class="hikamarket_order_additional_additional"><label><?php
echo JText::_($additional->order_product_name);
?></label></dt>
<dd
class="hikamarket_order_additional_additional"><span><?php
if(!empty($additional->order_product_price)) {
$additional->order_product_price =
(float)$additional->order_product_price;
}
if(!empty($additional->order_product_price) ||
empty($additional->order_product_options)) {
echo
$this->currencyHelper->format($additional->order_product_price,
$this->order->order_currency_id);
} else {
echo $additional->order_product_options;
}
?></span></dd>
<?php
}
}
?>
<dt
class="hikamarket_order_additional_total"><label><?php
echo JText::_('HIKASHOP_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_additional_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_full_price,$this->order->order_currency_id);
?></span></dd>
<?php
if(!empty($this->fields['order'])) {
$editCustomFields = false;
if(isset($this->edit) && $this->edit === true &&
hikamarket::acl('order/edit/customfields')) {
$editCustomFields = true;
}
foreach($this->fields['order'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></dt>
<dd class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><span><?php
if($editCustomFields) {
echo $this->fieldsClass->display($oneExtraField,
@$this->order->$fieldName,
'data[orderfields]['.$fieldName.']');
} else {
echo $this->fieldsClass->show($oneExtraField,
@$this->order->$fieldName);
}
?></span></dd>
<?php
}
}
if(hikamarket::acl('order/edit/history')) {
?>
<dt
class="hikamarket_orderadditional_history"><label><?php
echo JText::_('HISTORY'); ?></label></dt>
<dd class="hikamarket_orderadditional_history">
<span><input
onchange="window.orderMgr.orderadditional_history_changed(this);"
type="checkbox"
id="hikamarket_history_orderadditional_store"
name="data[history][store_data]"
value="1"/><label
for="hikamarket_history_orderadditional_store"
style="display:inline-block"><?php echo
JText::_('SET_HISTORY_MESSAGE');?></label></span><br/>
<textarea id="hikamarket_history_orderadditional_msg"
name="data[history][msg]"
style="display:none;"></textarea>
</dd>
<script type="text/javascript">
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.orderadditional_history_changed = function(el) {
var fields = ['hikamarket_history_orderadditional_msg'],
displayValue = '';
if(!el.checked) displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
}
</script>
<?php
}
?>
</dl>
<input type="hidden" name="data[additional]"
value="1" />
<input type="hidden" name="data[customfields]"
value="1" />
<input type="hidden" name="cid[]"
value="<?php echo @$this->order->order_id; ?>" />
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="save" />
<input type="hidden" name="subtask"
value="additional" />
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="ctrl"
value="order" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
PK��[�!!tmpl/edit_products.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order&task=save&subtask=product&tmpl=component');
?>" name="hikamarket_order_product_form"
id="hikamarket_order_product_form" method="post"
enctype="multipart/form-data">
<dl class="hikam_options">
<dt
class="hikamarket_order_product_id"><label><?php echo
JText::_('PRODUCT'); ?></label></dt>
<dd class="hikamarket_order_product_id"><?php echo
(int)@$this->orderProduct->product_id; ?> - <?php echo
@$this->originalProduct->product_name; ?></dd>
<dt
class="hikamarket_order_product_name"><label><?php
echo JText::_('HIKA_NAME'); ?></label></dt>
<dd class="hikamarket_order_product_name">
<input type="text"
name="data[order][product][order_product_name]"
value="<?php echo
$this->escape(@$this->orderProduct->order_product_name);
?>" />
</dd>
<dt
class="hikamarket_order_product_code"><label><?php
echo JText::_('PRODUCT_CODE'); ?></label></dt>
<dd class="hikamarket_order_product_code">
<input type="text"
name="data[order][product][order_product_code]"
value="<?php echo
$this->escape(@$this->orderProduct->order_product_code);
?>" />
</dd>
<dt
class="hikamarket_order_product_price"><label><?php
echo JText::_('UNIT_PRICE'); ?></label></dt>
<dd class="hikamarket_order_product_price">
<input type="text"
name="data[order][product][order_product_price]"
value="<?php echo @$this->orderProduct->order_product_price;
?>" />
</dd>
<dt
class="hikamarket_order_product_vat"><label><?php
echo JText::_('VAT'); ?></label></dt>
<dd class="hikamarket_order_product_vat">
<input type="text"
name="data[order][product][order_product_tax]"
value="<?php echo @$this->orderProduct->order_product_tax;
?>" />
<?php echo $this->ratesType->display(
"data[order][product][tax_namekey]" ,
@$this->orderProduct->order_product_tax_info[0]->tax_namekey );
?>
</dd>
<dt
class="hikamarket_order_product_quantity"><label><?php
echo JText::_('PRODUCT_QUANTITY');
?></label></dt>
<dd class="hikamarket_order_product_quantity">
<input type="text"
name="data[order][product][order_product_quantity]"
value="<?php echo
@$this->orderProduct->order_product_quantity; ?>" />
</dd>
<?php
if(!empty($this->fields['item'])) {
$editCustomFields = false;
$editCustomFields = true;
foreach($this->fields['item'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_product_customfield
hikamarket_order_product_customfield_<?php echo $fieldName;
?>"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></dt>
<dd class="hikamarket_order_product_customfield
hikamarket_order_product_customfield_<?php echo $fieldName;
?>"><span><?php
if($editCustomFields) {
echo $this->fieldsClass->display($oneExtraField,
@$this->orderProduct->$fieldName,
'data[order][product]['.$fieldName.']',false,'',true);
} else {
echo $this->fieldsClass->show($oneExtraField,
@$this->orderProduct->$fieldName);
}
?></span></dd>
<?php
}
}
if(hikamarket::level(1) && $this->vendor->vendor_id <= 1
&& hikamarket::acl('order/edit/vendor') &&
!empty($this->orderProduct->vendor_data)) {
?>
<dt
class="hikamarket_orderproduct_vendor"><label><?php
echo JText::_('HIKA_VENDOR'); ?></label></dt>
<dd class="hikamarket_orderproduct_vendor"><?php
if(!empty($this->orderProduct->vendor_data->order_vendor_id))
{
echo $this->orderProduct->vendor_data->order_vendor_id;
echo ' - ';
if(isset($this->orderProduct->vendor_data->vendor_name))
echo $this->orderProduct->vendor_data->vendor_name;
else
echo $this->orderProduct->vendor->vendor_name;
} else
echo '-';
?><input type="hidden"
name="data[market][product][order_product_vendor_id]"
value="<?php echo
@$this->orderProduct->vendor_data->order_vendor_id;
?>"/></dd>
<dt
class="hikamarket_orderproduct_vendorprice"><label><?php
echo JText::_('HIKAM_VENDOR_UNIT_PRICE');
?></label></dt>
<dd class="hikamarket_orderproduct_vendorprice">
<input type="text"
name="data[order][product][order_product_vendor_price]"
value="<?php echo
@$this->orderProduct->vendor_data->order_product_vendor_price;
?>"/>
</dd>
<?php
}
if(hikamarket::acl('order/edit/history')) {
?>
<dt
class="hikamarket_orderproduct_history"><label><?php
echo JText::_('HISTORY'); ?></label></dt>
<dd class="hikamarket_orderproduct_history">
<span><input
onchange="window.orderMgr.orderproduct_history_changed(this);"
type="checkbox"
id="hikamarket_history_orderproduct_store"
name="data[history][store_data]"
value="1"/><label
for="hikamarket_history_orderproduct_store"
style="display:inline-block"><?php echo
JText::_('SET_HISTORY_MESSAGE');?></label></span><br/>
<textarea id="hikamarket_history_orderproduct_msg"
name="data[history][msg]"
style="display:none;"></textarea>
</dd>
<script type="text/javascript">
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.orderproduct_history_changed = function(el) {
var fields = ['hikamarket_history_orderproduct_msg'],
displayValue = '';
if(!el.checked) displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
}
</script>
<?php
}
?>
</dl>
<input type="hidden"
name="data[order][history][history_type]"
value="modification" />
<input type="hidden"
name="data[order][product][order_product_id]"
value="<?php echo
@$this->orderProduct->order_product_id;?>" />
<input type="hidden"
name="data[order][product][product_id]" value="<?php echo
@$this->orderProduct->product_id;?>" />
<input type="hidden"
name="data[order][product][order_id]" value="<?php echo
@$this->orderProduct->order_id;?>" />
<input type="hidden" name="data[products]"
value="1" />
<input type="hidden" name="cid[]"
value="<?php echo @$this->orderProduct->order_id; ?>"
/>
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="save" />
<input type="hidden" name="subtask"
value="products" />
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="ctrl"
value="order" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
PK��[;�L]AAtmpl/export.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
while(ob_get_level() > 1)
ob_end_clean();
$separator = $this->shopConfig->get('csv_separator',
';');
$force_text = $this->shopConfig->get('csv_force_text',
false);
$decimal_separator =
$this->shopConfig->get('csv_decimal_separator','.');
$this->export->init($this->export_format,
'order_export', $separator, true, $decimal_separator,
$force_text);
if(!empty($this->orders)){
$maxProd = 0;
$productFields = null;
foreach($this->orders as $order){
$nbProd = count($order->products);
if($maxProd < $nbProd){
$maxProd = $nbProd;
if(empty($productFields)){
$productFields =
array_keys(get_object_vars(reset($order->products)));
}
}
}
if($maxProd && !empty($productFields)) {
$first = array();
$o = reset($this->orders);
foreach($o as $key => $val) {
if(is_array($val))
continue;
$first[] = $key;
}
$o = null;
for($i=1;$i<=$maxProd;$i++){
foreach($productFields as $field){
$first[] = 'item'.$i.'_'.$field;
}
}
} else {
$first = array_keys(get_object_vars(reset($this->orders)));
}
$this->export->writeLine($first);
foreach($this->orders as $row){
if(!empty($row->user_created)) $row->user_created =
hikashop_getDate($row->user_created,'%Y-%m-%d %H:%M:%S');
if(!empty($row->order_created)) $row->order_created =
hikashop_getDate($row->order_created,'%Y-%m-%d %H:%M:%S');
if(!empty($row->order_modified)) $row->order_modified =
hikashop_getDate($row->order_modified,'%Y-%m-%d %H:%M:%S');
if($maxProd && !empty($productFields)){
for($i=1;$i<=$maxProd;$i++){
$prod =& $row->products[$i-1];
foreach($productFields as $field){
$n = 'item_'.$i.'_'.$field;
$row->$n = @$prod->$field;
}
}
}
$this->export->writeLine($row);
}
}
$this->export->send();
exit;
PK��[=�s_
_
tmpl/export_show.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order'); ?>"
method="post" id="hikamarket_order_export_form"
name="hikamarket_order_export_form">
<dl class="hikam_options">
<dt
class="hikamarket_order_export_search"><label><?php
echo JText::_('FILTER'); ?></label></dt>
<dd class="hikamarket_order_export_search">
<?php if(!HIKASHOP_RESPONSIVE) { ?>
<input type="text" name="search"
id="hikamarket_order_listing_search" value="<?php echo
$this->escape($this->pageInfo->search);?>"
class=""/>
<?php } else { ?>
<div class="input-prepend input-append">
<span class="add-on"><i
class="icon-filter"></i></span>
<input type="text" name="search"
id="hikamarket_order_listing_search" value="<?php echo
$this->escape($this->pageInfo->search);?>"
class=""/>
</div>
<?php } ?>
</dd>
<dt
class="hikamarket_order_export_status"><label><?php
echo JText::_('ORDER_STATUS'); ?></label></dt>
<dd class="hikamarket_order_export_status"><?php
echo $this->orderStatusType->display('filter_status',
$this->pageInfo->filter->filter_status, '', true);
?></dd>
<dt
class="hikamarket_order_export_payment"><label><?php
echo JText::_('HIKASHOP_PAYMENT_METHOD');
?></label></dt>
<dd class="hikamarket_order_export_payment"><?php
echo $this->paymentType->display('filter_payment',
$this->pageInfo->filter->filter_payment, false);
?></dd>
<dt
class="hikamarket_order_export_startdate"><label><?php
echo JText::_('START_DATE'); ?></label></dt>
<dd class="hikamarket_order_export_startdate"><?php
echo JHTML::_('calendar',
hikamarket::getDate((!empty($this->pageInfo->filter->filter_startdate)?$this->pageInfo->filter->filter_startdate:''),'%Y-%m-%d
%H:%M'),
'filter_startdate','start_date','%Y-%m-%d
%H:%M',array('size' => '20'));
?></dd>
<dt
class="hikamarket_order_export_enddate"><label><?php
echo JText::_('END_DATE'); ?></label></dt>
<dd class="hikamarket_order_export_enddate"><?php
echo JHTML::_('calendar',
hikamarket::getDate((!empty($this->pageInfo->filter->filter_enddate)?$this->pageInfo->filter->filter_enddate:''),'%Y-%m-%d
%H:%M'),
'filter_enddate','end_date','%Y-%m-%d
%H:%M',array('size' => '20'));
?></dd>
<dt
class="hikamarket_order_export_format"><label><?php
echo JText::_('EXPORT_FORMAT'); ?></label></dt>
<dd class="hikamarket_order_export_format"><?php
$values = array(
JHTML::_('select.option', 'csv',
JText::_('HIKAM_EXPORT_CSV')),
JHTML::_('select.option', 'xls',
JText::_('HIKAM_EXPORT_XLS'))
);
echo JHTML::_('hikaselect.radiolist', $values,
'data[export][format]', '', 'value',
'text', 'csv');
?></dd>
</dl>
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>" />
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="export" />
<input type="hidden" name="ctrl"
value="<?php echo hikaInput::get()->getCmd('ctrl');
?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<script type="text/javascript">
window.hikashop.ready(function(){
window.hikamarket.dlTitle('hikamarket_order_export_form'); });
</script>
PK��[�F�zD#D#tmpl/history.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->history))
return;
?>
<div class="hikamarket_order">
<dl class="hikam_options">
<dt
class="hikamarket_order_history_type"><label><?php
echo JText::_('HIKA_TYPE'); ?></label></dt>
<dd
class="hikamarket_order_history_type"><span><?php
if(!empty($this->history->history_type))
echo $this->escape($this->history->history_type);
else
echo '<em>' . JText::_('HIKA_NONE') .
'</em>';
?></span></dd>
<dt
class="hikamarket_order_history_date"><label><?php
echo JText::_('DATE'); ?></label></dt>
<dd
class="hikamarket_order_history_date"><span><?php
echo hikamarket::getDate($this->history->history_created,
'%Y-%m-%d %H:%M');
?></span></dd>
<dt
class="hikamarket_order_history_user"><label><?php
echo JText::_('HIKA_USER'); ?></label></dt>
<dd
class="hikamarket_order_history_user"><span><?php
echo $this->escape($this->history->user->name) . '
(' . $this->escape($this->history->user->user_email) .
')';
?></span></dd>
<dt
class="hikamarket_order_history_status"><label><?php
echo JText::_('ORDER_STATUS'); ?></label></dt>
<dd
class="hikamarket_order_history_status"><span><?php
echo hikamarket::orderStatus($this->history->history_new_status);
?></span></dd>
<?php if(!empty($this->history->history_reason)) { ?>
<dt
class="hikamarket_order_history_reason"><label><?php
echo JText::_('REASON'); ?></label></dt>
<dd
class="hikamarket_order_history_reason"><span><?php
echo $this->escape($this->history->history_reason);
?></span></dd>
<?php } ?>
<?php if(!empty($this->history->history_ip)) { ?>
<dt
class="hikamarket_order_history_ip"><label><?php echo
JText::_('IP'); ?></label></dt>
<dd
class="hikamarket_order_history_ip"><span><?php
echo $this->escape($this->history->history_ip);
?></span></dd>
<?php } ?>
<?php if(!empty($this->history->history_data) &&
is_string($this->history->history_data)) { ?>
<dt
class="hikamarket_order_history_data"><label><?php
echo JText::_('DATA'); ?></label></dt>
<dd
class="hikamarket_order_history_data"><span><?php
echo $this->escape($this->history->history_data);
?></span></dd>
<?php } ?>
</dl>
<?php if(!empty($this->history->history_data) &&
!is_string($this->history->history_data)) { ?>
<div class="hikamarket_order_history_data"><?php
if(isset($this->history->history_data['customer'])) {
$data = $this->history->history_data['customer'];
$userClass = hikamarket::get('shop.class.user');
$old_customer = $new_customer = null;
if(!empty($data['old']))
$old_customer = $userClass->get( (int)$data['old'] );
if(!empty($data['new']))
$new_customer = $userClass->get( (int)$data['new'] );
?>
<h3><?php echo JText::_('HIKAM_HISTORY_CUSTOMER');
?></h3>
<h4><?php echo JText::_('HIKAM_HISTORY_OLD');
?></h4>
<dl class="hikam_options">
<dt class="history_data_customer_name"><?php echo
JText::_('HIKA_NAME'); ?></dt>
<dd class="history_data_customer_name"><?php
if(empty($old_customer))
echo JText::_('HIKAM_USER_DOES_NOT_EXIST_ANYMORE');
elseif(!empty($old_customer->name))
echo $old_customer->name;
else
echo '<em>' . JText::_('HIKA_NONE') .
'</em>';
?></dd>
<?php if(!empty($old_customer)) { ?>
<dt
class="history_data_customer_email"><label><?php echo
JText::_('HIKA_EMAIL');?></label></dt>
<dd class="history_data_customer_email"><?php echo
$this->escape(@$new_customer->user_email); ?></dd>
<?php } ?>
</dl>
<h4><?php echo JText::_('HIKAM_HISTORY_NEW');
?></h4>
<dl class="hikam_options">
<dt class="history_data_customer_name"><?php echo
JText::_('HIKA_NAME'); ?></dt>
<dd class="history_data_customer_name"><?php
if(empty($new_customer))
echo JText::_('HIKAM_USER_DOES_NOT_EXIST_ANYMORE');
elseif(!empty($new_customer->name))
echo $new_customer->name;
else
echo '<em>' . JText::_('HIKA_NONE') .
'</em>';
?></dd>
<?php if(!empty($new_customer)) { ?>
<dt
class="history_data_customer_email"><label><?php echo
JText::_('HIKA_EMAIL');?></label></dt>
<dd class="history_data_customer_email"><?php echo
$this->escape(@$new_customer->user_email); ?></dd>
<?php } ?>
</dl>
<?php
}
if(isset($this->history->history_data['coupon'])) {
$data = $this->history->history_data['coupon'];
?>
<h3><?php echo JText::_('HIKAM_HISTORY_COUPON');
?></h3>
<h4><?php echo JText::_('HIKAM_HISTORY_OLD');
?></h4>
<dl class="hikam_options">
<?php if(isset($data['old']['code'])) { ?>
<dt
class="history_data_coupon_code"><label><?php echo
JText::_('COUPON_CODE');?></label></dt>
<dd class="history_data_coupon_code"><?php echo
$this->escape($data['old']['code']);
?></dd>
<?php } ?>
<?php if(isset($data['old']['value'])) { ?>
<dt
class="history_data_coupon_value"><label><?php echo
JText::_('COUPON_VALUE');?></label></dt>
<dd class="history_data_coupon_value"><?php
echo
(float)hikamarket::toFloat($data['old']['value']);
?></dd>
<?php } ?>
<?php if(isset($data['old']['tax'])) { ?>
<dt class="history_data_coupon_tax"><label><?php
echo JText::_('COUPON_TAX');?></label></dt>
<dd class="history_data_coupon_tax"><?php
echo
(float)hikamarket::toFloat($data['old']['tax']);
?></dd>
<?php } ?>
<?php if(isset($data['old']['tax_namekey'])) {
?>
<dt
class="history_data_coupon_taxnamekey"><label><?php
echo JText::_('COUPON_TAX');?></label></dt>
<dd class="history_data_coupon_taxnamekey"><?php echo
$this->escape($data['old']['tax_namekey']);
?></dd>
<?php } ?>
</dl>
<h4><?php echo JText::_('HIKAM_HISTORY_NEW');
?></h4>
<dl class="hikam_options">
<?php if(isset($data['new']['code'])) { ?>
<dt
class="history_data_coupon_code"><label><?php echo
JText::_('COUPON_CODE');?></label></dt>
<dd class="history_data_coupon_code"><?php echo
$this->escape($data['new']['code']);
?></dd>
<?php } ?>
<?php if(isset($data['new']['value'])) { ?>
<dt
class="history_data_coupon_value"><label><?php echo
JText::_('COUPON_VALUE');?></label></dt>
<dd class="history_data_coupon_value"><?php
echo
(float)hikamarket::toFloat($data['new']['value']);
?></dd>
<?php } ?>
<?php if(isset($data['new']['tax'])) { ?>
<dt class="history_data_coupon_tax"><label><?php
echo JText::_('COUPON_TAX');?></label></dt>
<dd class="history_data_coupon_tax"><?php
echo
(float)hikamarket::toFloat($data['new']['tax']);
?></dd>
<?php } ?>
<?php if(isset($data['new']['tax_namekey'])) {
?>
<dt
class="history_data_coupon_taxnamekey"><label><?php
echo JText::_('COUPON_TAX');?></label></dt>
<dd class="history_data_coupon_taxnamekey"><?php echo
$this->escape($data['new']['tax_namekey']);
?></dd>
<?php } ?>
</dl>
<?php
}
if(isset($this->history->history_data['shipping'])) {
$data = $this->history->history_data['shipping'];
}
if(isset($this->history->history_data['payment'])) {
$data = $this->history->history_data['payment'];
}
if(isset($this->history->history_data['fields'])) {
$data = $this->history->history_data['fields'];
}
if(isset($this->history->history_data['billing_address']))
{
$data = $this->history->history_data['billing_address'];
}
if(isset($this->history->history_data['shipping_address']))
{
$data =
$this->history->history_data['shipping_address'];
}
if(isset($this->history->history_data['product'])) {
$data = $this->history->history_data['product'];
}
if(isset($this->history->history_data['product_delete']))
{
$data = $this->history->history_data['product_delete'];
?>
<h3><?php echo
JText::_('HIKAM_HISTORY_PRODUCT_DELETE'); ?></h3>
<dl class="hikam_options">
<dt
class="history_data_productdelete_id"><label><?php
echo JText::_('ID');?></label></dt>
<dd class="history_data_productdelete_id"><?php echo
(int)$data['product']['id']; ?></dd>
<dt
class="history_data_productdelete_name"><label><?php
echo JText::_('PRODUCT_NAME');?></label></dt>
<dd class="history_data_productdelete_name"><?php echo
$this->escape($data['product']['name']);
?></dd>
<dt
class="history_data_productdelete_code"><label><?php
echo JText::_('PRODUCT_CODE');?></label></dt>
<dd class="history_data_productdelete_code"><?php echo
$this->escape($data['product']['code']);
?></dd>
<dt
class="history_data_productdelete_qty"><label><?php
echo JText::_('PRODUCT_QUANTITY');?></label></dt>
<dd class="history_data_productdelete_qty"><?php echo
(int)$data['product']['qty']; ?></dd>
<dt
class="history_data_productdelete_price"><label><?php
echo JText::_('PRICE');?></label></dt>
<dd class="history_data_productdelete_price"><?php
echo
(float)hikamarket::toFloat($data['product']['price']);
?></dd>
</dl>
<?php
}
?></div>
<?php } ?>
</div>
PK��[wtW�tmpl/index.htmlnu�[���<html><body></body></html>PK��[��&�;;tmpl/invoice.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div id="hikamarket_invoice_main_div">
<div id="print" style="float:right">
<a href="#"
onclick="document.getElementById('print').style.visibility='hidden';window.focus();window.print();return
false;">
<img src="<?php echo HIKASHOP_IMAGES;
?>print.png"/>
</a>
</div>
<br/>
<table width="100%">
<tr>
<td>
<h1 style="text-align:center"><?php
if($this->invoice_type=='full') {
echo JText::_('INVOICE');
} else {
echo JText::_('SHIPPING_INVOICE');
}
?></h1>
</td>
</tr>
<tr>
<td>
<div style="float:right;width:100px;padding-top:20px">
<?php
$date = (!empty($this->element->order_invoice_created)) ?
$this->element->order_invoice_created :
@$this->element->order_created;
echo JText::_('DATE') . ': ' .
hikamarket::getDate($date, '%d %B %Y ');
?>
<br/>
<?php echo JText::_('INVOICE') . ': ' .
@$this->element->order_invoice_number; ?>
</div>
<p><?php
if($this->vendor->vendor_id == 0 || $this->vendor->vendor_id ==
1) {
echo $this->store_address;
} else {
$params = null; $js = null;
$html = hikamarket::getLayout('shop.address',
'address_template', $params, $js);
foreach($this->extraFields['vendor'] as $field) {
$fieldname = $field->field_namekey;
$html = str_replace('{' . str_replace('vendor_',
'', $fieldname) . '}',
$this->fieldsClass->show($field, $this->vendor->$fieldname),
$html);
}
echo
str_replace("\n","<br/>\n",trim(str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)),"\n"));
}
?></p>
</td>
</tr>
<tr>
<td>
<table width="100%">
<tr>
<?php if($this->invoice_type=='full' &&
!empty($this->element->billing_address)){ ?>
<td>
<fieldset class="adminform"
id="htmlfieldset_billing">
<legend style="background-color: #FFFFFF;"><?php
echo JText::_('HIKASHOP_BILLING_ADDRESS'); ?></legend>
<?php
$params = null; $js = null;
$html = hikamarket::getLayout('shop.address',
'address_template', $params, $js);
foreach($this->element->fields as $field) {
$fieldname = $field->field_namekey;
$html = str_replace('{'.$fieldname.'}',
$this->fieldsClass->show($field,
$this->element->billing_address->$fieldname), $html);
}
echo
str_replace("\n","<br/>\n",trim(str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)),"\n"));
?>
</fieldset>
</td>
<?php } ?>
<td>
<?php if(!empty($this->element->order_shipping_id) &&
!empty($this->element->shipping_address)) { ?>
<fieldset class="adminform"
id="htmlfieldset_shipping">
<legend style="background-color: #FFFFFF;"><?php
echo JText::_('HIKASHOP_SHIPPING_ADDRESS'); ?></legend>
<?php
if(empty($this->element->override_shipping_address)) {
$params = null; $js = null;
$html = hikamarket::getLayout('shop.address',
'address_template', $params, $js);
foreach($this->element->fields as $field){
$fieldname = $field->field_namekey;
$html = str_replace('{'.$fieldname.'}',
$this->fieldsClass->show($field,
$this->element->shipping_address->$fieldname), $html);
}
echo str_replace("\n", "<br/>\n",
trim(str_replace("\n\n", "\n",
preg_replace('#{(?:(?!}).)*}#i', '',
$html)),"\n"));
} else {
echo $this->element->override_shipping_address;
}
?>
</fieldset>
<?php } ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<fieldset class="adminform"
id="htmlfieldset_products">
<legend style="background-color: #FFFFFF;"><?php
echo JText::_('PRODUCT_LIST'); ?></legend>
<table class="adminlist table table-striped"
cellpadding="1" width="100%">
<thead>
<tr>
<th class="title" width="60%">
<?php echo JText::_('PRODUCT'); ?>
</th>
<?php if ($this->shopConfig->get('show_code')) { ?>
<th class="title" ><?php echo
JText::_('CART_PRODUCT_CODE'); ?></th>
<?php } ?>
<?php if($this->invoice_type == 'full') { ?>
<th class="title">
<?php echo JText::_('UNIT_PRICE'); ?>
</th>
<?php } ?>
<th class="title titletoggle">
<?php echo JText::_('PRODUCT_QUANTITY'); ?>
</th>
<?php if($this->invoice_type == 'full') { ?>
<th class="title titletoggle">
<?php echo JText::_('PRICE'); ?>
</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
$k = 0;
$group = $this->shopConfig->get('group_options', 0);
foreach($this->order->products as $product) {
if($group && $product->order_product_option_parent_id)
continue;
?>
<tr class="row<?php echo $k;?>">
<td>
<?php echo $product->order_product_name.'
'.$product->order_product_code; ?>
<p
class="hikashop_order_product_custom_item_fields">
<?php
if($group) {
$display_item_price = false;
foreach($this->order->products as $j => $optionElement) {
if($optionElement->order_product_option_parent_id !=
$product->order_product_id)
continue;
if($optionElement->order_product_price > 0) {
$display_item_price = true;
}
}
if($display_item_price) {
if($this->shopConfig->get('price_with_tax')) {
echo '
'.$this->currencyHelper->format($product->order_product_price+$product->order_product_tax,$this->order->order_currency_id);
} else {
echo '
'.$this->currencyHelper->format($product->order_product_price,$this->order->order_currency_id);
}
}
}
if(hikashop_level(2) &&
!empty($this->fields['item'])) {
foreach($this->fields['item'] as $field) {
$namekey = $field->field_namekey;
if(empty($product->$namekey))
continue;
echo '<p
class="hikashop_order_item_'.$namekey.'">'.$this->fieldsClass->getFieldName($field).':
'.$this->fieldsClass->show($field,$product->$namekey).'</p>';
}
}
if($group) {
foreach($this->order->products as $j => $optionElement) {
if($optionElement->order_product_option_parent_id !=
$product->order_product_id) continue;
$product->order_product_price
+=$optionElement->order_product_price;
$product->order_product_tax +=$optionElement->order_product_tax;
$product->order_product_total_price+=$optionElement->order_product_total_price;
$product->order_product_total_price_no_vat+=$optionElement->order_product_total_price_no_vat;
?>
<p class="hikashop_order_option_name">
<?php
echo $optionElement->order_product_name;
if($optionElement->order_product_price > 0) {
if($this->shopConfig->get('price_with_tax')) {
echo ' ( +
'.$this->currencyHelper->format($optionElement->order_product_price+$optionElement->order_product_tax,$this->order->order_currency_id).'
)';
} else {
echo ' ( +
'.$this->currencyHelper->format($optionElement->order_product_price,$this->order->order_currency_id).'
)';
}
}
?>
</p>
<?php
}
}
?>
</p>
</td>
<?php if ($this->shopConfig->get('show_code')) { ?>
<td><p
class="hikashop_product_code_invoice"><?php echo
$product->order_product_code; ?></p></td>
<?php } ?>
<?php if($this->invoice_type == 'full') {?>
<td>
<?php
if($this->shopConfig->get('price_with_tax')) {
echo
$this->currencyHelper->format($product->order_product_price+$product->order_product_tax,$this->order->order_currency_id);
} else {
echo
$this->currencyHelper->format($product->order_product_price,$this->order->order_currency_id);
}
?>
</td>
<?php } ?>
<td align="center"><?php echo
$product->order_product_quantity;?></td>
<?php if($this->invoice_type == 'full') { ?>
<td>
<?php
if($this->shopConfig->get('price_with_tax')) {
echo
$this->currencyHelper->format($product->order_product_total_price,$this->order->order_currency_id);
} else {
echo
$this->currencyHelper->format($product->order_product_total_price_no_vat,$this->order->order_currency_id);
}
?>
</td>
<?php } ?>
</tr>
<?php
$k = 1 - $k;
}
?>
<?php if($this->invoice_type == 'full') { ?>
<tr>
<td style="border-top:2px solid #B8B8B8;"
colspan="2"></td>
<td style="border-top:2px solid #B8B8B8;"
class="key">
<label><?php echo JText::_('SUBTOTAL');
?></label>
</td>
<td style="border-top:2px solid #B8B8B8;">
<?php
if($this->shopConfig->get('price_with_tax')) {
echo
$this->currencyHelper->format($this->order->order_subtotal,$this->order->order_currency_id);
} else {
echo
$this->currencyHelper->format($this->order->order_subtotal_no_vat,$this->order->order_currency_id);
}
?>
</td>
</tr>
<?php
$taxes = $this->order->order_subtotal -
$this->order->order_subtotal_no_vat +
$this->order->order_shipping_tax -
$this->order->order_discount_tax -
$this->order->order_payment_tax;
if($taxes != 0) {
if($this->shopConfig->get('detailed_tax_display')
&& !empty($this->order->order_tax_info)) {
foreach($this->order->order_tax_info as $tax) {
?>
<tr>
<td colspan="2">
</td>
<td class="hikashop_order_tax_title key">
<label><?php
echo $tax->tax_namekey;
?></label>
</td>
<td class="hikashop_order_tax_value"><?php
echo $this->currencyHelper->format($tax->tax_amount,
$this->order->order_currency_id);
?></td>
</tr>
<?php
}
} else {
?>
<tr>
<td colspan="2">
</td>
<td class="hikashop_order_tax_title key">
<label><?php
echo JText::_('VAT');
?></label>
</td>
<td class="hikashop_order_tax_value"><?php
echo $this->currencyHelper->format($taxes,
$this->order->order_currency_id);
?></td>
</tr>
<?php
}
}
if($this->order->order_discount_price != 0) {
?>
<tr>
<td colspan="2">
</td>
<td class="key">
<label><?php
echo JText::_('HIKASHOP_COUPON');
?></label>
</td>
<td>
<?php
if($this->shopConfig->get('price_with_tax')) {
echo
$this->currencyHelper->format($this->order->order_discount_price
* -1.0, $this->order->order_currency_id);
} else {
echo
$this->currencyHelper->format(($this->order->order_discount_price
- @$this->order->order_discount_tax) * -1.0,
$this->order->order_currency_id);
}
?>
</td>
</tr>
<?php }
if(!empty($this->order->additional)) {
$exclude_additionnal = explode(',',
$this->shopConfig->get('order_additional_hide',
''));
foreach($this->order->additional as $additional) {
if(in_array($additional->order_product_name, $exclude_additionnal))
continue;
?>
<tr>
<td colspan="2">
</td>
<td class="hikashop_order_additionall_title key">
<label><?php
echo JText::_($additional->order_product_name);
?></label>
</td>
<td><?php
if(!empty($additional->order_product_price)) {
$additional->order_product_price =
(float)$additional->order_product_price;
}
if(!empty($additional->order_product_price) ||
empty($additional->order_product_options)) {
echo
$this->currencyHelper->format($additional->order_product_price,
$this->order->order_currency_id);
} else {
echo $additional->order_product_options;
}
?></td>
</tr>
<?php
}
}
if($this->order->order_shipping_price != 0) {
?>
<tr>
<td colspan="2">
</td>
<td class="key">
<label><?php echo JText::_( 'SHIPPING' );
?></label>
</td>
<td>
<?php
if($this->shopConfig->get('price_with_tax')) {
echo
$this->currencyHelper->format($this->order->order_shipping_price,
$this->order->order_currency_id);
} else {
echo
$this->currencyHelper->format($this->order->order_shipping_price
- @$this->order->order_shipping_tax,
$this->order->order_currency_id);
}
?>
</td>
</tr>
<?php
}
if($this->order->order_payment_price != 0 ||
($this->shopConfig->get('price_with_tax') &&
$this->order->order_payment_tax != 0)) {
?>
<tr>
<td colspan="2">
</td>
<td class="key">
<label><?php echo JText::_( 'HIKASHOP_PAYMENT'
); ?></label>
</td>
<td><?php
if($this->shopConfig->get('price_with_tax')) {
echo
$this->currencyHelper->format($this->order->order_payment_price,
$this->order->order_currency_id);
} else {
echo
$this->currencyHelper->format($this->order->order_payment_price
- @$this->order->order_payment_tax,
$this->order->order_currency_id);
}
?></td>
</tr>
<?php } ?>
<tr>
<td colspan="2">
</td>
<td class="key">
<label><?php echo JText::_( 'HIKASHOP_TOTAL' );
?></label>
</td>
<td><?php echo
$this->currencyHelper->format($this->order->order_full_price,
$this->order->order_currency_id); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</fieldset>
</td>
</tr>
<?php
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
JFactory::getApplication()->triggerEvent('onAfterOrderProductsListingDisplay',
array(&$this->order, 'order_frontvendor_invoice'));
if($this->invoice_type == 'full') {
if(!empty($this->fields['order']) &&
hikashop_level(2)) {
?>
<tr>
<td>
<fieldset
class="hikashop_order_custom_fields_fieldset">
<legend><?php echo
JText::_('ADDITIONAL_INFORMATION'); ?></legend>
<table class="hikashop_order_custom_fields_table
adminlist" cellpadding="1" width="100%">
<?php foreach($this->fields['order'] as $fieldName =>
$oneExtraField) { ?>
<tr class="hikashop_order_custom_field_<?php echo
$fieldName;?>_line">
<td class="key"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></td>
<td><?php echo
$this->fieldsClass->show($oneExtraField,
@$this->order->$fieldName); ?></td>
</tr>
<?php } ?>
</table>
</fieldset>
</td>
</tr>
<?php } ?>
<tr>
<td>
<?php
if(!empty($this->shipping)) {
echo JText::_('HIKASHOP_SHIPPING_METHOD').' : ';
if(is_string($this->order->order_shipping_method))
echo
$this->shipping->getName($this->order->order_shipping_method,
$this->order->order_shipping_id);
else
echo implode(', ',
$this->order->order_shipping_method);
echo '<br/>';
}
if(!empty($this->payment)) {
echo JText::_('HIKASHOP_PAYMENT_METHOD').' :
'.$this->payment->getName($this->order->order_payment_method,
$this->order->order_payment_id);
}
?>
</td>
</tr>
<?php } ?>
<tr>
<td>
</td>
</tr>
</table>
</div>
<div style="page-break-after:always"></div>
PK��[~�㏦$�$tmpl/listing.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div id="hikam_product_listing">
<form action="<?php echo
hikamarket::completeLink('order&task=listing'); ?>"
method="post" id="adminForm"
name="adminForm">
<div class="hk-row-fluid">
<div class="hkc-md-12">
<?php
echo $this->loadHkLayout('search', array(
'id' => 'hikamarket_order_listing_search'
));
?>
<div class="hikam_sort_zone"><?php
if(!empty($this->ordering_values))
echo JHTML::_('select.genericlist',
$this->ordering_values, 'filter_fullorder',
'onchange="this.form.submit();"', 'value',
'text', $this->full_ordering);
?></div>
</div>
<div class="hkc-md-12">
<div class="expand-filters">
<?php
echo $this->orderStatusType->display('filter_status',
$this->pageInfo->filter->filter_status, '
onchange="document.adminForm.submit();"', true);
if(!empty($this->pageInfo->filter->filter_user)) {
$userClass = hikamarket::get('shop.class.user');
$user_filter =
$userClass->get($this->pageInfo->filter->filter_user);
?>
<input type="hidden" name="filter_user"
value="<?php echo
(int)$this->pageInfo->filter->filter_user; ?>"
id="hikamarket_order_listing_filter_user" />
<button class="hikabtn" onclick="var el =
document.getElementById('hikamarket_order_listing_filter_user');
if(el) el.value = ''; document.adminForm.submit(); return
false;"><?php echo $user_filter->user_email; ?> <i
class="far fa-trash-alt"></i></button>
<?php
}
foreach($this->extrafilters as $name => $filterObj) {
echo $filterObj->displayFilter($name, $this->pageInfo->filter);
}
?>
</div>
<div style="clear:both"></div>
</div>
</div>
<?php
if(!empty($this->order_stats)) {
?><table class="order_statistics hikam_table
hikam_bordered" style="width:100%">
<tr>
<?php
$width = floor(100 / (count($this->order_stats)+1));
$total_orders = 0;
foreach($this->order_stats as $status => $obj) {
if(empty($status))
continue;
$total = (int)$obj->total;
$total_orders += $total;
$class = ($this->pageInfo->filter->filter_status == $status) ?
'order_statistics_active' : '';
?> <td style="width:<?php echo $width;?>%"
class="<?php echo $class; ?>">
<a href="<?php echo
hikamarket::completeLink('order&task=listing&filter_status='.$status);
?>">
<span class="value"><?php echo $total;
?></span>
<span class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$status)); ?>"><?php
echo hikamarket::orderStatus($status);
?></span>
</a>
</td>
<?php
}
?>
<td style="width:<?php echo $width;?>%">
<a href="<?php echo
hikamarket::completeLink('order&task=listing&filter_status=');
?>">
<span class="value"><?php echo $total_orders;
?></span>
<span class="order-label order-label-all"><?php echo
JText::_('HIKAM_STAT_ALL'); ?></span>
</a>
</td>
</tr>
</table>
<?php
}
?>
<div id="hikam_order_main_listing">
<?php
$manage = hikamarket::acl('order/show');
$extra_classes = '';
foreach($this->orders as $order) {
$url = ($manage) ?
hikamarket::completeLink('order&task=show&cid='.$order->order_id)
: null;
?>
<div class="hk-card hk-card-default hk-card-vendor-order<?php
echo $extra_classes; ?>" data-hkm-order="<?php echo
(int)$order->order_id; ?>">
<div class="hk-card-header">
<?php if(!empty($url)) { ?>
<a class="hk-row-fluid" href="<?php echo $url;
?>">
<?php } else { ?>
<div class="hk-row-fluid">
<?php } ?>
<div class="hkc-sm-6 hkm_order_date">
<i class="fa fa-clock"></i>
<?php echo hikashop_getDate((int)$order->order_created,
'%Y-%m-%d %H:%M'); ?>
</div>
<div class="hkc-sm-6 hkm_order_price">
<i class="fa fa-credit-card"></i>
<?php echo
$this->currencyHelper->format($order->order_full_price,
$order->order_currency_id); ?>
</div>
<?php if(!empty($url)) { ?>
</a>
<?php } else { ?>
</div>
<?php } ?>
</div>
<div class="hk-card-body">
<div class="hk-row-fluid">
<div class="hkc-sm-4 hkm_order_number">
<?php
if(!empty($url)) {
?><a href="<?php echo $url; ?>"><?php
}
?><i class="far fa-file-alt"
style="margin-right:4px;"></i><span
class="hika_order_number_value"><?php echo
$order->order_number; ?></span><?php
if(!empty($url)) {
?></a><?php
}
?>
<?php if(!empty($order->order_invoice_number)) { ?>
<span class="hkm_order_number_invoice_separator"> -
</span>
<span class="hkm_invoice_number_value"><?php echo
$order->order_invoice_number; ?></span>
<?php } ?>
<?php if(hikamarket::acl('order/show/customer')) { ?>
<div class="hkm_order_customer">
<i class="fas fa-user"></i> <?php echo
$this->escape($order->user_email); ?>
</div>
<?php } ?>
</div>
<div class="hkc-sm-2 hkm_order_status">
<span class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$order->order_status)); ?>"><?php
echo hikamarket::orderStatus($order->order_status);
?></span>
</div>
<div class="hkc-sm-3 hkm_order_billing">
<?php
if(hikamarket::acl('order/show/billingaddress') &&
!empty($order->order_billing_address_id)) {
$full_address =
$this->addressClass->maxiFormat($this->addresses[(int)$order->order_billing_address_id],
$this->address_fields, true);
$country =
$this->addressClass->miniFormat($this->addresses[(int)$order->order_billing_address_id],
$this->address_fields, '{address_city}, {address_state_code_3}
{address_country_code_3}');
echo hikamarket::tooltip($full_address,
JText::_('HIKASHOP_BILLING_ADDRESS'), '', $country,
'', 0);
if(!empty($order->order_payment_method))
echo '<br/>';
}
if(!empty($order->order_payment_method)) {
$payment_price =
$this->currencyHelper->format($order->order_payment_price,
$order->order_currency_id);
if(!empty($this->payments[$order->order_payment_id]))
$payment_name =
$this->payments[$order->order_payment_id]->payment_name;
else
$payment_name = $order->order_payment_method;
echo '<span class="hk-label hk-label-blue">' .
hikamarket::tooltip($payment_price, '', '',
$payment_name, '', 0) .
'</span>';
}
?>
</div>
<div class="hkc-sm-3 hkm_order_shipping">
<?php
if(hikamarket::acl('order/show/shippingaddress') &&
!empty($order->order_shipping_address_id) &&
!empty($order->order_shipping_id)) {
$full_address =
$this->addressClass->maxiFormat($this->addresses[(int)$order->order_shipping_address_id],
$this->address_fields, true);
$country =
$this->addressClass->miniFormat($this->addresses[(int)$order->order_shipping_address_id],
$this->address_fields, '{address_city}, {address_state_code_3}
{address_country_code_3}');
echo hikamarket::tooltip($full_address,
JText::_('HIKASHOP_SHIPPING_ADDRESS'), '', $country,
'', 0);
if(!empty($order->shipping_name))
echo '<br/>';
}
if(!empty($order->shipping_name)) {
if($this->shopConfig->get('price_with_tax'))
$shipping_price =
$this->currencyHelper->format($order->order_shipping_price,
$order->order_currency_id);
else
$shipping_price =
$this->currencyHelper->format($order->order_shipping_price -
@$order->order_shipping_tax, $order->order_currency_id);
echo '<span class="hk-label hk-label-blue">';
if(is_string($order->shipping_name)) {
echo hikamarket::tooltip($shipping_price, '', '',
$order->shipping_name, '', 0);
} else
echo hikamarket::tooltip('- '.implode('<br/>-
',$order->shipping_name),
JText::_('SHIPPING_PRICE').': '.$shipping_price,
'',
'<em>'.JText::_('HIKAM_SEVERAL_SHIPPING').'
»</em>', '', 0);
echo '</span>';
}
?>
</div>
<?php
if(!empty($this->fields)) {
?>
<div class="hkc-sm-12 hkm_order_fields">
<?php
$field_cpt = 0;
foreach($this->fields as $field) {
$namekey = $field->field_namekey;
if($field->field_type == 'customtext' ||
empty($order->$namekey))
continue;
if(empty($field_cpt))
echo '<dl>';
$field_cpt++;
echo
'<dt>'.$this->fieldClass->trans($field->field_realname)
. '</dt>'.
'<dd>'.$this->fieldClass->show($field,
$order->$namekey).'</dd>';
}
if($field_cpt > 0)
echo '</dl>';
?>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
}
?>
<div class="hikamarket_orders_footer">
<div class="hikamarket_pagination">
<?php $this->pagination->form = '_bottom'; echo
$this->pagination->getListFooter(); ?>
<?php echo $this->pagination->getResultsCounter(); ?>
</div>
</div>
</div>
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>" />
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="listing" />
<input type="hidden" name="ctrl"
value="<?php echo hikaInput::get()->getCmd('ctrl');
?>" />
<input type="hidden" name="boxchecked"
value="0" />
<input type="hidden" name="filter_order"
value="<?php echo
$this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $this->pageInfo->filter->order->dir;
?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
</div>
PK��[F� ���tmpl/listing.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<state>
<name>Vendor order listing</name>
<params addpath="/components/com_hikamarket/params">
<param name="options" type="selectoptions"
default="module" label="options"
description="HikaMarket options" />
</params>
</state>
<layout
title="COM_HIKAMARKET_ORDERMARKET_LISTING_DEFAULT_TITLE">
<message></message>
</layout>
<fields name="params"
addfieldpath="/components/com_hikamarket/fields">
<fieldset name="basic" label="HikaMarket
Options">
<field id="options" name="options"
type="selectoptions" label="options"
description="HikaMarket options" />
</fieldset>
</fields>
</metadata>PK��[@/�
tmpl/mail.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order', true); ?>"
method="post" name="hikamarket_mail_form"
id="hikamarket_mail_form">
<div id="hikamarket_email_preview_settings">
<dl class="hikam_options large">
<dt><label for="data[mail][dst_email]"><?php echo
JText::_('TO_ADDRESS'); ?></label></dt>
<dd><?php
$values = array(
0 => JText::_('CUSTOMER'),
1 => JText::_('HIKA_VENDOR'),
);
echo JHTML::_('select.genericlist', $values,
'data[mail][dst_email]', '', 'value',
'text', 0);
?></dd>
<dt><label for="data[mail][subject]"><?php echo
JText::_('EMAIL_SUBJECT'); ?></label></dt>
<dd>
<input type="text" name="data[mail][subject]"
size="80" style="width:90%" value="<?php echo
$this->escape($this->element->mail->subject); ?>"
/>
</dd>
<?php
foreach($this->element->mail_params_config as $k => $v) {
?>
<dt><label for="data[mail][params][<?php echo $k;
?>]"><?php echo JText::_($v[1]);
?></label></dt>
<dd><?php
switch($v[0]) {
case 'textarea':
$placeholder = !empty($v[3]) ? JText::_($v[3], true) :
JText::_('HIKA_INHERIT', true);
echo '<textarea
name="data[mail][params]['.$k.']"
style="width:90%;height:6em;"
placeholder="'.$placeholder.'"
onblur="window.localPage.refreshMail()">'.@$this->element->mail_params[$k].'</textarea>';
break;
case 'boolean':
echo
$this->radioType->booleanlist('data[mail][params]['.$k.']',
'onchange="window.localPage.refreshMail()"',
@$this->element->mail_params[$k]);
break;
}
?></dd>
<?php
}
?>
</dl>
</div>
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="order_id"
value="<?php echo (int)$this->element->order_id; ?>"
/>
<input type="hidden" name="task"
value="mail" />
<input type="hidden" name="ctrl"
value="order" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<script>
if(!window.localPage) window.localPage = {};
window.localPage.refreshMail = function() {
var w = window, d = document, o = w.Oby, el =
d.getElementById('hikamarket_mail_preview'),
data = o.getFormData('hikamarket_email_preview_settings',
true);
o.addClass(el, "hikamarket_ajax_loading");
o.xRequest("<?php echo
hikamarket::completeLink('order&task=previewmail&order_id='.(int)$this->element->order_id);
?>",
{mode:'POST',data:data,update:'hikamarket_mail_preview'},
function(xhr){
o.removeClass(el, "hikamarket_ajax_loading");
});
};
</script>
<h4><?php echo JText::_('PREVIEW_EMAIL');
?></h4>
<div id="hikamarket_mail_preview"
class="hikamarket_mail_preview">
<?php
$this->setLayout('previewmail');
echo $this->loadTemplate();
?>
</div>
PK��[����tmpl/payments.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div id="hikam_product_listing">
<form action="<?php echo
hikamarket::completeLink('order&task=payments'); ?>"
method="post" id="adminForm"
name="adminForm">
<div class="hk-row-fluid">
<div class="hkc-md-12">
<?php
echo $this->loadHkLayout('search', array(
'id' => 'hikamarket_order_listing_search'
));
?>
<div class="hikam_sort_zone"><?php
if(!empty($this->ordering_values))
echo JHTML::_('select.genericlist',
$this->ordering_values, 'filter_fullorder',
'onchange="this.form.submit();"', 'value',
'text', $this->full_ordering);
?></div>
</div>
<div class="hkc-md-12">
<div class="expand-filters">
<?php
echo $this->orderStatusType->display('filter_status',
$this->pageInfo->filter->filter_status, '
onchange="document.adminForm.submit();"', true);
foreach($this->extrafilters as $name => $filterObj) {
echo $filterObj->displayFilter($name, $this->pageInfo->filter);
}
?>
</div>
<div style="clear:both"></div>
</div>
</div>
<div id="hikam_payments_main_listing">
<?php
$manage = false; // hikamarket::acl('order/show');
$extra_classes = '';
foreach($this->orders as $order) {
$url = ($manage) ?
hikamarket::completeLink('order&task=show&cid='.$order->order_id)
: null;
?>
<div class="hk-card hk-card-default hk-card-vendor-order<?php
echo $extra_classes; ?>" data-hkm-order="<?php echo
(int)$order->order_id; ?>">
<div class="hk-card-header">
<?php if(!empty($url)) { ?>
<a class="hk-row-fluid" href="<?php echo $url;
?>">
<?php } else { ?>
<div class="hk-row-fluid">
<?php } ?>
<div class="hkc-sm-6 hkm_order_date">
<i class="fa fa-clock"></i>
<?php echo hikashop_getDate((int)$order->order_created,
'%Y-%m-%d %H:%M'); ?>
</div>
<div class="hkc-sm-6 hkm_order_price">
<i class="fa fa-credit-card"></i>
<?php echo
$this->currencyHelper->format($order->order_full_price,
$order->order_currency_id); ?>
</div>
<?php if(!empty($url)) { ?>
</a>
<?php } else { ?>
</div>
<?php } ?>
</div>
<div class="hk-card-body">
<div class="hk-row-fluid">
<div class="hkc-sm-4 hkm_order_number">
<?php
if(!empty($url)) {
?><a href="<?php echo $url; ?>"><?php
}
?><i class="far fa-file-alt"
style="margin-right:4px;"></i><span
class="hika_order_number_value"><?php echo
$order->order_number; ?></span><?php
if(!empty($url)) {
?></a><?php
}
?>
<?php if(!empty($order->order_invoice_number)) { ?>
<span class="hkm_order_number_invoice_separator"> -
</span>
<span class="hkm_invoice_number_value"><?php echo
$order->order_invoice_number; ?></span>
<?php } ?>
</div>
<div class="hkc-sm-2 hkm_order_status">
<span class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$order->order_status)); ?>"><?php
echo hikamarket::orderStatus($order->order_status);
?></span>
</div>
<div class="hkc-sm-6 hkm_payment_details"><?php
echo JText::sprintf('PAYMENT_X_TRANSACTIONS',
(int)$order->counter);
?></div>
</div>
</div>
</div>
<?php
}
?>
<div class="hikamarket_orders_footer">
<div class="hikamarket_pagination">
<?php $this->pagination->form = '_bottom'; echo
$this->pagination->getListFooter(); ?>
<?php echo $this->pagination->getResultsCounter(); ?>
</div>
</div>
</div>
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>" />
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="payments" />
<input type="hidden" name="ctrl"
value="<?php echo hikaInput::get()->getCmd('ctrl');
?>" />
<input type="hidden" name="boxchecked"
value="0" />
<input type="hidden" name="filter_order"
value="<?php echo
$this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $this->pageInfo->filter->order->dir;
?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
</div>
PK��[��o�))tmpl/previewmail.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?> <div
class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<?php
$pattern = '/(src=")(?!https?:\/\/)/i';
$replacement = '$1';
echo preg_replace($pattern, $replacement.HIKASHOP_LIVE,
@$this->element->mail->body);
PK��[�=����tmpl/request.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order'); ?>"
method="post" id="hikamarket_order_request_form"
name="hikamarket_order_request_form">
<?php
if(count($this->data) <= 1) {
?>
<dl class="hikam_options">
<dt><?php echo JText::_('HIKAM_STATS_TOTAL_ORDERS');
?></dt>
<dd><?php echo $this->total->count; ?></dd>
<dt><?php echo JText::_('HIKASHOP_TOTAL');
?></dt>
<dd><?php echo
$this->currencyHelper->format($this->total->value,
$this->total->currency); ?></dd>
</dl>
<?php
} else {
?>
<table class="hikam_listing <?php echo
(HIKASHOP_RESPONSIVE)?'table table-striped table-hover
table-bordered':'hikam_table'; ?>"
style="width:100%">
<thead>
<tr>
<th><?php echo JText::_('HIKAM_STATS_TOTAL_ORDERS');
?></th>
<th><?php echo JText::_('HIKASHOP_TOTAL');
?></th>
</tr>
</thead>
<tfoot>
<tr>
<td><?php echo $this->total->count; ?></td>
<td><?php echo
$this->currencyHelper->format($this->total->value,
$this->total->currency); ?></td>
</tr>
</tfoot>
<tbody>
<?php
foreach($this->data as $data) {
?>
<tr>
<td><?php echo (int)$data->count; ?></td>
<td><?php echo
$this->currencyHelper->format($data->value, $data->currency);
?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>" />
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task" value=""
/>
<input type="hidden" name="data[request]"
value="1" />
<input type="hidden" name="ctrl"
value="<?php echo hikaInput::get()->getCmd('ctrl');
?>" />
<?php
if($this->total->value != 0)
echo JHTML::_( 'form.token' );
?>
</form>
PK��[[]�ZKK
tmpl/show.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><script type="text/javascript">
<!--
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.customer_id = <?php echo
(int)$this->order->order_user_id; ?>;
window.orderMgr.showEl = function(el, sel) {
window.hikamarket.submitFct = function(data) {
window.hikamarket.closeBox(); };
var href = el.getAttribute('data-popup-href');
if(!href) href = el.getAttribute('href');
window.hikamarket.openBox(sel, href);
return false;
};
window.orderMgr.toggleDisplay = function(el) {
var d = document, block =
el.getAttribute('data-toggle-display'), e =
d.getElementById(block);
if(!e) return false;
e.style.display = (e.style.display == 'none') ? '' :
'none';
el.blur();
return false;
};
window.orderMgr.refreshBlock = function(type, edit, prefix) {
var d = document, w = window, o = w.Oby, el = null;
if(prefix !== undefined) el =
d.getElementById("hikamarket_order_" + prefix + "_" +
type);
if(edit && !el) el =
d.getElementById("hikamarket_order_edit_" + type);
if(!el) el = d.getElementById("hikamarket_order_block_" +
type);
if(!el) return false;
o.addClass(el, "hikamarket_ajax_loading");
var url = '<?php echo
hikamarket::completeLink('order&task=showblock&block=HIKATYPE&cid='.(int)$this->order->order_id.'&tmpl=ajax',
false, false, true); ?>'.replace("HIKATYPE", (edit ?
'edit_' : '') + type);
o.xRequest(url, {update: el}, function(x,p) {
o.removeClass(el, "hikamarket_ajax_loading");
});
return false;
};
window.orderMgr.submitBlock = function(type, opt, cb, prefix) {
var url = null, formData = '', d = document, w = window, o =
w.Oby, el = null;
if(prefix !== undefined) el =
d.getElementById("hikamarket_order_" + prefix + "_" +
type);
if(!el) el = d.getElementById("hikamarket_order_edit_" + type);
if(!el) el = d.getElementById("hikamarket_order_block_" +
type);
if(!el) return false;
if(!opt || opt.data === undefined || !opt.data) {
formData = o.getFormData(el);
} else if(opt.data) {
formData = o.encodeFormData(opt.data);
}
o.addClass(el, "hikamarket_ajax_loading");
url = '<?php echo
hikamarket::completeLink('order&task=submitblock&block=HIKATYPE&cid='.(int)$this->order->order_id.'&'.hikamarket::getFormToken().'=1&tmpl=ajax',
false, false, true); ?>'.replace("HIKATYPE", type);
var params = {mode:"POST", data:formData};
if(opt && opt.update) {
params.update = (opt.update === true) ? el : opt.update;
}
o.xRequest(url, params, function(x,p) {
o.removeClass(el, "hikamarket_ajax_loading");
if(cb) cb(x,p);
});
return false;
};
window.orderMgr.updateTaxValueFields = function(key) {
var d = document, rate = 0.0, v = 0.0,
el = d.getElementById(key+'_value'),
s = d.getElementById(key+'tax_namekey');
if(!s) s = d.getElementById(key+'_tax_namekey');
if(!s) return;
rate = s.options[ s.selectedIndex ];
if(!rate) return;
try {
rate = parseFloat(rate.getAttribute('data-rate'));
} catch(e) { return; }
try {
v = parseFloat( Oby.trim(el.value) );
if(isNaN(v)) v = 0.0;
} catch(e) { v = 0.0; }
var n = v - (v / (1 + rate));
s = d.getElementById(key+'_tax');
if(s) s.value = parseFloat(n.toFixed(5));
s = d.getElementById(key+'_value_tax');
if(s) s.innerHTML = parseFloat(n.toFixed(5));
n = (v / (1 + rate));
s = d.getElementById(key+'_value_price');
if(s) s.innerHTML = parseFloat(n.toFixed(5));
};
window.orderMgr.editOrderStatus = function(el) {
window.hikamarket.submitFct = function(data) {
var orderstatus =
document.getElementById('hikamarket_order_status');
if(orderstatus) {
orderstatus.innerHTML = data.name;
orderstatus.className = 'order-label order-label-' +
data.order_status.replace(/[^a-z_0-9]/i, '_');
}
window.hikamarket.closeBox();
};
var href = el.getAttribute('href');
if(href == '' || href == null || href == '#')
href = null;
window.hikamarket.openBox('hikamarket_order_status_popup',
href);
return false;
};
//-->
</script>
<div class="hikamarket_order">
<h2 style="display:inline-block"><?php
echo JText::sprintf('HIKAM_ORDER',
$this->order->order_number);
?></h2>
<span id="hikamarket_order_status"
style="margin-left:7px;font-size:1.2em;line-height:1.3em;"
class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$this->order->order_status));
?>"><?php echo
hikamarket::orderStatus($this->order->order_status);
?></span>
<!-- GENERAL -->
<?php
echo $this->loadTemplate('block_general');
?>
<!-- ADDITIONAL -->
<h3 style="display:inline-block"><?php echo
JText::_('ORDER_DETAILS')?></h3>
<?php
echo $this->loadTemplate('block_details');
if(!empty($this->fields['order']) &&
hikamarket::acl('order/show/customfields')) {
echo $this->loadTemplate('block_fields');
}
?>
<!-- CUSTOMER -->
<?php if(hikamarket::acl('order/show/customer')) { ?>
<h3 style="display:inline-block"><?php echo
JText::_('CUSTOMER')?></h3>
<?php
if($this->editable_order &&
hikamarket::acl('order/edit/customer')) {
echo $this->loadTemplate('block_edit_customer');
}
echo $this->loadTemplate('block_customer');
}
?>
<!-- ADDRESSES -->
<?php
if(hikamarket::acl('order/show/billingaddress') ||
hikamarket::acl('order/show/shippingaddress')) {
$acl_billing = hikamarket::acl('order/show/billingaddress');
$acl_shipping = hikamarket::acl('order/show/shippingaddress');
$cell_class = ($acl_billing && $acl_shipping) ?
'hkc-md-6' : 'hkc-md-12';
?>
<div class="hk-row-fluid hikamarket_order_addresses">
<?php
if($acl_billing) {
?>
<div class="<?php echo $cell_class; ?>
hikamarket_order_billing_address">
<h3 style="display:inline-block;"><?php echo
JText::_('HIKASHOP_BILLING_ADDRESS')?></h3>
<?php
$this->block_edit_address = 'billing';
echo $this->loadTemplate('block_edit_address');
$this->block_show_address = 'billing';
echo $this->loadTemplate('block_address');
?>
</div>
<?php
}
?>
<?php
if($acl_shipping) {
$display_shipping_addr = empty($this->order->order_shipping_id) ?
'display:none;' : '';
?>
<div class="<?php echo $cell_class; ?>
hikamarket_order_shipping_address" style="<?php echo
$display_shipping_addr; ?>">
<h3 style="display:inline-block;"><?php echo
JText::_('HIKASHOP_SHIPPING_ADDRESS')?></h3>
<?php
if(empty($this->order->override_shipping_address)) {
$this->block_edit_address = 'shipping';
echo $this->loadTemplate('block_edit_address');
}
$this->block_show_address = 'shipping';
echo $this->loadTemplate('block_address');
?>
</div>
<?php
}
?>
</div>
<?php } ?>
<!-- PRODUCTS -->
<h3 style="display:inline-block"><?php echo
JText::_('PRODUCT_LIST')?></h3>
<?php
echo $this->loadTemplate('block_products');
?>
<?php
if(hikamarket::level(1) && $this->order->order_type ==
'sale' &&
hikamarket::acl('order/show/vendors')) {
echo $this->loadTemplate('block_vendors');
}
?>
<!-- OTHER COMPONENTS -->
<?php
JFactory::getApplication()->triggerEvent('onAfterOrderProductsListingDisplay',
array(&$this->order, 'order_frontmarket_show'));
?>
<!-- HISTORY -->
<?php
if(hikamarket::acl('order/show/history')) {
echo $this->loadTemplate('block_history');
}
?>
</div>
PK��[��c�)�)tmpl/show_additional.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?> <legend><?php echo JText::_('ORDER_ADD_INFO');
?></legend>
<?php if(hikamarket::acl('order/edit/additional') &&
($this->vendor->vendor_id == 0 || $this->vendor->vendor_id ==
1)) { ?>
<div class="hikam_edit"><?php
echo $this->popup->display(
'<i class="fas
fa-pencil-alt"></i><span>'.
JText::_('HIKA_EDIT') .'</span>',
'HIKAM_SET_ORDER_ADDITIONALS',
hikamarket::completeLink('order&task=edit&subtask=additional&cid='.$this->order->order_id,
true),
'hikamarket_editadditional_popup',
750, 460, 'onclick="return
window.orderMgr.setAdditionals(this);"', '',
'link'
);
?></div>
<script type="text/javascript">
<!--
window.orderMgr.setAdditionals = function(el) {
window.hikamarket.submitFct = function(data) {
var w = window, o = w.Oby;
w.hikashop.closeBox();
w.orderMgr.updateAdditionals();
};
window.hikashop.openBox(el);
return false;
}
window.orderMgr.updateAdditionals = function() {
window.Oby.xRequest('<?php echo
hikamarket::completeLink('order&task=show&subtask=additional&cid='.$this->order->order_id,
true, false, true); ?>', {update:
'hikashop_order_field_additional'});
}
//-->
</script>
<?php } ?>
<dl class="hikam_options">
<dt
class="hikamarket_order_additional_subtotal"><label><?php
echo JText::_('SUBTOTAL'); ?></label></dt>
<dd
class="hikamarket_order_additional_subtotal"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_subtotal,
$this->order->order_currency_id);
else
echo
$this->currencyHelper->format($this->order->order_subtotal_no_vat,
$this->order->order_currency_id);
?></span></dd>
<dt
class="hikamarket_order_additional_coupon"><label><?php
echo JText::_('HIKASHOP_COUPON'); ?></label></dt>
<dd
class="hikamarket_order_additional_coupon"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_discount_price
* -1.0, $this->order->order_currency_id);
else
echo
$this->currencyHelper->format(($this->order->order_discount_price
- @$this->order->order_discount_tax) * -1.0,
$this->order->order_currency_id);
?> <?php echo $this->order->order_discount_code;
?></span></dd>
<dt
class="hikamarket_order_additional_shipping"><label><?php
echo JText::_('SHIPPING'); ?></label></dt>
<dd
class="hikamarket_order_additional_shipping"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_shipping_price,
$this->order->order_currency_id);
else
echo
$this->currencyHelper->format($this->order->order_shipping_price
- @$this->order->order_shipping_tax,
$this->order->order_currency_id);
if(empty($this->order->order_shipping_method) &&
empty($this->order->shippings)) {
echo '-
<em>'.JText::_('NONE').'</em>';
} else if(!empty($this->order->order_shipping_method)) {
if(!is_numeric($this->order->order_shipping_id)){
$shipping_name =
$this->getShippingName($this->order->order_shipping_method,
$this->order->order_shipping_id);
echo ' - ' . $shipping_name;
} else {
$shipping =
$this->shippingClass->get($this->order->order_shipping_id);
echo ' - ' . $shipping->shipping_name;
}
} else {
$shippings_data = array();
$shipping_ids = explode(';',
$this->order->order_shipping_id);
foreach($shipping_ids as $key) {
$shipping_data = '';
list($k, $w) = explode('@', $key);
$shipping_id = $k;
if(isset($this->order->shippings[$shipping_id])) {
$shipping = $this->order->shippings[$shipping_id];
$shipping_data = $shipping->shipping_name;
} else {
foreach($this->order->products as $order_product) {
if($order_product->order_product_shipping_id == $key) {
if(!is_numeric($order_product->order_product_shipping_id)) {
$shipping_name =
$this->getShippingName($order_product->order_product_shipping_method,
$shipping_id);
$shipping_data = $shipping_name;
} else {
$shipping_method_data =
$this->shippingClass->get($shipping_id);
$shipping_data = $shipping_method_data->shipping_name;
}
break;
}
}
if(empty($shipping_data))
$shipping_data = '[ ' . $key . ' ]';
}
if(isset($this->order->order_shipping_params->prices[$key]))
{
$price_params =
$this->order->order_shipping_params->prices[$key];
if($this->shopConfig->get('price_with_tax'))
$shipping_data .= ' (' .
$this->currencyHelper->format($price_params->price_with_tax,
$this->order->order_currency_id) . ')';
else
$shipping_data .= ' (' .
$this->currencyHelper->format($price_params->price_with_tax -
@$price_params->tax, $this->order->order_currency_id) .
')';
}
$shippings_data[] = $shipping_data;
}
if(!empty($shippings_data))
echo
'<ul><li>'.implode('</li><li>',
$shippings_data).'</li></ul>';
}
?></span></dd>
<dt
class="hikamarket_order_additional_payment_fee"><label><?php
echo JText::_('HIKASHOP_PAYMENT');
?></label></dt>
<dd
class="hikamarket_order_additional_payment_fee"><span><?php
echo
$this->currencyHelper->format($this->order->order_payment_price,
$this->order->order_currency_id); ?> - <?php
if(empty($this->order->order_payment_method) ||
$this->order->order_payment_method == 'market-')
echo
'<em>'.JText::_('NONE').'</em>';
else {
if(!is_numeric($this->order->order_payment_id)){
echo $this->order->order_payment_method.'
'.$this->order->order_payment_id;
} else if((int)$this->order->order_payment_id > 0) {
$payment =
$this->paymentClass->get($this->order->order_payment_id);
echo @$payment->payment_name;
}
}
?></span></dd>
<?php
if(!empty($this->order->additional)) {
foreach($this->order->additional as $additional) {
?>
<dt
class="hikamarket_order_additional_additional"><label><?php
echo JText::_($additional->order_product_name);
?></label></dt>
<dd
class="hikamarket_order_additional_additional"><span><?php
if(!empty($additional->order_product_price)) {
$additional->order_product_price =
(float)$additional->order_product_price;
}
if(!empty($additional->order_product_price) ||
empty($additional->order_product_options)) {
echo
$this->currencyHelper->format($additional->order_product_price,
$this->order->order_currency_id);
} else {
echo $additional->order_product_options;
}
?></span></dd>
<?php
}
}
if($this->shopConfig->get('detailed_tax_display')
&& !empty($this->order->order_tax_info)) {
foreach($this->order->order_tax_info as $tax){
?>
<dt
class="hikamarket_order_additional_tax"><label><?php
echo $tax->tax_namekey; ?></label></dt>
<dd
class="hikamarket_order_additional_tax"><span><?php
echo
$this->currencyHelper->format($tax->tax_amount,$this->order->order_currency_id);
?></span></dd>
<?php
}
}
?>
<dt
class="hikamarket_order_additional_total"><label><?php
if((int)$this->order->order_vendor_id <= 1)
echo JText::_('HIKASHOP_TOTAL');
else
echo JText::_('HIKAM_USER_TOTAL');
?></label></dt>
<dd
class="hikamarket_order_additional_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_full_price,$this->order->order_currency_id);
?></span></dd>
<?php
if((int)$this->order->order_vendor_id > 1) {
$fixed_fees = 0.0;
if(!empty($this->order->order_vendor_params->fees->fixed)) {
foreach($this->order->order_vendor_params->fees->fixed as
$fixed_fee) {
$fixed_fees += $fixed_fee;
}
}
if(bccomp($fixed_fees, 0, 5) !== 0) {
?>
<!-- Vendor fixed fees -->
<dt
class="hikamarket_order_vendor_fixed_fees"><label><?php
echo JText::_('HIKAM_VENDOR_FIXED_FEES');
?></label></dt>
<dd
class="hikamarket_order_vendor_fixed_fees"><span><?php
echo $this->currencyHelper->format($fixed_fees,
$this->order->order_currency_id);
?></span></dd>
<?php
}
if(!empty($this->order->order_vendor_params->fees->shipping))
{
?>
<!-- Vendor shipping fees -->
<dt
class="hikamarket_order_vendor_shipping_fees"><label><?php
echo JText::_('HIKAM_VENDOR_SHIPPING_FEES');
?></label></dt>
<dd
class="hikamarket_order_vendor_shipping_fees"><span><?php
echo
$this->currencyHelper->format($this->order->order_vendor_params->fees->shipping,
$this->order->order_currency_id);
?></span></dd>
<?php
}
if($this->order->order_vendor_paid > 0) {
$total = $this->order->order_vendor_price;
$paid = $this->order->order_vendor_price;
if(!empty($this->order->refunds)) {
foreach($this->order->refunds as $refund) {
$total += (float)hikamarket::toFloat($refund->order_vendor_price);
if($refund->order_vendor_paid > 0)
$paid += (float)hikamarket::toFloat($refund->order_vendor_price);
}
}
?>
<!-- Vendor shipping fees -->
<dt
class="hikamarket_order_vendor_paid"><label><?php
echo JText::_('VENDOR_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_vendor_paid"><span><?php
echo $this->currencyHelper->format($total,
$this->order->order_currency_id);
if($total == $paid)
echo ' ' .
hikamarket::tooltip(JText::_('HIKAM_ORDER_IS_PAID'),
'', '', '<img
src="'.HIKAMARKET_IMAGES.'icon-16/save2.png"
style="vertical-align:top;"
alt="('.JText::_('PAID').')" />',
'', 0);
?></span></dd>
<?php
} else {
?>
<!-- Vendor total -->
<dt
class="hikamarket_order_vendor_total"><label><?php
echo JText::_('VENDOR_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_vendor_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_vendor_price,
$this->order->order_currency_id);
?></span></dd>
<?php
}
}
if(!empty($this->fields['order'])) {
foreach($this->fields['order'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></dt>
<dd class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><span><?php
echo $this->fieldsClass->show($oneExtraField,
@$this->order->$fieldName);
?></span></dd>
<?php
}
}
?>
</dl>
PK��[���FFtmpl/show_address.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><legend><?php echo
JText::_('HIKASHOP_'.strtoupper($this->type).'_ADDRESS');
?></legend>
<?php
$name = $this->type.'_address';
$fields_type = $this->type.'_fields';
if(!isset($this->order->$fields_type))
$fields_type = 'fields';
$show_url =
'order&task=show&subtask='.$name.'&cid='.$this->order->order_id;
$save_url =
'order&task=save&subtask='.$name.'&cid='.$this->order->order_id;
$update_url =
'order&task=edit&subtask='.$name.'&cid='.$this->order->order_id;
if(hikamarket::acl('order/edit/'.$name) &&
($this->vendor->vendor_id == 0 || $this->vendor->vendor_id ==
1)) {
if(!isset($this->edit) || $this->edit !== true ) {
?> <div class="hikam_edit"><a href="<?php
echo hikamarket::completeLink($update_url, true);?>"
onclick="return
window.hikamarket.get(this,'hikamarket_order_field_<?php echo
$name; ?>');"><i class="fas
fa-pencil-alt"></i><span><?php echo
JText::_('HIKA_EDIT'); ?></span></a></div>
<?php
} else {
?> <div class="hikam_edit">
<a href="<?php echo hikamarket::completeLink($save_url,
true);?>" onclick="return
window.hikamarket.form(this,'hikamarket_order_field_<?php echo
$name; ?>');"><i class="far
fa-times-circle"></i><span><?php echo
JText::_('HIKA_SAVE'); ?></span></a>
<a href="<?php echo hikamarket::completeLink($show_url,
true);?>" onclick="return
window.hikamarket.get(this,'hikamarket_order_field_<?php echo
$name; ?>');"><i class="fas
fa-check"></i><span><?php echo
JText::_('HIKA_CANCEL'); ?></span></a>
</div>
<?php
}
}
$address =& $this->order->$name;
$display = 'field_backend';
if(isset($this->edit) && $this->edit === true ) {
if(hikamarket::acl('order/edit/'.$name)) {
foreach($this->order->$fields_type as $field) {
if(!$field->$display)
continue;
$fieldname = $field->field_namekey;
?>
<dl id="hikashop_<?php echo
$this->type;?>order_address_<?php echo $fieldname;?>"
class="hikam_options">
<dt class="hikamarket_<?php echo
$this->type;?>order_address_<?php echo
$fieldname;?>"><label><?php echo
$this->fieldsClass->trans($field->field_realname);?></label></dt>
<dd class="hikamarket_<?php echo
$this->type;?>order_address_<?php echo
$fieldname;?>"><?php
$onWhat = 'onchange';
if($field->field_type == 'radio')
$onWhat = 'onclick';
$field->table_name = 'order';
echo $this->fieldsClass->display(
$field,
@$address->$fieldname,
'data['.$name.']['.$fieldname.']',
false,
' ' . $onWhat .
'="hikashopToggleFields(this.value,\''.$fieldname.'\',\''.$name.'\',0);"',
false,
$this->order->$fields_type,
$address
);
?></dd>
</dl>
<?php
}
}
if(hikamarket::acl('order/edit/history')) {
?>
<dl class="hikam_options">
<dt class="hikamarket_<?php echo
$this->type;?>_history"><label><?php echo
JText::_('HISTORY'); ?></label></dt>
<dd class="hikamarket_<?php echo
$this->type;?>_history">
<span><input onchange="window.orderMgr.<?php echo
$this->type;?>_history_changed(this);" type="checkbox"
id="hikamarket_history_<?php echo $this->type;?>_store"
name="data[history][store_data]"
value="1"/><label for="hikamarket_history_<?php
echo $this->type;?>_store"
style="display:inline-block"><?php echo
JText::_('SET_HISTORY_MESSAGE');?></label></span><br/>
<textarea id="hikamarket_history_<?php echo
$this->type;?>_msg" name="data[history][msg]"
style="display:none;"></textarea>
</dd>
</dl>
<script type="text/javascript">
window.orderMgr.<?php echo $this->type;?>_history_changed =
function(el) {
var fields = ['hikamarket_history_<?php echo
$this->type;?>_msg'], displayValue = '';
if(!el.checked) displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
}
</script>
<?php
}
echo JHTML::_( 'form.token' );
} else {
foreach($this->order->$fields_type as $field){
if($field->$display){
$fieldname = $field->field_namekey;
?>
<dl class="hikam_options">
<dt class="hikamarket_<?php echo
$this->type;?>order_address_<?php echo
$fieldname;?>"><label><?php echo
$this->fieldsClass->trans($field->field_realname);?></label></dt>
<dd class="hikamarket_<?php echo
$this->type;?>order_address_<?php echo
$fieldname;?>"><span><?php echo
$this->fieldsClass->show($field,
@$address->$fieldname);?></span></dd>
</dl>
<?php
}
}
}
?>
<script type="text/javascript">
window.orderMgr.update<?php echo ucfirst($this->type);?> =
function() {
window.Oby.xRequest('<?php echo
hikamarket::completeLink('order&task=show&subtask='.$this->type.'_address&cid='.$this->order->order_id,true,false,true);
?>',{update:'hikashop_order_field_<?php echo
$this->type; ?>_address'});
}
</script>
PK��[2@n/xxtmpl/show_block_address.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$type = @$this->block_show_address;
if(!in_array($type, array('shipping', 'billing')))
return;
if(!hikamarket::acl('order/show/'.$type.'address'))
return;
if(empty($this->ajax)) { ?>
<div id="hikamarket_order_block_<?php echo $type;
?>address">
<?php } ?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<?php
if($type == 'billing' ||
empty($this->order->override_shipping_address)) {
$address = ($type == 'billing') ?
@$this->addresses[(int)$this->order->order_billing_address_id] :
@$this->addresses[(int)$this->order->order_shipping_address_id];
if($this->address_mode == 0) {
echo $this->addressClass->maxiFormat($address,
$this->address_fields, true);
} else {
?>
<dl class="hikam_options dl_glue">
<?php
$fields = (isset($this->order->{$type.'_fields'}) ?
$this->order->{$type.'_fields'} :
$this->order->fields);
foreach($fields as $field) {
if(empty($field->field_frontcomp) &&
strpos($field->field_display, ';vendor_order_show=1;') ===
false)
continue;
$fieldname = $field->field_namekey;
?>
<dt class="hikamarket_<?php echo $type;
?>order_address_<?php echo
$fieldname;?>"><label><?php echo
$this->fieldsClass->trans($field->field_realname);?></label></dt>
<dd class="hikamarket_<?php echo $type;
?>order_address_<?php echo
$fieldname;?>"><span><?php echo
$this->fieldsClass->show($field,
@$address->$fieldname);?></span></dd>
<?php
}
?>
</dl>
<?php
}
} else {
echo $this->order->override_shipping_address;
}
if(!empty($this->ajax))
return;
?>
</div>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.<?php echo $type;
?>address',function(params){
if(params && params.src && params.src == '<?php
echo $type; ?>address') return;
window.orderMgr.refreshBlock('<?php echo $type;
?>address');
});
</script>
PK��[�+����tmpl/show_block_customer.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!hikamarket::acl('order/show/customer'))
return;
if(empty($this->ajax)) { ?>
<div id="hikamarket_order_block_customer">
<?php } ?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options large">
<dt
class="hikamarket_order_customer_name"><label><?php
echo JText::_('HIKA_NAME');?></label></dt>
<dd class="hikamarket_order_customer_name"><span
id="hikamarket_order_customer_name"><?php
$customer_name = @$this->order->customer->name;
if(empty($customer_name))
$customer_name = '<em>' .
JText::_('HIKA_NONE') . '</em>';
if($this->order->order_user_id > 0 &&
hikamarket::acl('user/show')) {
?><a onclick="return
window.orderMgr.showCustomer(this);" data-popup-href="<?php
echo
hikamarket::completeLink('user&task=show&cid='.$this->order->order_user_id,
true); ?>" href="<?php echo
hikamarket::completeLink('user&task=show&cid='.$this->order->order_user_id);
?>"><?php
echo $customer_name;
?></a><?php
} else
echo $customer_name;
?></span></dd>
<dt
class="hikamarket_order_customer_email"><label><?php
echo JText::_('HIKA_EMAIL');?></label></dt>
<dd class="hikamarket_order_customer_email"><span
id="hikamarket_order_customer_email"><?php echo
@$this->order->customer->user_email;
?></span></dd>
</dl>
<?php
if(!empty($this->ajax))
return;
?>
</div>
<?php
if(hikamarket::acl('user/show')) {
echo $this->popup->display(
'',
'HIKAM_CUSTOMER_DETAILS',
hikamarket::completeLink('user&task=show&cid=0',
true),
'hikamarket_showcustomer_popup',
750, 460, 'style="display:none;"', '',
'link'
);
}
?>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.customer',function(params){
if(params && params.src && params.src ==
'customer') return;
window.orderMgr.refreshBlock('customer');
});
window.orderMgr.showCustomer = function(el) { return this.showEl(el,
'hikamarket_showcustomer_popup'); };
</script>
PK��[�N�x-x-tmpl/show_block_details.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->order))
return;
if(empty($this->ajax)) {
if(hikamarket::acl('order/edit')) {
$dropData = array();
if($this->editable_order &&
hikamarket::acl('order/edit/coupon')) {
$dropData['coupon'] = array(
'name' => '<i class="fas
fa-percentage"></i> ' .
JText::_('HIKAM_EDIT_COUPON'),
'link' => '#coupon',
'click' => 'return
window.orderMgr.showEditDetails(this, \'coupon\', true);'
);
}
if($this->editable_order &&
hikamarket::acl('order/edit/shipping')) {
$dropData['shipping'] = array(
'name' => '<i class="fas
fa-shipping-fast"></i> ' .
JText::_('HIKAM_EDIT_SHIPPING'),
'link' => '#shipping',
'click' => 'return
window.orderMgr.showEditDetails(this, \'shipping\', true);'
);
}
if($this->editable_order &&
hikamarket::acl('order/edit/payment')) {
$dropData['payment'] = array(
'name' => '<i class="far
fa-credit-card"></i> ' .
JText::_('HIKAM_EDIT_PAYMENT'),
'link' => '#payment',
'click' => 'return
window.orderMgr.showEditDetails(this, \'payment\', true);'
);
}
if(!empty($this->fields['order']) &&
$this->editable_order &&
hikamarket::acl('order/show/customfields') &&
hikamarket::acl('order/edit/customfields')) {
$dropData[] = array(
'name' => '<i class="fas
fa-clipboard-list"></i> ' .
JText::_('HIKAM_EDIT_CUSTOM_FIELDS'),
'link' => '#fields',
'click' => 'return
window.orderMgr.refreshBlock(\'fields\', true);'
);
}
if(!empty($dropData)) {
echo
$this->dropdownHelper->display(JText::_('HIKAM_EDIT'),
$dropData, array('type' => '', 'mini'
=> true, 'class' => 'hikabtn-primary',
'right' => false, 'up' => false));
?>
<script type="text/javascript">
window.orderMgr.showEditDetails = function(el, type, show) {
if(type != 'coupon' && type != 'payment'
&& type != 'shipping')
return false;
var d = document,
block = d.getElementById('hikamarket_order_edit_' + type),
marker = false,
showing = ((show === undefined && block.style.display ==
'none') || show == true);
if(!block)
return false;
block.style.display = showing ? '' : 'none';
if(!marker && showing)
this.refreshBlock(type, true);
return false;
};
window.orderMgr.submitDetails = function(el, type) {
var d = document, w = window, o = w.Oby,
block = document.getElementById('hikamarket_order_edit_' +
type);
if(block)
o.addClass(el, "hikamarket_ajax_loading");
this.submitBlock(type, {data:false, update:false}, function(x,p){
if(block) {
o.removeClass(el, "hikamarket_ajax_loading");
if(x.responseText.length > 1)
return window.Oby.updateElem(block, x.responseText);
}
window.Oby.fireAjax('orderMgr.details', null);
});
return this.showEditDetails(el, type, false);
};
</script>
<?php
}
if($this->editable_order &&
hikamarket::acl('order/edit/coupon')) {
?>
<div class="hikamarket_order_edit_block"
id="hikamarket_order_edit_coupon"
style="display:none;">
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
</div>
<?php
}
if($this->editable_order &&
hikamarket::acl('order/edit/shipping')) {
?>
<div class="hikamarket_order_edit_block"
id="hikamarket_order_edit_shipping"
style="display:none;">
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
</div>
<?php
}
if($this->editable_order &&
hikamarket::acl('order/edit/payment')) {
?>
<div class="hikamarket_order_edit_block"
id="hikamarket_order_edit_payment"
style="display:none;">
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
</div>
<?php
}
}
?>
<div id="hikamarket_order_block_details">
<?php } ?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options large">
<dt
class="hikamarket_order_additional_subtotal"><label><?php
echo JText::_('SUBTOTAL'); ?></label></dt>
<dd
class="hikamarket_order_additional_subtotal"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_subtotal,
$this->order->order_currency_id);
else
echo
$this->currencyHelper->format($this->order->order_subtotal_no_vat,
$this->order->order_currency_id);
?></span></dd>
<?php if(!empty($this->order->order_discount_code) ||
bccomp($this->order->order_discount_price, 0, 5) !== 0) { ?>
<dt
class="hikamarket_order_additional_coupon"><label><?php
echo JText::_('HIKASHOP_COUPON'); ?></label></dt>
<dd
class="hikamarket_order_additional_coupon"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_discount_price
* -1.0, $this->order->order_currency_id);
else
echo
$this->currencyHelper->format(($this->order->order_discount_price
- @$this->order->order_discount_tax) * -1.0,
$this->order->order_currency_id);
?> <span class="label label-default"><?php echo
$this->order->order_discount_code;
?></span></span></dd>
<?php } ?>
<!-- Shipping -->
<?php if(!empty($this->order->order_shipping_id) ||
bccomp($this->order->order_shipping_price, 0, 5) !== 0) { ?>
<dt
class="hikamarket_order_additional_shipping"><label><?php
echo JText::_('SHIPPING'); ?></label></dt>
<dd
class="hikamarket_order_additional_shipping"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_shipping_price,
$this->order->order_currency_id);
else
echo
$this->currencyHelper->format($this->order->order_shipping_price
- @$this->order->order_shipping_tax,
$this->order->order_currency_id);
?> <span class="hk-label hk-label-blue"><?php
if(empty($this->order->shipping_name))
echo
'<em>'.JText::_('HIKA_NONE').'</em>';
else if(is_string($this->order->shipping_name))
echo $this->order->shipping_name;
else if(!empty($this->order->shipping_data))
echo implode('</span> <span class="hk-label
hk-label-blue">', $this->order->shipping_data);
else
echo implode('</span> <span class="hk-label
hk-label-blue">', $this->order->shipping_name);
?></span></dd>
<?php
}
?>
<!-- Payment -->
<?php if(!empty($this->order->order_payment_id) ||
bccomp($this->order->order_payment_price, 0, 5) !== 0) { ?>
<dt
class="hikamarket_order_additional_payment"><label><?php
echo JText::_('HIKASHOP_PAYMENT');
?></label></dt>
<dd
class="hikamarket_order_additional_payment"><span><?php
echo
$this->currencyHelper->format($this->order->order_payment_price,
$this->order->order_currency_id);
?> <span class="hk-label hk-label-blue"><?php echo
@$this->order->payment_name; ?></span></dd>
<?php
}
?>
<!-- Additional -->
<?php
if(!empty($this->order->additional)) {
foreach($this->order->additional as $additional) {
?>
<dt
class="hikamarket_order_additional_additional"><label><?php
echo JText::_($additional->order_product_name);
?></label></dt>
<dd
class="hikamarket_order_additional_additional"><span><?php
if(!empty($additional->order_product_price))
$additional->order_product_price =
(float)$additional->order_product_price;
if(!empty($additional->order_product_price) ||
empty($additional->order_product_options))
echo
$this->currencyHelper->format($additional->order_product_price,
$this->order->order_currency_id);
else
echo $additional->order_product_options;
?></span></dd>
<?php
}
}
?>
<!-- Taxes -->
<?php
if($this->shopConfig->get('detailed_tax_display')
&& !empty($this->order->order_tax_info)) {
foreach($this->order->order_tax_info as $tax) {
?>
<dt
class="hikamarket_order_additional_tax"><label><?php
echo $tax->tax_namekey;
?></label></dt>
<dd
class="hikamarket_order_additional_tax"><span><?php
echo
$this->currencyHelper->format($tax->tax_amount,$this->order->order_currency_id);
?></span></dd>
<?php
}
}
?>
<!-- Total -->
<dt
class="hikamarket_order_additional_total"><label><?php
if((int)$this->order->order_vendor_id <= 1)
echo JText::_('HIKASHOP_TOTAL');
else
echo JText::_('HIKAM_USER_TOTAL');
?></label></dt>
<dd
class="hikamarket_order_additional_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_full_price,
$this->order->order_currency_id); ?></span></dd>
<?php
if((int)$this->order->order_vendor_id > 1) {
$fixed_fees = 0.0;
if(!empty($this->order->order_vendor_params->fees->fixed)) {
foreach($this->order->order_vendor_params->fees->fixed as
$fixed_fee) {
$fixed_fees += $fixed_fee;
}
}
if(bccomp($fixed_fees, 0, 5) !== 0) {
?>
<!-- Vendor fixed fees -->
<dt
class="hikamarket_order_vendor_fixed_fees"><label><?php
echo JText::_('HIKAM_VENDOR_FIXED_FEES');
?></label></dt>
<dd
class="hikamarket_order_vendor_fixed_fees"><span><?php
echo $this->currencyHelper->format($fixed_fees,
$this->order->order_currency_id);
?></span></dd>
<?php
}
if(!empty($this->order->order_vendor_params->fees->shipping))
{
?>
<!-- Vendor shipping fees -->
<dt
class="hikamarket_order_vendor_shipping_fees"><label><?php
echo JText::_('HIKAM_VENDOR_SHIPPING_FEES');
?></label></dt>
<dd
class="hikamarket_order_vendor_shipping_fees"><span><?php
echo
$this->currencyHelper->format($this->order->order_vendor_params->fees->shipping,
$this->order->order_currency_id);
?></span></dd>
<?php
}
if($this->order->order_vendor_paid > 0) {
$total = $this->order->order_vendor_price;
$paid = $this->order->order_vendor_price;
if(!empty($this->order->refunds)) {
foreach($this->order->refunds as $refund) {
$total += (float)hikamarket::toFloat($refund->order_vendor_price);
if($refund->order_vendor_paid > 0)
$paid += (float)hikamarket::toFloat($refund->order_vendor_price);
}
}
?>
<!-- Vendor total -->
<dt
class="hikamarket_order_vendor_paid"><label><?php
echo JText::_('VENDOR_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_vendor_paid"><span><?php
echo $this->currencyHelper->format($total,
$this->order->order_currency_id);
if($total == $paid) {
echo ' ' .
hikamarket::tooltip(JText::_('HIKAM_ORDER_IS_PAID'),
'', '', '<img
src="'.HIKAMARKET_IMAGES.'icon-16/save2.png"
style="vertical-align:top;"
alt="('.JText::_('PAID').')" />',
'', 0);
} elseif($total > $paid) {
echo ' ' .
JText::sprintf('HIKAM_ORDER_PARTIAL_PAID',
$this->currencyHelper->format($total - $paid,
$this->order->order_currency_id));
} else {
echo ' ' .
JText::sprintf('HIKAM_ORDER_PARTIAL_REFUND',
$this->currencyHelper->format($paid - $total,
$this->order->order_currency_id));
}
?></span></dd>
<?php
} else {
?>
<!-- Vendor total -->
<dt
class="hikamarket_order_vendor_total"><label><?php
echo JText::_('VENDOR_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_vendor_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_vendor_price,
$this->order->order_currency_id);
?></span></dd>
<?php
}
?>
<?php } ?>
</dl>
<?php
if(!empty($this->ajax))
return;
?>
</div>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.details',function(params){
window.orderMgr.refreshBlock('details'); });
</script>
PK��[L"{N�%�%
tmpl/show_block_edit_address.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$type = @$this->block_edit_address;
if(!in_array($type, array('shipping', 'billing')))
return;
if(!empty($this->ajax) && ( empty($this->edit_address_mode)
|| !in_array($this->edit_address_mode, array('select',
'edit'))) )
return;
$address_edit = $this->editable_order &&
hikamarket::acl('order/edit/'.$type.'address');
if(empty($this->ajax)) {
$data = array(
array(
'name' => '<i class="fas
fa-map-marked-alt"></i> ' .
JText::_('HIKAM_SHOW_DEFAULT'),
'link' => '#select_'.$type.'_address',
'click' => 'return
window.orderMgr.refreshAddressBlock(\''.$type.'\',
0);'
),
array(
'name' => '<i class="fas
fa-address-card"></i> ' .
JText::_('HIKAM_SHOW_DETAILS'),
'link' => '#select_'.$type.'_address',
'click' => 'return
window.orderMgr.refreshAddressBlock(\''.$type.'\',
1);'
)
);
if($address_edit) {
$data = array_merge($data, array(
'-',
array(
'name' => '<i class="fas
fa-pencil-alt"></i> ' .
JText::_('HIKAM_EDIT_ADDRESS'),
'link' => '#edit_'.$type.'_address',
'click' => 'return
window.orderMgr.refreshAddressEditBlock(\''.$type.'\',
\'edit\');'
),
));
if(hikamarket::acl('user/show/address')) {
$data[] = array(
'name' => '<i class="fas
fa-location-arrow"></i> ' .
JText::_('HIKAM_SELECT_ADDRESS'),
'link' =>
'#select_'.$type.'_address',
'click' => 'return
window.orderMgr.refreshAddressEditBlock(\''.$type.'\',
\'select\');'
);
}
}
echo $this->dropdownHelper->display(
JText::_('HIKAM_MORE'),
$data,
array('type' => '', 'mini' => true,
'class' => 'hikabtn-primary', 'right'
=> true, 'up' => false)
);
?>
<script type="text/javascript">
window.orderMgr.refreshAddressBlock = function(type, mode) {
if(type != 'billing' && type != 'shipping')
return false;
var d = document, w = window, o = w.Oby,
el = d.getElementById("hikamarket_order_block_" + type +
"address");
if(!el) return false;
mode = parseInt(mode);
if(mode == NaN) mode = 0;
o.addClass(el, "hikamarket_ajax_loading");
var url = '<?php echo
hikamarket::completeLink('order&task=showblock&block=HIKATYPE&address_mode=HIKAADDRMODE&cid='.(int)$this->order->order_id.'&tmpl=ajax',
false, false, true); ?>'.replace("HIKATYPE", type +
'address').replace("HIKAADDRMODE", mode);
o.xRequest(url, {update: el}, function(x,p) {
o.removeClass(el, "hikamarket_ajax_loading");
});
return false;
};
</script>
<?php
if(!$address_edit)
return;
?>
<div class="hikamarket_order_edit_block"
id="hikamarket_order_edit_<?php echo $type; ?>address"
style="display:none;">
<div class="hikamarket_ajax_loading_elem"></div>
<div
class="hikamarket_ajax_loading_spinner"></div>
<?php
hikamarket::loadJslib('otree');
?>
</div>
<script type="text/javascript">
window.orderMgr.refreshAddressEditBlock = function(type, mode) {
if(type != 'billing' && type != 'shipping')
return false;
if(mode != 'select' && mode != 'edit')
return false;
var d = document, w = window, o = w.Oby, el = null,
url = '<?php echo
hikamarket::completeLink('order&task=showblock&block=HIKATYPE&address_mode=HIKAADDRMODE&cid='.(int)$this->order->order_id.'&tmpl=ajax',
false, false, true); ?>'.replace("HIKATYPE",
'edit_' + type +
'address').replace("HIKAADDRMODE", mode)
box = window.oNameboxes['hikamarket_order_edit_' + type +
'_address_namebox'];
if(mode == 'select')
el = d.getElementById('hikamarket_order_edit_' + type +
'address');
if(mode == 'edit')
el = d.getElementById('hikamarket_order_block_' + type +
'address');
if(!el)
return false;
if(box)
box.clear();
if(mode == 'select')
el.style.display = '';
o.addClass(el, "hikamarket_ajax_loading");
o.xRequest(url, {update: el}, function(x,p) {
o.removeClass(el, "hikamarket_ajax_loading");
});
return false;
};
window.orderMgr.selectAddress = function(type) {
if(type != 'billing' && type != 'shipping')
return false;
var d = document, addr =
d.getElementById('hikamarket_order_block_' + type +
'address');
window.orderMgr.submitBlock(type + 'address', {update: addr},
function(x,p){
window.orderMgr.hideSelectAddress(type);
});
return false;
};
window.orderMgr.submitAddress = function(type) {
if(type != 'billing' && type != 'shipping')
return false;
window.orderMgr.submitBlock(type + 'address', {update:true},
null, 'block');
return false;
};
window.orderMgr.hideSelectAddress = function(type) {
if(type != 'billing' && type != 'shipping')
return false;
var d = document,
block = d.getElementById('hikamarket_order_edit_' + type +
'address'),
box = window.oNameboxes['hikamarket_order_edit_' + type +
'_address_namebox'];
if(box) box.clear();
if(block) block.style.display = 'none';
return false;
};
</script>
<?php
return;
}
if($address_edit && $this->edit_address_mode ==
'select') {
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<div>
<?php
echo $this->nameboxType->display(
'order['.$type.'address][address_id]',
'',
hikamarketNameboxType::NAMEBOX_SINGLE,
'address',
array(
'url_params' => array(
'USER_ID' => (int)@$this->order->order_user_id,
'ADDR_TYPE' => $type,
),
'delete' => true,
'default_text' =>
'<em>'.JText::_('HIKA_NONE').'</em>',
'id' =>
'hikamarket_order_edit_'.$type.'_address_namebox'
)
);
?>
<input type="hidden" name="order[<?php echo $type;
?>address][addrselect]" value="1"/>
<div>
<label for="hikamarket_order_select_<?php echo $type;
?>_address_addrlink"><input type="checkbox"
value="1" id="hikamarket_order_select_<?php echo $type;
?>_address_addrlink" name="order[<?php echo $type;
?>address][addrlink]" /><span><?php
$key = ($type == 'billing') ?
'SET_SHIPPING_ADDRESS_TOO' :
'SET_BILLING_ADDRESS_TOO';
echo JText::_($key);
?></span></label>
</div>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return
window.orderMgr.selectAddress('<?php echo $type;
?>');" class="hikabtn hikabtn-success"><i
class="fas fa-check"></i> <?php echo
JText::_('HIKAM_SELECT_ADDRESS'); ;?></button>
</div>
<button onclick="return
window.orderMgr.hideSelectAddress('<?php echo $type;
?>');" class="hikabtn hikabtn-danger"><i
class="far fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
</div>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.customer',function(params){
if(!params || !params.id) return;
var u = '<?php echo
hikamarket::completeLink('user&task=getAddressList&address_type='.$type.'&user_id=HIKA_USER_ID',
true, false, true); ?>';
window.oNameboxes['hikamarket_order_edit_<?php echo $type;
?>_address_namebox'].changeUrl(u.replace('HIKA_USER_ID',
params.id));
});
</script>
<?php
return;
}
if($address_edit && $this->edit_address_mode ==
'edit') {
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<div class="hikamarket_order_edit_block">
<dl>
<?php
$address = (($type == 'billing') ?
$this->order->billing_address :
$this->order->shipping_address);
$fields = (isset($this->order->{$type.'_fields'}) ?
$this->order->{$type.'_fields'} :
$this->order->fields);
foreach($fields as $field) {
if(empty($field->field_frontcomp) &&
strpos($field->field_display, ';vendor_order_show=1;') ===
false)
continue;
$fieldname = $field->field_namekey;
?>
<dt class="hikamarket_<?php echo $type;
?>order_address_<?php echo
$fieldname;?>"><label><?php
echo $this->fieldsClass->trans($field->field_realname);
if(!empty($field->field_required))
echo ' *';
?></label></dt>
<dd class="hikamarket_<?php echo $type;
?>order_address_<?php echo $fieldname;?>"><?php
echo $this->fieldsClass->display(
$field,
@$address->$fieldname,
'order['.$type.'address]['.$fieldname.']',
false,
'',
false,
$fields,
$address,
false
);
?></dd>
<?php
}
?>
</dl>
<input type="hidden" name="order[<?php echo $type;
?>address][address_id]" value="<?php echo
(int)$this->order->{'order_'.$type.'_address_id'};
?>"/>
<?php if($this->order->order_billing_address_id ==
$this->order->order_shipping_address_id) { ?>
<div>
<label for="hikamarket_order_select_<?php echo $type;
?>_address_addrlink"><input type="checkbox"
value="1" id="hikamarket_order_select_<?php echo $type;
?>_address_addrlink" name="order[<?php echo $type;
?>address][addrlink]" /><span><?php
$key = ($type == 'billing') ?
'SET_SHIPPING_ADDRESS_TOO' :
'SET_BILLING_ADDRESS_TOO';
echo JText::_($key);
?></span></label>
</div>
<?php } ?>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return
window.orderMgr.submitAddress('<?php echo $type;
?>');" class="hikabtn hikabtn-success"><i
class="fas fa-check"></i> <?php echo
JText::_('HIKA_OK'); ;?></button>
</div>
<button onclick="return
window.orderMgr.refreshAddressBlock('<?php echo $type; ?>',
0);" class="hikabtn hikabtn-danger"><i class="far
fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
</div>
<?php
}
PK��[xd���tmpl/show_block_edit_coupon.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!$this->editable_order ||
!hikamarket::acl('order/edit/coupon'))
return;
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options">
<dt><label><?php echo JText::_('COUPON_CODE');
?></label></dt>
<dd><input type="text"
name="order[coupon][code]" value="<?php echo
$this->escape(@$this->order->order_discount_code);
?>"/></dd>
<dt><label><?php echo JText::_('COUPON_TAX');
?></label></dt>
<dd><?php
echo
$this->ratesType->display('order[coupon][tax_namekey]',
@$this->order->order_discount_tax_namekey,
@$this->order->order_discount_tax_rate,
'onchange="window.orderMgr.updateTaxValueFields(\'ordercoupon\');"');
?></dd>
<dt><label><?php echo JText::_('COUPON_VALUE');
?></label></dt>
<dd>
<input type="text" id="ordercoupon_value"
name="order[coupon][value]"
onchange="window.orderMgr.updateTaxValueFields('ordercoupon');"
value="<?php echo $this->order->order_discount_price;
?>"/> <?php echo
$this->order->currency->currency_symbol . ' (' .
$this->order->currency->currency_code . ')';
?><br/>
<div>
<span id="ordercoupon_value_price"><?php echo
($this->order->order_discount_price -
$this->order->order_discount_tax); ?></span>
+
<span id="ordercoupon_value_tax"><?php echo
$this->order->order_discount_tax; ?></span>
</div>
<input type="hidden" id="ordercoupon_tax"
name="order[coupon][tax]" value="<?php echo
(float)$this->order->order_discount_tax; ?>"/>
</dd>
</dl>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return window.orderMgr.submitDetails(this,
'coupon');" class="hikabtn
hikabtn-success"><i class="fas fa-check"></i>
<?php echo JText::_('HIKA_OK'); ;?></button>
</div>
<button onclick="return window.orderMgr.showEditDetails(this,
'coupon', false);" class="hikabtn
hikabtn-danger"><i class="far
fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
PK��[C�g,��!tmpl/show_block_edit_customer.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!$this->editable_order ||
!hikamarket::acl('order/edit/customer'))
return;
if(empty($this->ajax)) {
echo $this->dropdownHelper->display(
JText::_('HIKAM_EDIT'),
array(
'customer' => array(
'name' => '<i class="fas
fa-user"></i> ' .
JText::_('HIKAM_CHANGE_CUSTOMER'),
'link' => '#customer',
'click' => 'return
window.orderMgr.showSelectCustomer(this, true);'
)
),
array('type' => '', 'mini' => true,
'class' => 'hikabtn-primary', 'right'
=> false, 'up' => false)
);
?>
<div class="hikamarket_order_edit_block"
id="hikamarket_order_edit_customer"
style="display:none;">
<div class="hikamarket_ajax_loading_elem"></div>
<div
class="hikamarket_ajax_loading_spinner"></div>
<?php
hikamarket::loadJslib('otree');
?>
</div>
<script type="text/javascript">
window.orderMgr.showSelectCustomer = function(el, show) {
var d = document,
block = d.getElementById('hikamarket_order_edit_customer'),
box =
window.oNameboxes['hikamarket_order_edit_customer_namebox'];
if(!block)
return false;
block.style.display = ((show === undefined && block.style.display
== 'none') || show == true) ? '' : 'none';
if(box) {
box.clear();
} else {
this.refreshBlock('customer', true);
}
return false;
};
window.orderMgr.selectCustomer = function(el) {
var d = document, w = window, o = w.Oby,
block =
document.getElementById('hikamarket_order_block_customer');
if(block) o.addClass(el, "hikamarket_ajax_loading");
this.submitBlock("customer", {data:false, update:false},
function(x,p){
if(el) {
o.removeClass(block, "hikamarket_ajax_loading");
if(x.responseText.length > 1)
return window.Oby.updateElem(block, x.responseText);
}
window.Oby.fireAjax('orderMgr.customer', null);
});
return this.showSelectCustomer(el, false);
};
</script>
<?php
return;
}
echo $this->nameboxType->display(
'order[customer][user_id]',
'',
hikamarketNameboxType::NAMEBOX_SINGLE,
'user',
array(
'customer' => true,
'delete' => true,
'default_text' =>
'<em>'.JText::_('HIKA_NONE').'</em>',
'id' => 'hikamarket_order_edit_customer_namebox'
)
);
?>
<div>
<label
for="hikamarket_order_edit_customer_addrlink"><input
type="checkbox" value="1"
name="order[customer][addrlink]"
id="hikamarket_order_edit_customer_addrlink"
/><span><?php echo JText::_('SET_USER_ADDRESS');
?></span></label>
</div>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return
window.orderMgr.selectCustomer(this);" class="hikabtn
hikabtn-success"><i class="fas fa-check"></i>
<?php echo JText::_('HIKAM_SELECT_CUSTOMER');
;?></button>
</div>
<button onclick="return window.orderMgr.showSelectCustomer(this,
false);" class="hikabtn hikabtn-danger"><i
class="far fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
PK��[=���tmpl/show_block_edit_fields.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->fields['order']) || !$this->editable_order
|| !hikamarket::acl('order/show/customfields') ||
!hikamarket::acl('order/edit/customfields'))
return;
if(empty($this->ajax)) { ?>
<div id="hikamarket_order_block_fields">
<?php } ?>
<div class="hikamarket_order_edit_block">
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options large dl_glue">
<?php
foreach($this->fields['order'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><?php
echo $this->fieldsClass->getFieldName($oneExtraField, true);
?></dt>
<dd class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><span><?php
echo $this->fieldsClass->display($oneExtraField,
@$this->order->$fieldName,
'order[field]['.$fieldName.']', false, '',
false, $this->fields['order'], $this->order, false);
?></span></dd>
<?php
}
?>
</dl>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return
window.orderMgr.submitBlock('fields', {update:true});"
class="hikabtn hikabtn-success"><i class="fas
fa-check"></i> <?php echo JText::_('HIKA_OK');
;?></button>
</div>
<button onclick="return
window.orderMgr.refreshBlock('fields', false);"
class="hikabtn hikabtn-danger"><i class="far
fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both">
</div>
<?php
if(!empty($this->ajax))
return;
?>
</div>
PK��[��X�7
7
tmpl/show_block_edit_payment.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!$this->editable_order ||
!hikamarket::acl('order/edit/payment'))
return;
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options">
<dt><label><?php echo JText::_('PAYMENT_METHOD');
?></label></dt>
<dd><?php
$payment_namekey = '';
if(!empty($this->order->order_payment_method))
$payment_namekey = $this->order->order_payment_method .
'_' . $this->order->order_payment_id;
echo $this->nameboxType->display(
'order[payment][namekey]',
$payment_namekey,
hikamarketNameboxType::NAMEBOX_SINGLE,
'payment_methods',
array(
'default_text' =>
'<em>'.JText::_('HIKA_NONE').'</em>'
)
);
?></dd>
<dt><label><?php echo JText::_('PAYMENT_TAX');
?></label></dt>
<dd><?php
echo
$this->ratesType->display('order[payment][tax_namekey]',
@$this->order->order_payment_tax_namekey,
@$this->order->order_payment_tax_rate,
'onchange="window.orderMgr.updateTaxValueFields(\'orderpayment\');"');
?></dd>
<dt><label><?php echo
JText::_('HIKASHOP_PAYMENT'); ?></label></dt>
<dd>
<input type="text" id="orderpayment_value"
name="order[payment][value]"
onchange="window.orderMgr.updateTaxValueFields('orderpayment');"
value="<?php echo $this->order->order_payment_price;
?>"/> <?php echo
$this->order->currency->currency_symbol . ' (' .
$this->order->currency->currency_code . ')';
?><br/>
<div>
<span id="orderpayment_value_price"><?php echo
($this->order->order_payment_price -
$this->order->order_payment_tax); ?></span>
+
<span id="orderpayment_value_tax"><?php echo
$this->order->order_payment_tax; ?></span>
</div>
<input type="hidden" id="orderpayment_tax"
name="order[payment][tax]" value="<?php echo
(float)$this->order->order_payment_tax; ?>"/>
</dd>
</dl>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return window.orderMgr.submitDetails(this,
'payment');" class="hikabtn
hikabtn-success"><i class="fas fa-check"></i>
<?php echo JText::_('HIKA_OK'); ;?></button>
</div>
<button onclick="return window.orderMgr.showEditDetails(this,
'payment', false);" class="hikabtn
hikabtn-danger"><i class="far
fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
PK��[��gJ
tmpl/show_block_edit_product.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!$this->editable_order ||
!hikamarket::acl('order/edit/products'))
return false;
$orderProduct = $this->product;
$pid = isset($this->pid) ? $this->pid :
(int)$product->order_product_id;
$showVendor = (hikamarket::level(1) &&
$this->order->order_type == 'sale' &&
$this->vendor->vendor_id <= 1);
$colspan = 4;
if($showVendor) $colspan++;
?>
<td colspan="<?php echo $colspan; ?>"
data-order-product-id="<?php $pid; ?>">
<dl class="hikam_options">
<dt
class="hikamarket_order_product_id"><label><?php echo
JText::_('PRODUCT'); ?></label></dt>
<dd class="hikamarket_order_product_id">
<?php
echo $this->nameboxType->display(
'order[products]['.$pid.'][id]',
(int)@$orderProduct->product_id,
hikamarketNameboxType::NAMEBOX_SINGLE,
'product',
array(
'default_text' => '<em>' .
JText::_('HIKA_NONE') . '</em>',
'root' => $this->rootCategory,
'variants' => true,
'delete' => true,
)
);
?>
<?php if($pid == 0) { ?>
<script type="text/javascript">
(function() {
var n = window.oNameboxes['order_products_0_id'];
if(!n) return;
n.register('set', function(p){
window.orderMgr.loadProductData(<?php echo (int)$pid; ?>, p.value);
});
})();
</script>
<?php } else { ?>
<a href="#load" onclick="return
window.orderMgr.loadProductData(<?php echo (int)$pid; ?>,
null);"><?php echo
JText::_('HIKAM_LOAD_PRODUCT_DATA'); ?></a>
<?php } ?>
</dd>
<dt
class="hikamarket_order_product_name"><label><?php
echo JText::_('HIKA_NAME'); ?></label></dt>
<dd class="hikamarket_order_product_name">
<input type="text" name="order[products][<?php echo
$pid; ?>][name]" id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_name" value="<?php echo
$this->escape(@$orderProduct->order_product_name); ?>" />
</dd>
<dt
class="hikamarket_order_product_code"><label><?php
echo JText::_('PRODUCT_CODE'); ?></label></dt>
<dd class="hikamarket_order_product_code">
<input type="text" name="order[products][<?php echo
$pid; ?>][code]" id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_code" value="<?php echo
$this->escape(@$orderProduct->order_product_code); ?>" />
</dd>
<dt
class="hikamarket_order_product_tax"><label><?php
echo JText::_('VAT'); ?></label></dt>
<dd class="hikamarket_order_product_tax"><?php
echo
$this->ratesType->display('order[products]['.$pid.'][tax_namekey]',
@$orderProduct->order_product_tax_info[0]->tax_namekey,
@$orderProduct->tax_rate,
'onchange="window.orderMgr.updateTaxValueFields(\'hikamarket_order_'.$this->order->order_id.'_orderproduct_'.$pid.'\');"',
'hikamarket_order_'.$this->order->order_id.'_orderproduct_'.$pid.'_tax_namekey');
?></dd>
<dt
class="hikamarket_order_product_price"><label><?php
echo JText::_('UNIT_PRICE'); ?></label></dt>
<dd class="hikamarket_order_product_price">
<input type="text" name="order[products][<?php echo
$pid; ?>][value]" id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_value"
onchange="window.orderMgr.updateTaxValueFields('hikamarket_order_<?php
echo $this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>');" value="<?php echo
@$orderProduct->order_product_price +
@$orderProduct->order_product_tax; ?>"/> <?php echo
$this->order->currency->currency_symbol . ' (' .
$this->order->currency->currency_code . ')';
?><br/>
<div>
<span id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_value_price"><?php echo
round((float)hikamarket::toFloat(@$orderProduct->order_product_price));
?></span>
+
<span id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_value_tax"><?php echo
round((float)hikamarket::toFloat(@$orderProduct->order_product_tax));
?></span>
</div>
<input type="hidden" id="hikamarket_order_<?php
echo $this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_tax" name="order[products][<?php echo $pid;
?>][tax]" value="<?php echo
(float)@$orderProduct->order_product_tax; ?>"/>
</dd>
<dt
class="hikamarket_order_product_quantity"><label><?php
echo JText::_('PRODUCT_QUANTITY');
?></label></dt>
<dd class="hikamarket_order_product_quantity">
<input type="text" name="order[products][<?php echo
$pid; ?>][qty]" id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_qty" value="<?php
if(empty($pid)) {
echo 1;
} elseif(isset($orderProduct->order_product_quantity)) {
echo (int)$orderProduct->order_product_quantity;
}
?>" />
</dd>
<?php
if(!empty($this->fields['item'])) {
$editCustomFields = false;
if(hikamarket::acl('order/edit/customfields'))
$editCustomFields = true;
foreach($this->fields['item'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_product_customfield
hikamarket_order_product_customfield_<?php echo $fieldName;
?>"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></dt>
<dd class="hikamarket_order_product_customfield
hikamarket_order_product_customfield_<?php echo $fieldName;
?>"><span><?php
if($editCustomFields) {
echo $this->fieldsClass->display($oneExtraField,
@$orderProduct->$fieldName,
'order[products]['.$pid.'][field]['.$fieldName.']',false,'',true,$this->fields['item'],
$orderProduct);
} else {
echo $this->fieldsClass->show($oneExtraField,
@$orderProduct->$fieldName);
}
?></span></dd>
<?php
}
}
if(hikamarket::level(1) && $this->vendor->vendor_id <= 1
&& hikamarket::acl('order/edit/vendor') &&
(!empty($orderProduct->vendor_data) || $pid == 0)) {
$vendor_data = new stdClass();
if(!empty($orderProduct))
$vendor_data = is_array($orderProduct->vendor_data) ?
reset($orderProduct->vendor_data) : $orderProduct->vendor_data;
?>
<dt
class="hikamarket_orderproduct_vendor"><label><?php
echo JText::_('HIKA_VENDOR'); ?></label></dt>
<dd class="hikamarket_orderproduct_vendor"><?php
echo $this->nameboxType->display(
'order[products]['.$pid.'][vendor_id]',
(int) @$vendor_data->order_vendor_id,
hikamarketNameboxType::NAMEBOX_SINGLE,
'vendor',
array(
'id' =>
'hikamarket_order_'.$this->order->order_id.'_orderproduct_'.$pid.'_vendor',
'default_text' => '<em>' .
JText::_('HIKA_NONE') . '</em>',
'delete' => true,
)
);
?></dd>
<dt
class="hikamarket_orderproduct_vendorprice"><label><?php
echo JText::_('HIKAM_VENDOR_UNIT_PRICE');
?></label></dt>
<dd class="hikamarket_orderproduct_vendorprice">
<input type="text" name="order[products][<?php echo
$pid; ?>][vendor_price]" id="hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_<?php echo $pid;
?>_vendorprice" value="<?php echo
@$vendor_data->order_product_vendor_price; ?>"/>
</dd>
<?php
}
?>
</dl>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return window.orderMgr.submitProduct(this,
<?php echo $pid; ?>);" class="hikabtn
hikabtn-success"><i class="fas fa-check"></i>
<?php echo JText::_('HIKA_OK'); ;?></button>
</div>
<button onclick="return window.orderMgr.refreshProduct(this,
<?php echo $pid; ?>);" class="hikabtn
hikabtn-danger"><i class="far
fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
</td>
PK��[YrD�xx!tmpl/show_block_edit_shipping.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!$this->editable_order ||
!hikamarket::acl('order/edit/shipping'))
return;
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<?php
if(empty($this->order->warehouses) ||
count($this->order->warehouses) == 1) {
?>
<dl class="hikam_options">
<dt><label><?php echo
JText::_('HIKASHOP_SHIPPING_METHOD');
?></label></dt>
<dd><?php
$shipping_namekey = '';
if(!empty($this->order->order_shipping_method))
$shipping_namekey = $this->order->order_shipping_method .
'_' . $this->order->order_shipping_id;
echo $this->nameboxType->display(
'order[shipping][namekey]',
$shipping_namekey,
hikamarketNameboxType::NAMEBOX_SINGLE,
'shipping_methods',
array(
'default_text' =>
'<em>'.JText::_('HIKA_NONE').'</em>'
)
);
?></dd>
<dt><label><?php echo JText::_('SHIPPING_TAX');
?></label></dt>
<dd><?php
echo
$this->ratesType->display('order[shipping][tax_namekey]',
@$this->order->order_shipping_tax_namekey,
@$this->order->order_shipping_tax_rate,
'onchange="window.orderMgr.updateTaxValueFields(\'ordershipping\');"');
?></dd>
<dt><label><?php echo
JText::_('HIKASHOP_SHIPPING'); ?></label></dt>
<dd>
<input type="text" id="ordershipping_value"
name="order[shipping][value]"
onchange="window.orderMgr.updateTaxValueFields('ordershipping');"
value="<?php echo $this->order->order_shipping_price;
?>"/> <?php echo
$this->order->currency->currency_symbol . ' (' .
$this->order->currency->currency_code . ')';
?><br/>
<div>
<span id="ordershipping_value_price"><?php echo
($this->order->order_shipping_price -
$this->order->order_shipping_tax); ?></span>
+
<span id="ordershipping_value_tax"><?php echo
$this->order->order_shipping_tax; ?></span>
</div>
<input type="hidden" id="ordershipping_tax"
name="order[shipping][tax]" value="<?php echo
(float)$this->order->order_shipping_tax; ?>"/>
</dd>
</dl>
<?php
} else {
foreach($this->order->warehouses as $key => $warehouse) {
$price = $this->order->order_shipping_params->prices[$key];
list($shipping_id, $key) = explode('@', $key, 2);
$tax_namekey = array_keys($price->taxes);
$tax_namekey = reset($tax_namekey);
if(empty($tax_namekey))
$tax_namekey = @$this->order->order_shipping_tax_namekey;
$tax_rate = @$this->order->order_shipping_tax_rate;
if(!empty($price->tax) && ($price->price_with_tax -
$price->tax) != 0)
$tax_rate = $price->tax / ($price->price_with_tax -
$price->tax);
?>
<div class="order_shipping_warehouse">
<h4><?php
if(!empty($warehouse->name))
echo $warehouse->name;
else
echo $warehouse->warehouse_name;
?></h4>
<dl class="hikam_options">
<dt><label><?php echo
JText::_('HIKASHOP_SHIPPING_METHOD');
?></label></dt>
<dd><?php
$shipping_namekey = '';
if(isset($this->order->shippings[(int)$shipping_id]))
$shipping_namekey =
$this->order->shippings[(int)$shipping_id]->shipping_type .
'_' . $shipping_id;
echo $this->nameboxType->display(
'order[shippings]['.$key.'][namekey]',
$shipping_namekey,
hikamarketNameboxType::NAMEBOX_SINGLE,
'shipping_methods',
array(
'default_text' =>
'<em>'.JText::_('HIKA_NONE').'</em>'
)
);
?></dd>
<dt><label><?php echo JText::_('SHIPPING_TAX');
?></label></dt>
<dd><?php
echo
$this->ratesType->display('order[shippings]['.$key.'][tax_namekey]',
$tax_namekey, $tax_rate,
'onchange="window.orderMgr.updateTaxValueFields(\'ordershippings'.$key.'\');"');
?></dd>
<dt><label><?php echo
JText::_('HIKASHOP_SHIPPING'); ?></label></dt>
<dd>
<input type="text" id="ordershippings<?php echo
$key; ?>_value" name="order[shippings][<?php echo $key;
?>][value]"
onchange="window.orderMgr.updateTaxValueFields('ordershippings<?php
echo $key; ?>');" value="<?php echo
$price->price_with_tax; ?>"/> <?php echo
$this->order->currency->currency_symbol . ' (' .
$this->order->currency->currency_code . ')';
?><br/>
<div>
<span id="ordershippings<?php echo $key;
?>_value_price"><?php echo ($price->price_with_tax -
$price->tax); ?></span>
+
<span id="ordershippings<?php echo $key;
?>_value_tax"><?php echo $price->tax; ?></span>
</div>
<input type="hidden" id="ordershippings<?php echo
$key; ?>_tax" name="order[shippings][<?php echo $key;
?>][tax]" value="<?php echo (float)$price->tax;
?>"/>
</dd>
</dl>
</div>
<?php
}
}
?>
<div style="clear:both;margin-top:4px;"></div>
<div style="float:right">
<button onclick="return window.orderMgr.submitDetails(this,
'shipping');" class="hikabtn
hikabtn-success"><i class="fas fa-check"></i>
<?php echo JText::_('HIKA_OK'); ;?></button>
</div>
<button onclick="return window.orderMgr.showEditDetails(this,
'shipping', false);" class="hikabtn
hikabtn-danger"><i class="far
fa-times-circle"></i> <?php echo
JText::_('HIKA_CANCEL'); ;?></button>
<div style="clear:both"></div>
PK��[�es==tmpl/show_block_fields.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->fields['order']) ||
!hikamarket::acl('order/show/customfields'))
return;
if(empty($this->ajax)) { ?>
<div id="hikamarket_order_block_fields">
<?php } ?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options large">
<?php
foreach($this->fields['order'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></dt>
<dd class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><span><?php
echo $this->fieldsClass->show($oneExtraField,
@$this->order->$fieldName);
?></span></dd>
<?php
}
?>
</dl>
<?php
if(!empty($this->ajax))
return;
?>
</div>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.fields',function(params){
window.orderMgr.refreshBlock('fields'); });
</script>
PK��[�x�
tmpl/show_block_general.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->order))
return;
if(empty($this->ajax)) { ?>
<div id="hikamarket_order_block_general">
<?php } ?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<dl class="hikam_options large">
<?php if(empty($this->order->order_invoice_created) ||
$this->order->order_invoice_created !=
$this->order->order_created) { ?>
<dt
class="hikamarket_order_created"><label><?php echo
JText::_('DATE_ORDER_CREATED');?></label></dt>
<dd class="hikamarket_order_created"><?php echo
hikamarket::getDate($this->order->order_created, '%Y-%m-%d
%H:%M'); ?></dd>
<?php } ?>
<dt
class="hikamarket_order_invoicenumber"><label><?php
echo JText::_('INVOICE_NUMBER'); ?></label></dt>
<dd
class="hikamarket_order_invoicenumber"><span><?php
echo @$this->order->order_invoice_number;
?></span></dd>
<?php if(!empty($this->order->order_invoice_created)) { ?>
<dt
class="hikamarket_order_created"><label><?php echo
JText::_('DATE_ORDER_PAID');?></label></dt>
<dd class="hikamarket_order_created"><?php echo
hikamarket::getDate($this->order->order_invoice_created,
'%Y-%m-%d %H:%M');?></dd>
<?php } ?>
<?php if((int)$this->order->order_vendor_id > 1 &&
(int)$this->vendor->vendor_id <= 1 &&
!empty($this->order->hikamarket->vendor)) { ?>
<dt class="hikamarket_order_vendor"><label><?php
echo JText::_('HIKA_VENDOR');?></label></dt>
<dd class="hikamarket_order_vendor"><?php echo
$this->escape($this->order->hikamarket->vendor->vendor_name);
?></dd>
<?php } ?>
<?php if((int)$this->vendor->vendor_id <= 1 &&
$this->order->order_parent_id > 0 &&
isset($this->order->hikamarket->parent)) { ?>
<dt class="hikamarket_order_parent"><label><?php
echo
JText::_('HIKAM_PARENT_ORDER');?></label></dt>
<dd class="hikamarket_order_parent"><a
href="<?php echo
hikamarket::completeLink('order&task=show&cid='.(int)$this->order->order_parent_id);
?>"><?php
echo
$this->escape($this->order->hikamarket->parent->order_number);
?></a></dd>
<?php } ?>
</dl>
<?php
if(!empty($this->ajax))
return;
?>
</div>
<script type="text/javascript">
window.Oby.registerAjax(['orderMgr.general','orderMgr.order_status'],function(params){
window.orderMgr.refreshBlock('general'); });
</script>
PK��[����%
%
tmpl/show_block_history.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!hikamarket::acl('order/show/history'))
return;
$acl_history_data = hikamarket::acl('order/show/historydata');
if(empty($this->ajax)) { ?>
<div id="hikamarket_order_block_history">
<?php
}
if(!empty($this->order->history)) {
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<h3 style="display:inline-block"><?php echo
JText::_('HISTORY')?></h3>
<div class="hikamarket_history_container">
<table id="hikamarket_order_history_listing"
class="hikam_listing <?php echo (HIKASHOP_RESPONSIVE)?'table
table-striped table-hover table-bordered':'hikam_table';
?>">
<thead>
<tr>
<th class="title"><?php
echo JText::_('HIKA_TYPE');
?></th>
<th class="title"><?php
echo JText::_('ORDER_STATUS');
?></th>
<th class="title"><?php
echo JText::_('REASON');
?></th>
<th class="title"><?php
echo JText::_('DATE');
?></th>
<?php if($acl_history_data) { ?>
<th class="title"
style="width:2%;min-width:20px;"></th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
$k = 0;
foreach($this->order->history as $i => $history) {
?>
<tr class="row<?php echo $k; ?>">
<td><?php
if(!empty($history->history_type)) {
$val =
preg_replace('#[^a-z0-9]#i','_',strtoupper($history->history_type));
$trans = JText::_($val);
if($val != $trans)
$history->history_type = $trans;
} else {
$history->history_type =
'<em>'.JText::_('HIKA_NONE').'</em>';
}
echo $history->history_type;
?></td>
<td>
<span class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$history->history_new_status));
?>"><?php echo
hikamarket::orderStatus($history->history_new_status);
?></span>
</td>
<td><?php
if(!empty($history->history_reason))
echo $history->history_reason;
else
echo
'<em>'.JText::_('HIKA_NONE').'</em>';
?></td>
<td><?php
echo hikamarket::getDate($history->history_created,'%Y-%m-%d
%H:%M');
?></td>
<?php if($acl_history_data) { ?>
<td>
<a onclick="return window.orderMgr.showHistory(this);"
data-popup-href="<?php echo
hikamarket::completeLink('order&task=history&order_id='.$this->order->order_id.'&cid='.$history->history_id,
true); ?>" href="#"><i class="fas
fa-info-circle"></i></a>
</td>
<?php } ?>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
</div>
<?php
}
if(!empty($this->ajax))
return;
?>
</div>
<?php
if($acl_history_data) {
echo $this->popup->display(
'',
'HIKAM_HISTORY_DETAILS',
hikamarket::completeLink('order&task=history&order_id='.$this->order->order_id.'&cid=0',
true),
'hikamarket_showhistory_popup',
750, 460, 'style="display:none;"', '',
'link'
);
?>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.history',function(params){
window.orderMgr.refreshBlock('history'); });
window.orderMgr.showHistory = function(el) { return this.showEl(el,
'hikamarket_showhistory_popup'); };
</script>
<?php
}
PK��[J��CCtmpl/show_block_product.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$product = $this->product;
$pid = isset($this->pid) ? $this->pid :
(int)$product->order_product_id;
$showVendor = (hikamarket::level(1) &&
$this->order->order_type == 'sale' &&
$this->vendor->vendor_id <= 1);
$td_class = !empty($product->order_product_option_parent_id) ? '
hikamarket_order_item_option' : '';
?>
<td class="hikamarket_order_item_name_value<?php echo $td_class;
?>" data-order-product-id="<?php echo $pid;
?>">
<?php
if( $this->editable_order &&
hikamarket::acl('order/edit/products') ) {
$product_hash = md5((int)$product->order_product_id . '#' .
(int)$product->order_id . '#' .
(int)$this->order->order_modified);
$dropData = array(
array(
'name' => '<i class="fas
fa-pencil-alt"></i> ' .
JText::_('HIKAM_EDIT_PRODUCT'),
'link' => '#edit-product',
'click' => 'return
window.orderMgr.refreshProduct(this, ' .
(int)$product->order_product_id . ', true);'
),
'-',
array(
'name' => '<i class="far
fa-trash-alt"></i> ' .
JText::_('HIKAM_DELETE_PRODUCT'),
'link' => '#delete-product',
'click' => 'return window.orderMgr.deleteProduct(this,
' . (int)$product->order_product_id . ', \'' .
$product_hash . '\');'
)
);
echo '<div style="float:right">' .
$this->dropdownHelper->display(JText::_('HIKAM_EDIT'),
$dropData, array('type' => '', 'mini'
=> true, 'class' => 'hikabtn-primary',
'right' => false, 'up' => false)) .
'</div>';
}
if(!empty($product->product_id)) {
?>
<a onclick="return window.orderMgr.showProduct(this);"
data-popup-href="<?php echo
hikamarket::completeLink('shop.product&task=show&cid='.$product->product_id,
true); ?>" href="<?php echo
hikamarket::completeLink('shop.product&task=show&cid='.$product->product_id);
?>"><?php
if(!empty($product->images)) {
$img = reset($product->images);
$thumb = $this->imageHelper->getThumbnail(@$img->file_path,
array(50,50), array('default' => 1, 'forcesize'
=> 1));
if(!empty($thumb->path) && empty($thumb->external))
echo '<img src="'.
$this->imageHelper->uploadFolder_url . str_replace('\\',
'/', $thumb->path).'" alt=""
class="hikam_imglist"/>';
else if(!empty($thumb->path) && !empty($thumb->url))
echo '<img src="'. $thumb->url.'"
alt="" width="50" height="50"
class="hikam_imglist"/>';
}
echo $product->order_product_name;
?></a>
<?php
} else {
echo $product->order_product_name;
}
?>
<br/>
<?php
echo $product->order_product_code;
if(hikashop_level(2) && !empty($this->fields['item']))
{
?>
<p class="hikamarket_order_product_custom_item_fields">
<?php
foreach($this->fields['item'] as $field) {
$namekey = $field->field_namekey;
if(empty($product->$namekey) &&
!strlen($product->$namekey))
continue;
echo '<p
class="hikamarket_order_item_'.$namekey.'">' .
$this->fieldsClass->trans($field->field_realname) . ':
' . $this->fieldsClass->show($field,$product->$namekey) .
'</p>';
}
?>
</p>
<?php
}
if(!empty($product->files) &&
hikamarket::acl('order/show/files')) {
?>
<div class="hikamarket_order_product_files"
style="clear:left;">
<a href="#files"
data-toggle-display="hikamarket_order_product_files_<?php echo
(int)$product->order_product_id; ?>" onclick="return
window.orderMgr.toggleDisplay(this);"><?php
echo JText::_('HIKAM_SHOW_FILES');
?></a>
<ul id="hikamarket_order_product_files_<?php echo
(int)$product->order_product_id;?>"
style="display:none;">
<?php
foreach($product->files as $file) {
echo '<li
class="hikamarket_order_product_file">';
if(empty($file->file_name))
$file->file_name = $file->file_path;
echo $file->file_name;
if(!empty($this->order_status_for_download) &&
!in_array($this->order->order_status,
explode(',',$this->order_status_for_download)))
echo $fileHtml .= ' /
<b>'.JText::_('BECAUSE_STATUS_NO_DOWNLOAD').'</b>';
if(!empty($this->download_time_limit)) {
$time_limit = ($this->download_time_limit +
(!empty($this->order->order_invoice_created) ?
$this->order->order_invoice_created :
$this->order->order_created));
if($time_limit < time()) {
echo ' / <b>' .
JText::_('TOO_LATE_NO_DOWNLOAD') . '</b>';
} else {
echo ' / ' . JText::sprintf('UNTIL_THE_DATE',
hikashop_getDate($time_limit));
}
}
if(!empty($file->file_limit) && (int)$file->file_limit !=
0) {
$download_number_limit = $file->file_limit;
if($download_number_limit < 0)
$download_number_limit = 0;
} else {
$download_number_limit = $this->download_number_limit;
}
if(!empty($download_number_limit)) {
if($download_number_limit <= $file->download_number) {
echo ' /
<b>'.JText::_('MAX_REACHED_NO_DOWNLOAD').'</b>';
} else {
echo ' / '.JText::sprintf('X_DOWNLOADS_LEFT',
$download_number_limit - $file->download_number);
}
} else {
echo ' / ' . JText::sprintf('X_DOWNLOADS_MADE',
$file->download_number);
}
echo '</li>';
}
?>
</ul>
</div>
<?php
}
if(hikashop_level(1) && !empty($product->bundle)) {
?>
<div style="clear:both"></div>
<?php
foreach($product->bundle as $bundle) {
$desc = '<strong>'.$bundle->order_product_name .
'</strong><br/>'.
JText::_('CART_PRODUCT_QUANTITY').'
'.(int)$bundle->order_product_options['related_quantity'];
$img = new stdClass();
if(!empty($bundle->images))
$img = reset($bundle->images);
$thumb = $this->imageHelper->getThumbnail(@$img->file_path,
array(35,35), array('default' => 0, 'forcesize'
=> 1));
if(!empty($thumb->success)) {
echo '<img src="'. $thumb->url.'"
alt="" class="hikam_bundlelist"
alt="'.$this->escape($bundle->order_product_name).'"
data-toggle="hk-tooltip" data-title="' .
htmlspecialchars($desc, ENT_COMPAT, 'UTF-8') . '"/>
';
} else {
echo hikamarket::tooltip($desc, '', '',
$bundle->order_product_name). ' ';
}
}
}
if(!empty($product->extraData)) {
if(!is_array($product->extraData))
$product->extraData = array($product->extraData);
echo implode("\r\n", $product->extraData);
}
?>
</td>
<td class="hikamarket_order_item_price_value"><?php
echo $this->currencyHelper->format($product->order_product_price,
$this->order->order_currency_id);
if(bccomp($product->order_product_tax, 0, 5))
echo '<br/>'.JText::sprintf('PLUS_X_OF_VAT',
$this->currencyHelper->format($product->order_product_tax,
$this->order->order_currency_id));
?></td>
<?php if($showVendor) { ?>
<td class="hikamarket_order_item_vendor_value"><?php
$vendor_display = false;
if(!empty($product->vendor_data) &&
is_array($product->vendor_data)) {
foreach($product->vendor_data as $vendor_data) {
if((int)$vendor_data->vendor_id <= 1)
continue;
$vendor_display = true;
echo
'<p>'.$vendor_data->vendor_name.'<br/>'.
$this->currencyHelper->format($vendor_data->order_product_vendor_price,
$this->order->order_currency_id).'</p>';
}
}
if(!$vendor_display)
echo '-';
?></td>
<?php } ?>
<td class="hikamarket_order_item_quantity_value"><?php
echo (int)$product->order_product_quantity;
?></td>
<td
class="hikamarket_order_item_total_price_value"><?php
echo
$this->currencyHelper->format($product->order_product_total_price,
$this->order->order_currency_id);
?></td>
PK��[��y1+"+"tmpl/show_block_products.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->ajax)) {
if($this->editable_order &&
hikamarket::acl('order/edit/products')) {
$dropData = array(
array(
'name' => '<i class="fas
fa-plus"></i> ' .
JText::_('HIKAM_ADD_NEW_PRODUCT'),
'link' => '#new-product',
'click' => 'return
window.orderMgr.addProduct(this);'
)
);
echo
$this->dropdownHelper->display(JText::_('HIKAM_EDIT'),
$dropData, array('type' => '', 'mini'
=> true, 'class' => 'hikabtn-primary',
'right' => false, 'up' => false));
hikamarket::loadJslib('otree');
}
?>
<div id="hikamarket_order_block_products">
<?php
}
$showVendor = (hikamarket::level(1) &&
$this->order->order_type == 'sale' &&
$this->vendor->vendor_id <= 1);
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<table class="hikam_listing <?php echo
(HIKASHOP_RESPONSIVE)?'table table-striped table-hover
table-bordered':'hikam_table'; ?>"
id="hikamarket_order_product_listing"
style="width:100%">
<thead>
<tr>
<th class="hikamarket_order_item_name_title
title"><?php echo JText::_('PRODUCT');
?></th>
<th class="hikamarket_order_item_price_title
title"><?php echo JText::_('UNIT_PRICE');
?></th>
<?php if($showVendor){ ?>
<th class="hikamarket_order_item_vendor_title
title"><?php echo JText::_('HIKA_VENDOR');
?></th>
<?php } ?>
<th class="hikamarket_order_item_quantity_title
title"><?php echo
hikamarket::tooltip(JText::_('PRODUCT_QUANTITY'), '',
'', JText::_('CART_PRODUCT_QUANTITY'), '',
0); ?></th>
<th class="hikamarket_order_item_total_price_title
title"><?php echo JText::_('PRICE'); ?></th>
</tr>
</thead>
<tbody id="hikamarket_order_product_listing_content">
<?php
foreach($this->order->products as $k => $product) {
?>
<tr id="hikamarket_order_product_<?php echo
(int)$product->order_product_id; ?>"><?php
$this->product = $product;
echo $this->loadTemplate('block_product');
?></tr>
<?php
}
?>
</tbody>
</table>
<?php
if(!empty($this->ajax))
return;
?>
</div>
<?php
echo $this->popup->display(
'',
'HIKAM_SHOW_ORDER_PRODUCT',
hikamarket::completeLink('shop.product&task=show&cid=0',
true),
'hikamarket_showproduct_popup',
750, 460, 'style="display:none;"', '',
'link'
);
?>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.products',function(params){
window.orderMgr.refreshBlock('products'); });
window.orderMgr.showProduct = function(el) { return this.showEl(el,
'hikamarket_showproduct_popup'); };
<?php if(hikamarket::acl('order/edit/products')) { ?>
window.orderMgr.updateProductLine = function(e, data) {
var tr = document.createElement('tr'), cell = null;
tr.innerHTML = data;
e.innerHTML = '';
for(var i = tr.cells.length - 1; i >= 0; i--) {
cell = tr.cells[0];
tr.removeChild(cell);
e.appendChild(cell);
cell = null;
}
window.Oby.updateElem(tr, data);
tr = null;
};
window.orderMgr.refreshProduct = function(el, id, edit) {
var d = document, o = window.Oby,
c = null, e = d.getElementById('hikamarket_order_product_' +
id);
if(!e) return false;
if(id == 0) {
e.parentNode.removeChild(e);
return false;
}
c = d.getElementById('hikamarket_order_block_products');
if(c) o.addClass(c, "hikamarket_ajax_loading");
var url = '<?php echo
hikamarket::completeLink('order&task=showblock&cid='.(int)$this->order->order_id.'&tmpl=ajax',
false, false, true); ?>',
params = { mode: "POST", data:
o.encodeFormData({'block': edit ? 'edit_product' :
'product', 'pid': id}) };
o.xRequest(url, params, function(x,p) {
window.orderMgr.updateProductLine(e, x.responseText);
if(c) o.removeClass(c, "hikamarket_ajax_loading");
});
return false;
};
window.orderMgr.submitProduct = function(el, id) {
var d = document, o = window.Oby,
c = null, e = d.getElementById('hikamarket_order_product_' +
id);
if(!e) return false;
c = d.getElementById('hikamarket_order_block_products');
if(c) o.addClass(c, "hikamarket_ajax_loading");
var url = '<?php echo
hikamarket::completeLink('order&task=submitblock&block=product&cid='.(int)$this->order->order_id.'&pid=HIKAPID&'.hikamarket::getFormToken().'=1&tmpl=ajax',
false, false, true); ?>'.replace("HIKAPID", id),
formData = o.getFormData(e);
o.xRequest(url, {mode:"POST", data: formData}, function(x,p) {
if(x.responseText != "0") {
window.orderMgr.updateProductLine(e, x.responseText);
if(id == 0) {
var cell = e.firstChild, pid = 0;
if(cell) pid =
parseInt(cell.getAttribute('data-order-product-id'));
if(pid !== null && pid !== NaN)
e.id = "hikamarket_order_product_" + pid;
}
}
if(c) o.removeClass(c, "hikamarket_ajax_loading");
});
return false;
};
window.orderMgr.addProduct = function(el) {
var d = document, o = window.Oby,
c = null, e = d.getElementById('hikamarket_order_product_0');
if(e) return false;
e =
d.getElementById('hikamarket_order_product_listing_content');
if(!e) return false;
c = d.getElementById('hikamarket_order_block_products');
if(c) o.addClass(c, "hikamarket_ajax_loading");
var url = '<?php echo
hikamarket::completeLink('order&task=showblock&block=edit_product&cid='.(int)$this->order->order_id.'&pid=0&tmpl=ajax',
false, false, true); ?>';
o.xRequest(url, null, function(x,p) {
var tr = document.createElement('tr');
tr.id = 'hikamarket_order_product_0';
e.appendChild(tr);
e = d.getElementById('hikamarket_order_product_0');
window.orderMgr.updateProductLine(e, x.responseText);
if(c) o.removeClass(c, "hikamarket_ajax_loading");
});
return false;
};
window.orderMgr.deleteProduct = function(el, id, hash) {
var d = document, o = window.Oby,
c = null, e = d.getElementById('hikamarket_order_product_' +
id);
if(!e) return false;
if(!confirm('<?php echo
JText::_('HIKAM_CONFIRM_DELETE_ORDER_PRODUCT', true);
?>'))
return false;
c = d.getElementById('hikamarket_order_block_products');
if(c) o.addClass(c, "hikamarket_ajax_loading");
var url = '<?php echo
hikamarket::completeLink('order&task=submitblock&block=delete_product&cid='.(int)$this->order->order_id.'&'.hikamarket::getFormToken().'=1&tmpl=ajax',
false, false, true); ?>',
params = { mode: "POST", data:
o.encodeFormData({'pid': id, 'product_hash': hash}) };
o.xRequest(url, params, function(x,p) {
if(x.responseText == '1') {
e.parentNode.removeChild(e);
o.fireAjax('orderMgr.details');
o.fireAjax('orderMgr.history');
} else {
console.log(['product delete error', x.responseText]);
}
if(c) o.removeClass(c, "hikamarket_ajax_loading");
});
return false;
};
window.orderMgr.loadProductData = function(id, product) {
var d = document, o = window.Oby,
c = null, e = d.getElementById('hikamarket_order_product_' +
id);
if(!e) return false;
if(product === undefined || product === null) {
var n = window.oNameboxes['order_products_' + id +
'_id'];
if(!n)
return false;
var data = n.get();
if(data && data.value)
product = data.value
}
if(!product || product <= 0)
return false;
var url = '<?php echo
hikamarket::completeLink('order&task=product_data&cid='.(int)$this->order->order_id.'&'.hikamarket::getFormToken().'=1&tmpl=ajax',
false, false, true); ?>',
field_name = 'hikamarket_order_<?php echo
$this->order->order_id; ?>_orderproduct_' + id +
'_',
params = { mode: "POST", data:
o.encodeFormData({'order_product': id, 'product':
product}) },
field = d.getElementById(field_name + 'qty'), qty = 0,
setField = function(k, v) {
var el = d.getElementById(field_name + k);
if(!el) return;
el.value = v;
if(k == 'value') o.fireEvent(el, 'change');
};
if(field && field.value)
qty = parseInt(field.value);
if(qty !== NaN && qty > 0)
params.data = o.encodeFormData({'order_product': id,
'product': product, 'qty': qty});
o.xRequest(url, params, function(x,p) {
var ret = o.evalJSON( x.responseText );
if(!ret) return;
if(ret.name) setField('name', ret.name);
if(ret.code) setField('code', ret.code);
if(ret.tax) setField('tax_namekey', ret.tax);
if(ret.price) setField('value', ret.price);
if(ret.vendor) {
var n = window.oNameboxes[field_name + 'vendor'];
if(n) n.set(ret.vendor.name, ret.vendor.id);
}
if(ret.vendorprice) setField('vendorprice', ret.vendorprice);
});
return false;
};
<?php } ?>
</script>
PK��[�0�
tmpl/show_block_vendors.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->ajax)) {
$display = '';
if(empty($this->order->hikamarket->children))
$display = 'display:none;';
?>
<!-- VENDORS -->
<div id="hikamarket_order_block_vendors" style="<?php
echo $display; ?>">
<?php
}
?>
<div class="hikamarket_ajax_loading_elem"></div>
<div class="hikamarket_ajax_loading_spinner"></div>
<h3 style="display:inline-block"><?php echo
JText::_('HIKAM_VENDOR_ORDERS')?></h3>
<table class="hikam_listing <?php echo
(HIKASHOP_RESPONSIVE)?'table table-striped table-hover
table-bordered':'hikam_table'; ?>"
id="hikamarket_order_subsales" style="width:100%">
<thead>
<tr>
<th class="hikamarket_order_item_name_title
title"><?php echo
JText::_('ORDER_NUMBER');?></th>
<th class="hikamarket_order_item_name_title
title"><?php echo
JText::_('HIKA_VENDOR');?></th>
<th class="hikamarket_order_item_name_title
title"><?php echo
JText::_('ORDER_STATUS');?></th>
<th class="hikamarket_order_item_name_title
title"><?php echo
JText::_('HIKASHOP_TOTAL');?></th>
<th class="hikamarket_order_item_name_title
title"><?php echo
JText::_('VENDOR_TOTAL');?></th>
</tr>
</thead>
<tbody id="hikamarket_order_product_listing_content">
<?php
if(!empty($this->order->hikamarket->children)) {
foreach($this->order->hikamarket->children as $subOrder) {
?>
<tr>
<td>
<?php
if($subOrder->order_type == 'subsale') {
?>
<a href="<?php echo
hikamarket::completeLink('order&task=show&cid='.(int)$subOrder->order_id);?>"><?php
echo $subOrder->order_number; ?></a>
<?php
} else {
echo
'<em>'.JText::_('HIKAM_ORDER_ADJUSTMENT').'</em>';
}
?>
</td>
<td><?php
echo $this->escape($subOrder->vendor_name);
?></td>
<td><?php echo
hikamarket::orderStatus($subOrder->order_status); ?></td>
<td><?php
echo
$this->currencyHelper->format($subOrder->order_full_price,
$subOrder->order_currency_id);
?></td>
<td><?php
echo
$this->currencyHelper->format($subOrder->order_vendor_price,
$subOrder->order_currency_id);
if(isset($subOrder->order_vendor_price_with_refunds) &&
$subOrder->order_vendor_price_with_refunds !== null) {
echo ' (' .
$this->currencyHelper->format($subOrder->order_vendor_price_with_refunds,
$subOrder->order_currency_id) . ')';
}
if(!empty($subOrder->order_vendor_paid))
echo ' ' .
hikamarket::tooltip(JText::_('HIKAM_ORDER_IS_PAID'),
'', '', '<img
src="'.HIKAMARKET_IMAGES.'icon-16/save2.png"
style="vertical-align:top;"
alt="('.JText::_('PAID').')" />',
'', 0);
?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<?php if(empty($this->ajax)) { ?>
</div>
<script type="text/javascript">
window.Oby.registerAjax('orderMgr.details',function(params){
window.orderMgr.refreshBlock('vendors'); });
</script>
<?php } elseif(!empty($this->order->hikamarket->children)) {
?>
<script type="text/javascript">
(function(){
var el =
document.getElementById('hikamarket_order_block_vendors');
if(el) el.style.display = '';
})();
</script>
<?php }
PK��[5I�WWtmpl/show_general.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?> <legend><?php echo JText::_('MAIN_INFORMATION');
?></legend>
<?php
$show_url =
'order&task=show&subtask=general&cid='.$this->order->order_id;
$save_url =
'order&task=save&subtask=general&cid='.$this->order->order_id;
$update_url =
'order&task=edit&subtask=general&cid='.$this->order->order_id;
if(!isset($this->edit) || $this->edit !== true ) {
if(hikamarket::acl('order/edit/general')) {
?> <div class="hikam_edit"><a href="<?php
echo hikamarket::completeLink($update_url, true);?>"
onclick="return
window.hikamarket.get(this,'hikamarket_order_field_general');"><i
class="fas fa-pencil-alt"></i><span><?php echo
JText::_('HIKA_EDIT'); ?></span></a></div>
<?php
}
} else {
?> <div class="hikam_edit">
<a href="<?php echo hikamarket::completeLink($save_url,
true);?>" onclick="return
window.hikamarket.form(this,'hikamarket_order_field_general');"><i
class="fas fa-check"></i><span><?php echo
JText::_('HIKA_SAVE'); ?></span></a>
<a href="<?php echo hikamarket::completeLink($show_url,
true);?>" onclick="return
window.hikamarket.get(this,'hikamarket_order_field_general');"><i
class="far fa-times-circle"></i><span><?php
echo JText::_('HIKA_CANCEL'); ?></span></a>
</div>
<?php
}
?>
<dl class="hikam_options">
<dt class="hikamarket_order_number"><label><?php
echo JText::_('ORDER_NUMBER'); ?></label></dt>
<dd class="hikamarket_order_number"><span><?php
echo $this->order->order_number; ?></span></dd>
<dt
class="hikamarket_order_invoicenumber"><label><?php
echo JText::_('INVOICE_NUMBER'); ?></label></dt>
<dd
class="hikamarket_order_invoicenumber"><span><?php
echo @$this->order->order_invoice_number;
?></span></dd>
<dt class="hikamarket_order_status"><label
for="data[order][order_status]"><?php echo
JText::_('ORDER_STATUS'); ?></label></dt>
<dd class="hikamarket_order_status"><?php
if(!isset($this->edit) || $this->edit !== true ) {
?><span><?php echo
hikamarket::orderStatus($this->order->order_status);
?></span><?php
} else {
$extra =
'onchange="window.orderMgr.status_changed(this);"';
echo
$this->order_status->display('data[order][order_status]',
$this->order->order_status, $extra);
}
?></dd>
<?php
if(isset($this->edit) && $this->edit === true &&
($this->vendor->vendor_id == 0 || $this->vendor->vendor_id ==
1) && hikamarket::acl('order/edit/notify')) {
?>
<dt id="hikamarket_order_notify_lbl"
style="display:none;"
class="hikamarket_order_notify"><label
for="data[notify]"><?php echo
JText::_('NOTIFICATION'); ?></label></dt>
<dd id="hikamarket_order_notify_val"
style="display:none;"
class="hikamarket_order_notify"><input
type="checkbox" id="data[notify]"
name="data[notify]"/><label
style="display:inline-block"
for="data[notify]"><?php echo
JText::_('NOTIFY_CUSTOMER'); ?></label></dd>
<?php
}
?>
<dt
class="hikamarket_order_created"><label><?php echo
JText::_('DATE'); ?></label></dt>
<dd class="hikamarket_order_created"><span><?php
echo hikamarket::getDate($this->order->order_created,'%Y-%m-%d
%H:%M');?></span></dd>
<dt class="hikamarket_order_id"><label><?php
echo JText::_('ID'); ?></label></dt>
<dd class="hikamarket_order_id"><span><?php echo
$this->order->order_id; ?></span></dd>
<?php
if(isset($this->edit) && $this->edit === true ) {
?>
<dt
class="hikamarket_order_history"><label><?php echo
JText::_('HISTORY'); ?></label></dt>
<dd class="hikamarket_order_history">
<span><input
onchange="window.orderMgr.general_history_changed(this);"
type="checkbox" id="hikamarket_history_general_store"
name="data[history][store_data]"
value="1"/><label
for="hikamarket_history_general_store"
style="display:inline-block"><?php echo
JText::_('SET_HISTORY_MESSAGE');?></label></span><br/>
<textarea id="hikamarket_history_general_msg"
name="data[history][msg]"
style="display:none;"></textarea>
</dd>
<?php
}
?>
</dl>
<?php
if(isset($this->edit) && $this->edit === true ) {
?>
<script type="text/javascript">
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.status_changed = function(el) {
var fields = ['hikamarket_order_notify_lbl',
'hikamarket_order_notify_val'], displayValue = '';
if(el.value == '<?php echo $this->order->order_status;
?>')
displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
};
window.orderMgr.general_history_changed = function(el) {
var fields = ['hikamarket_history_general_msg'], displayValue =
'';
if(!el.checked) displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
};
</script>
<input type="hidden" name="data[general]"
value="1"/>
<?php echo JHTML::_('form.token')."\r\n";
}
PK��[B"Z~��tmpl/show_history.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><legend><?php echo JText::_('HISTORY');
?></legend>
<div class="hikamarket_history_container">
<table id="hikamarket_order_history_listing"
class="hikam_listing hikam_table table table-striped
table-hover">
<thead>
<tr>
<th class="title"><?php
echo JText::_('HIKA_TYPE');
?></th>
<th class="title"><?php
echo JText::_('ORDER_STATUS');
?></th>
<th class="title"><?php
echo JText::_('REASON');
?></th>
<th class="title"><?php
echo JText::_('HIKA_USER').' /
'.JText::_('IP');
?></th>
<th class="title"><?php
echo JText::_('DATE');
?></th>
<th class="title"><?php
echo JText::_('INFORMATION');
?></th>
</tr>
</thead>
<tbody>
<?php
$userClass = hikamarket::get('shop.class.user');
foreach($this->order->history as $k => $history) {
?>
<tr>
<td><?php
$val =
preg_replace('#[^a-z0-9]#i','_',strtoupper($history->history_type));
$trans = JText::_($val);
if($val != $trans)
$history->history_type = $trans;
echo $history->history_type;
?></td>
<td><?php
echo hikamarket::orderStatus($history->history_new_status);
?></td>
<td><?php
echo $history->history_reason;
?></td>
<td><?php
if(!empty($history->history_user_id)){
$user = $userClass->get($history->history_user_id);
echo $user->username.' / ';
}
echo $history->history_ip;
?></td>
<td><?php
echo hikamarket::getDate($history->history_created,'%Y-%m-%d
%H:%M');
?></td>
<td><?php
echo $history->history_data;
?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
PK��[���
tmpl/show_legacy.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><script type="text/javascript">
<!--
window.orderMgr = {
updateAdditionnals: function(){},
updateHistory: function(){},
updateShipping: function(){},
updateBilling: function(){}
};
//-->
</script>
<table class="hikam_blocks">
<tr>
<td style="width:50%" class="hikam_block_l">
<fieldset class="hikam_field"
id="hikamarket_order_field_general">
<?php
echo $this->loadTemplate('general');
?>
</fieldset>
<fieldset class="hikam_field">
<legend><?php echo
JText::_('CUSTOMER')?></legend>
<?php if(hikamarket::acl('order/edit/customer') &&
($this->vendor->vendor_id == 0 || $this->vendor->vendor_id ==
1)) { ?>
<div class="hikam_edit">
<?php
echo $this->popup->display(
'<img src="'. HIKAMARKET_IMAGES
.'icon-16/edit.png" alt=""/><span>'.
JText::_('HIKA_EDIT') .'</span>',
'HIKAM_SET_ORDER_CUSTOMER',
hikamarket::completeLink('user&task=selection&single=1&confirm=0&after=order|customer_set&afterParams=order_id|'.$this->order->order_id,
true),
'hikamarket_setcustomer_popup',
750, 460, 'onclick="return
window.orderMgr.setCustomer(this);"', '',
'link'
);
?>
</div>
<script type="text/javascript">
<!--
window.orderMgr.setCustomer = function(el) {
var w = window;
w.hikamarket.submitFct = function(data) {
var d = document, input = null, inputs =
{id:'hikamarket_order_customer_id',name:'hikamarket_order_customer_name',email:'hikamarket_order_customer_email'};
for(var i in inputs) {
input = d.getElementById(inputs[i]);
if(input)
input.innerHTML = data[i];
}
if(data['updates']) {
for(var i = 0; i < data['updates'].length; i++) {
var up = data['updates'][i];
if(up == 'history') window.orderMgr.updateHistory();
if(up == 'billing') window.orderMgr.updateBilling();
}
}
};
w.hikashop.openBox(el);
return false;
}
//-->
</script>
<?php } ?>
<dl class="hikam_options">
<dt
class="hikamarket_order_customer_name"><label><?php
echo JText::_('HIKA_NAME');?></label></dt>
<dd class="hikamarket_order_customer_name"><span
id="hikamarket_order_customer_name"><?php echo
@$this->order->customer->name; ?></span></dd>
</dl>
<dl class="hikam_options">
<dt
class="hikamarket_order_customer_email"><label><?php
echo JText::_('HIKA_EMAIL');?></label></dt>
<dd class="hikamarket_order_customer_email"><span
id="hikamarket_order_customer_email"><?php echo
@$this->order->customer->user_email;
?></span></dd>
</dl>
<dl class="hikam_options">
<dt
class="hikamarket_order_customer_id"><label><?php
echo JText::_('ID');?></label></dt>
<dd class="hikamarket_order_customer_id"><span
id="hikamarket_order_customer_id"><?php echo
@$this->order->customer->user_id; ?></span></dd>
</dl>
</fieldset>
</td>
<td style="width:50%;" class="hikam_block_r">
<fieldset class="hikam_field"
id="hikamarket_order_field_additional">
<?php
echo $this->loadTemplate('additional');
?>
</fieldset>
</td>
</tr>
<tr>
<td class="hikam_block_l">
<fieldset class="hikam_field"
id="hikamarket_order_field_billing_address">
<?php
$this->type = 'billing';
echo $this->loadTemplate('address');
?>
</fieldset>
</td>
<td class="hikam_block_r">
<fieldset class="hikam_field"
id="hikamarket_order_field_shipping_address">
<?php
if(empty($this->order->override_shipping_address)) {
$this->type = 'shipping';
echo $this->loadTemplate('address');
} else {
echo $this->order->override_shipping_address;
}
?>
</fieldset>
</td>
</tr>
<tr>
<td colspan="2">
<fieldset class="hikam_field"
id="hikamarket_order_products">
<?php
echo $this->loadTemplate('products');
?>
</fieldset>
</td>
</tr>
<tr>
<td colspan="2">
<?php
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
JFactory::getApplication()->triggerEvent('onAfterOrderProductsListingDisplay',
array(&$this->order, 'order_frontvendor_show'));
?>
</td>
</tr>
<?php if(hikamarket::acl('order/edit/history') &&
!empty($this->order->history)) { ?>
<tr>
<td colspan="2">
<fieldset class="hikam_field"
id="hikamarket_order_field_history">
<?php
echo $this->loadTemplate('history');
?>
</fieldset>
</td>
</tr>
<?php }?>
</table>
PK��[7j�AL"L"tmpl/show_products.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><legend><?php echo JText::_('PRODUCT_LIST');
?></legend>
<?php
$editProduct = false;
$showVendor = (hikamarket::level(1) &&
$this->order->order_type == 'sale' &&
$this->vendor->vendor_id <= 1);
if(hikamarket::acl('order/edit/products') &&
$this->vendor->vendor_id <= 1) {
$editProduct = true;
$url =
hikamarket::completeLink('product&task=selection&single=1&confirm=0&after=order|product_add&afterParams=order_id|'.$this->order->order_id,
true);
?>
<div class="hikam_edit"><?php
echo $this->popup->display(
'<img src="'. HIKAMARKET_IMAGES
.'icon-16/plus.png" alt=""/><span>'.
JText::_('HIKA_EDIT') .'</span>',
'HIKAM_ADD_ORDER_PRODUCT',
hikamarket::completeLink('order&task=product_add&order_id='.$this->order->order_id,
true),
'hikamarket_addproduct_popup',
750, 460, 'onclick="return
window.orderMgr.addProduct(this);"', '',
'link'
);
echo ' ';
echo $this->popup->display(
'<img src="'. HIKAMARKET_IMAGES
.'icon-16/product.png" alt=""/><span>'.
JText::_('HIKA_EDIT') .'</span>',
'HIKAM_ADD_ORDER_PRODUCT',
hikamarket::completeLink('product&task=selection&single=1&confirm=0&after=order|product_add&afterParams=order_id|'.$this->order->order_id,
true),
'hikamarket_selectproduct_popup',
750, 460, 'onclick="return
window.orderMgr.selectProduct(this);"', '',
'link'
);
?></div>
<script type="text/javascript">
<!--
window.orderMgr.addProduct = function(el) {
window.hikamarket.submitFct = function(data) {
var d = document, o = window.Oby;
o.xRequest('<?php echo
hikamarket::completeLink('order&task=show&subtask=products&cid='.$this->order->order_id,
true); ?>', {update: 'hikamarket_order_products'});
window.orderMgr.updateAdditionals();
window.orderMgr.updateHistory();
window.hikashop.closeBox();
};
window.hikashop.openBox(el);
return false;
}
window.orderMgr.selectProduct = function(el) {
window.hikamarket.submitFct = function(data) {
var d = document, o = window.Oby;
o.xRequest('<?php echo
hikamarket::completeLink('order&task=show&subtask=products&cid='.$this->order->order_id,
true); ?>', {update: 'hikamarket_order_products'});
window.orderMgr.updateAdditionals();
window.orderMgr.updateHistory();
window.hikashop.closeBox();
};
window.hikashop.openBox(el);
return false;
}
//-->
</script>
<?php
}
?>
<table class="hikam_listing <?php echo
(HIKASHOP_RESPONSIVE)?'table table-striped
table-hover':'hikam_table'; ?>"
id="hikamarket_order_product_listing"
style="width:100%">
<thead>
<tr>
<th class="hikamarket_order_item_name_title
title"><?php echo JText::_('PRODUCT');
?></th>
<th class="hikamarket_order_item_price_title
title"><?php echo JText::_('UNIT_PRICE');
?></th>
<th class="hikamarket_order_item_quantity_title
title"><?php echo JText::_('PRODUCT_QUANTITY');
?></th>
<th class="hikamarket_order_item_total_price_title
title"><?php echo JText::_('PRICE'); ?></th>
<?php if($showVendor){ ?>
<th class="hikamarket_order_item_vendor_title
title"><?php echo JText::_('HIKA_VENDOR');
?></th>
<?php } ?>
<?php if($editProduct){ ?>
<th colspan="2"
class="hikamarket_order_item_remove_title title"><?php echo
JText::_('ACTIONS'); ?></th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
foreach($this->order->products as $k => $product) {
$td_class = '';
if(!empty($product->order_product_option_parent_id))
$td_class = ' hikamarket_order_item_option';
?>
<tr>
<td class="hikamarket_order_item_name_value<?php echo
$td_class; ?>">
<?php
if(!empty($product->product_id)) {
?>
<a onclick="return window.orderMgr.showProduct(this);"
href="<?php echo
hikamarket::completeLink('shop.product&task=show&cid='.$product->product_id,
true); ?>"><?php
echo $product->order_product_name;
?></a>
<?php
} else {
echo $product->order_product_name;
}
?>
<br/><?php
echo $product->order_product_code;
if(hikashop_level(2) &&
!empty($this->fields['item'])) {
?> <p
class="hikamarket_order_product_custom_item_fields">
<?php
foreach($this->fields['item'] as $field) {
$namekey = $field->field_namekey;
if(empty($product->$namekey) &&
!strlen($product->$namekey))
continue;
echo '<p
class="hikamarket_order_item_'.$namekey.'">' .
$this->fieldsClass->trans($field->field_realname) . ':
' . $this->fieldsClass->show($field,$product->$namekey) .
'</p>';
}
?>
</p>
<?php
}
?>
</td>
<td class="hikamarket_order_item_price_value"><?php
echo
$this->currencyHelper->format($product->order_product_price,
$this->order->order_currency_id);
if(bccomp($product->order_product_tax,0,5)) {
echo '<br/>'.JText::sprintf('PLUS_X_OF_VAT',
$this->currencyHelper->format($product->order_product_tax,
$this->order->order_currency_id));
}
?></td>
<td
class="hikamarket_order_item_quantity_value"><?php echo
$product->order_product_quantity;?></td>
<td
class="hikamarket_order_item_total_price_value"><?php echo
$this->currencyHelper->format($product->order_product_total_price,
$this->order->order_currency_id);?></td>
<?php if($showVendor) { ?>
<td class="hikamarket_order_item_vendor_value"><?php
if(!empty($product->vendor_data) &&
(int)$product->vendor_data->vendor_id > 1) {
echo
$product->vendor_data->vendor_name.'<br/>'.
$this->currencyHelper->format($product->vendor_data->order_product_vendor_price,
$this->order->order_currency_id);
} else
echo '-';
?></td>
<?php } ?>
<?php if($editProduct){ ?>
<td class="hikamarket_order_item_edit_value"
style="text-align:center">
<a onclick="return window.orderMgr.setProduct(this);"
href="<?php
echo
hikamarket::completeLink('order&task=edit&subtask=products&order_id='.$this->order->order_id.'&order_product_id='.$product->order_product_id,
true);
?>"><img src="<?php echo
HIKAMARKET_IMAGES?>icon-16/edit.png" alt="<?php echo
JText::_('HIKA_EDIT'); ?>"/></a>
</td>
<td class="hikamarket_order_item_remove_value"
style="text-align:center">
<a onclick="return window.orderMgr.delProduct(this, <?php
echo $product->order_product_id; ?>);" href="<?php echo
hikamarket::completeLink('order&task=product_delete&order_id='.$this->order->order_id.'&order_product_id='.$product->order_product_id);
?>"><img src="<?php echo
HIKAMARKET_IMAGES?>icon-16/delete.png" alt="<?php echo
JText::_('HIKA_DELETE'); ?>"/></a>
</td>
<?php } ?>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
echo $this->popup->display(
'',
'HIKAM_SHOW_ORDER_PRODUCT',
hikamarket::completeLink('shop.product&task=show&cid=0',
true),
'hikamarket_showproduct_popup',
750, 460, 'style="display:none;"', '',
'link'
);
?>
<script type="text/javascript">
<!--
window.orderMgr.showProduct = function(el) {
window.hikamarket.submitFct = function(data) { window.hikashop.closeBox();
};
window.hikashop.openBox('hikamarket_showproduct_popup',
el.getAttribute('href'));
return false;
}
</script>
<?php
if($editProduct) {
echo $this->popup->display(
'',
'HIKAM_MODIFY_ORDER_PRODUCT',
hikamarket::completeLink('order&task=edit&subtask=products&order_id='.$this->order->order_id.'&order_product_id=0',
true),
'hikamarket_editproduct_popup',
550, 350, 'style="display:none;"', '',
'link'
);
?>
<script type="text/javascript">
<!--
window.orderMgr.setProduct = function(el) {
window.hikamarket.submitFct = function(data) {
var w = window, o = w.Oby;
w.hikashop.closeBox();
o.xRequest('<?php echo
hikamarket::completeLink('order&task=show&subtask=products&cid='.$this->order->order_id,
true); ?>', {update: 'hikamarket_order_products'},
function() {
window.orderMgr.updateAdditionals();
window.orderMgr.updateHistory();
});
};
window.hikashop.openBox('hikamarket_editproduct_popup',
el.getAttribute('href'));
return false;
}
window.orderMgr.delProduct = function(el, id) {
if(confirm("<?php echo
JText::_('HIKAM_CONFIRM_DELETE_ORDER_PRODUCT'); ?>")) {
var w = window, o = w.Oby;
el.parentNode.innerHTML = '<img src="<?php echo
HIKAMARKET_IMAGES?>icon-16/loading.gif"
alt="loading..."/>';
o.xRequest('<?php echo
hikamarket::completeLink('order&task=product_delete&order_id='.$this->order->order_id.'&order_product_id=HKMPRODID',
true, false, true); ?>'.replace('HKMPRODID',id), {update:
'hikamarket_order_products'}, function() {
window.orderMgr.updateAdditionals();
window.orderMgr.updateHistory();
});
}
return false;
}
//-->
</script>
<?php
}
PK��[��L��@�@tmpl/show_vendor.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div class="hikamarket_order">
<h2 style="display:inline-block"><?php
echo JText::sprintf('HIKAM_ORDER',
$this->order->order_number);
?></h2>
<span id="hikamarket_order_status"
style="margin-left:7px;font-size:1.2em;line-height:1.3em;"
class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$this->order->order_status));
?>"><?php echo
hikamarket::orderStatus($this->order->order_status);
?></span>
<!-- GENERAL -->
<dl class="hikam_options large">
<?php if(empty($this->order->order_invoice_created) ||
$this->order->order_invoice_created !=
$this->order->order_created) { ?>
<dt
class="hikamarket_order_created"><label><?php echo
JText::_('DATE_ORDER_CREATED');?></label></dt>
<dd class="hikamarket_order_created"><?php echo
hikamarket::getDate($this->order->order_created, '%Y-%m-%d
%H:%M'); ?></dd>
<?php } ?>
<dt
class="hikamarket_order_invoicenumber"><label><?php
echo JText::_('INVOICE_NUMBER'); ?></label></dt>
<dd
class="hikamarket_order_invoicenumber"><span><?php
echo @$this->order->order_invoice_number;
?></span></dd>
<?php if(!empty($this->order->order_invoice_created)) { ?>
<dt
class="hikamarket_order_created"><label><?php echo
JText::_('DATE_ORDER_PAID');?></label></dt>
<dd class="hikamarket_order_created"><?php echo
hikamarket::getDate($this->order->order_invoice_created,
'%Y-%m-%d %H:%M');?></dd>
<?php } ?>
</dl>
<!-- ADDITIONAL -->
<h3><?php echo
JText::_('ORDER_DETAILS')?></h3>
<dl class="hikam_options large">
<dt
class="hikamarket_order_additional_subtotal"><label><?php
echo JText::_('SUBTOTAL'); ?></label></dt>
<dd
class="hikamarket_order_additional_subtotal"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_subtotal,
$this->order->order_currency_id);
else
echo
$this->currencyHelper->format($this->order->order_subtotal_no_vat,
$this->order->order_currency_id);
?></span></dd>
<?php if(!empty($this->order->order_discount_code) ||
bccomp($this->order->order_discount_price, 0, 5) !== 0) { ?>
<dt
class="hikamarket_order_additional_coupon"><label><?php
echo JText::_('HIKASHOP_COUPON'); ?></label></dt>
<dd
class="hikamarket_order_additional_coupon"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_discount_price
* -1.0, $this->order->order_currency_id);
else
echo
$this->currencyHelper->format(($this->order->order_discount_price
- @$this->order->order_discount_tax) * -1.0,
$this->order->order_currency_id);
?> <span class="label label-default"><?php echo
$this->order->order_discount_code;
?></span></span></dd>
<?php } ?>
<!-- Shipping -->
<?php if(!empty($this->order->order_shipping_id) ||
bccomp($this->order->order_shipping_price, 0, 5) !== 0) { ?>
<dt
class="hikamarket_order_additional_shipping"><label><?php
echo JText::_('SHIPPING'); ?></label></dt>
<dd
class="hikamarket_order_additional_shipping"><span><?php
if($this->shopConfig->get('price_with_tax'))
echo
$this->currencyHelper->format($this->order->order_shipping_price,
$this->order->order_currency_id);
else
echo
$this->currencyHelper->format($this->order->order_shipping_price
- @$this->order->order_shipping_tax,
$this->order->order_currency_id);
?> <span class="hk-label hk-label-blue"><?php
if(empty($this->order->shipping_name))
echo
'<em>'.JText::_('HIKA_NONE').'</em>';
else if(is_string($this->order->shipping_name))
echo $this->order->shipping_name;
else
echo implode('</span> <span class="hk-label
hk-label-blue">', $this->order->shipping_name);
?></span></dd>
<?php
}
?>
<!-- Payment -->
<?php if(!empty($this->order->order_payment_id) ||
bccomp($this->order->order_payment_price, 0, 5) !== 0) { ?>
<dt
class="hikamarket_order_additional_payment"><label><?php
echo JText::_('HIKASHOP_PAYMENT');
?></label></dt>
<dd
class="hikamarket_order_additional_payment"><span><?php
echo
$this->currencyHelper->format($this->order->order_payment_price,
$this->order->order_currency_id);
?> <span class="hk-label hk-label-blue"><?php echo
@$this->order->payment_name; ?></span></dd>
<?php
}
?>
<!-- Additional -->
<?php
if(!empty($this->order->additional)) {
foreach($this->order->additional as $additional) {
?>
<dt
class="hikamarket_order_additional_additional"><label><?php
echo JText::_($additional->order_product_name);
?></label></dt>
<dd
class="hikamarket_order_additional_additional"><span><?php
if(!empty($additional->order_product_price))
$additional->order_product_price =
(float)$additional->order_product_price;
if(!empty($additional->order_product_price) ||
empty($additional->order_product_options))
echo
$this->currencyHelper->format($additional->order_product_price,
$this->order->order_currency_id);
else
echo $additional->order_product_options;
?></span></dd>
<?php
}
}
?>
<!-- Taxes -->
<?php
if($this->shopConfig->get('detailed_tax_display')
&& !empty($this->order->order_tax_info)) {
foreach($this->order->order_tax_info as $tax){
?>
<dt
class="hikamarket_order_additional_tax"><label><?php
echo $tax->tax_namekey; ?></label></dt>
<dd
class="hikamarket_order_additional_tax"><span><?php
echo
$this->currencyHelper->format($tax->tax_amount,$this->order->order_currency_id);
?></span></dd>
<?php
}
}
?>
<!-- Total -->
<dt
class="hikamarket_order_additional_total"><label><?php
if((int)$this->order->order_vendor_id <= 1)
echo JText::_('HIKASHOP_TOTAL');
else
echo JText::_('HIKAM_USER_TOTAL');
?></label></dt>
<dd
class="hikamarket_order_additional_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_full_price,
$this->order->order_currency_id); ?></span></dd>
<?php
if((int)$this->order->order_vendor_id > 1) {
$fixed_fees = 0.0;
if(!empty($this->order->order_vendor_params->fees->fixed)) {
foreach($this->order->order_vendor_params->fees->fixed as
$fixed_fee) {
$fixed_fees += $fixed_fee;
}
}
if(bccomp($fixed_fees, 0, 5) !== 0) {
?>
<!-- Vendor fixed fees -->
<dt
class="hikamarket_order_vendor_fixed_fees"><label><?php
echo JText::_('HIKAM_VENDOR_FIXED_FEES');
?></label></dt>
<dd
class="hikamarket_order_vendor_fixed_fees"><span><?php
echo $this->currencyHelper->format($fixed_fees,
$this->order->order_currency_id);
?></span></dd>
<?php
}
if(!empty($this->order->order_vendor_params->fees->shipping))
{
?>
<!-- Vendor shipping fees -->
<dt
class="hikamarket_order_vendor_shipping_fees"><label><?php
echo JText::_('HIKAM_VENDOR_SHIPPING_FEES');
?></label></dt>
<dd
class="hikamarket_order_vendor_shipping_fees"><span><?php
echo
$this->currencyHelper->format($this->order->order_vendor_params->fees->shipping,
$this->order->order_currency_id);
?></span></dd>
<?php
}
if($this->order->order_vendor_paid > 0) {
$total = $this->order->order_vendor_price;
$paid = $this->order->order_vendor_price;
if(!empty($this->order->refunds)) {
foreach($this->order->refunds as $refund) {
$total += (float)hikamarket::toFloat($refund->order_vendor_price);
if($refund->order_vendor_paid > 0)
$paid += (float)hikamarket::toFloat($refund->order_vendor_price);
}
}
?>
<!-- Vendor total -->
<dt
class="hikamarket_order_vendor_paid"><label><?php
echo JText::_('VENDOR_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_vendor_paid"><span><?php
echo $this->currencyHelper->format($total,
$this->order->order_currency_id);
if($total == $paid)
echo ' ' .
hikamarket::tooltip(JText::_('HIKAM_ORDER_IS_PAID'),
'', '', '<img
src="'.HIKAMARKET_IMAGES.'icon-16/save2.png"
style="vertical-align:top;"
alt="('.JText::_('PAID').')" />',
'', 0);
?></span></dd>
<?php
} else {
?>
<!-- Vendor total -->
<dt
class="hikamarket_order_vendor_total"><label><?php
echo JText::_('VENDOR_TOTAL'); ?></label></dt>
<dd
class="hikamarket_order_vendor_total"><span><?php
echo
$this->currencyHelper->format($this->order->order_vendor_price,
$this->order->order_currency_id);
?></span></dd>
<?php
}
?>
<?php } ?>
</dl>
<?php
if(!empty($this->fields['order']) &&
hikamarket::acl('order/show/customfields')) {
?>
<dl class="hikam_options large">
<?php
foreach($this->fields['order'] as $fieldName =>
$oneExtraField) {
?>
<dt class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><?php echo
$this->fieldsClass->getFieldName($oneExtraField);?></dt>
<dd class="hikamarket_order_additional_customfield
hikamarket_order_additional_customfield_<?php echo $fieldName;
?>"><span><?php
echo $this->fieldsClass->show($oneExtraField,
@$this->order->$fieldName);
?></span></dd>
<?php
}
?>
</dl>
<?php
}
?>
<!-- CUSTOMER -->
<?php if(hikamarket::acl('order/show/customer')){ ?>
<h3><?php echo JText::_('CUSTOMER')?></h3>
<dl class="hikam_options large">
<dt
class="hikamarket_order_customer_name"><label><?php
echo JText::_('HIKA_NAME');?></label></dt>
<dd class="hikamarket_order_customer_name"><span
id="hikamarket_order_customer_name"><?php echo
@$this->order->customer->name; ?></span></dd>
<dt
class="hikamarket_order_customer_email"><label><?php
echo JText::_('HIKA_EMAIL');?></label></dt>
<dd class="hikamarket_order_customer_email"><span
id="hikamarket_order_customer_email"><?php echo
@$this->order->customer->user_email;
?></span></dd>
</dl>
<?php } ?>
<!-- ADDRESSES -->
<?php
if(hikamarket::acl('order/show/billingaddress') ||
hikamarket::acl('order/show/shippingaddress')) {
$acl_billing = hikamarket::acl('order/show/billingaddress');
$acl_shipping = hikamarket::acl('order/show/shippingaddress');
$row_class = '';
$cell_class = '';
if($acl_billing && $acl_shipping) {
$row_class = 'hk-row-fluid';
$cell_class = 'hkc-md-6';
}
?>
<div class="<?php echo $row_class; ?>
hikamarket_order_addresses">
<?php if($acl_billing) { ?>
<div class="<?php echo $cell_class; ?>
hikamarket_order_billing_address">
<h3><?php echo
JText::_('HIKASHOP_BILLING_ADDRESS')?></h3>
<?php
echo
$this->addressClass->maxiFormat($this->addresses[(int)$this->order->order_billing_address_id],
$this->address_fields, true);
?>
</div>
<?php } ?>
<?php if($acl_shipping) { ?>
<div class="<?php echo $cell_class; ?>
hikamarket_order_shipping_address">
<h3><?php echo
JText::_('HIKASHOP_SHIPPING_ADDRESS')?></h3>
<?php
if(empty($this->order->override_shipping_address))
echo
$this->addressClass->maxiFormat($this->addresses[(int)$this->order->order_shipping_address_id],
$this->address_fields, true);
else
echo $this->order->override_shipping_address;
?>
</div>
<?php } ?>
</div>
<?php } ?>
<!-- PRODUCTS -->
<h3><?php echo
JText::_('PRODUCT_LIST')?></h3>
<table class="hikam_listing <?php echo
(HIKASHOP_RESPONSIVE)?'table table-striped table-hover
table-bordered':'hikam_table'; ?>"
id="hikamarket_order_product_listing"
style="width:100%">
<thead>
<tr>
<th class="hikamarket_order_item_name_title
title"><?php echo JText::_('PRODUCT');
?></th>
<th class="hikamarket_order_item_price_title
title"><?php echo JText::_('UNIT_PRICE');
?></th>
<th class="hikamarket_order_item_quantity_title
title"><?php echo JText::_('PRODUCT_QUANTITY');
?></th>
<th class="hikamarket_order_item_total_price_title
title"><?php echo JText::_('PRICE'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach($this->order->products as $k => $product) {
$td_class = '';
if(!empty($product->order_product_option_parent_id))
$td_class = ' hikamarket_order_item_option';
?>
<tr>
<td class="hikamarket_order_item_name_value<?php echo
$td_class; ?>"><?php
if(!empty($product->product_id)) {
?>
<a onclick="return window.orderMgr.showProduct(this);"
data-popup-href="<?php echo
hikamarket::completeLink('shop.product&task=show&cid='.$product->product_id,
true); ?>" href="<?php echo
hikamarket::completeLink('shop.product&task=show&cid='.$product->product_id);
?>"><?php
if(!empty($product->images)) {
$img = reset($product->images);
$thumb = $this->imageHelper->getThumbnail(@$img->file_path,
array(50,50), array('default' => 1, 'forcesize'
=> 1));
if(!empty($thumb->path))
echo '<img src="'.
$this->imageHelper->uploadFolder_url . str_replace('\\',
'/', $thumb->path).'" alt=""
class="hikam_imglist" />';
}
echo $product->order_product_name;
?></a>
<?php
} else {
echo $product->order_product_name;
}
?></td>
<td class="hikamarket_order_item_price_value"><?php
echo
$this->currencyHelper->format($product->order_product_price,
$this->order->order_currency_id);
if(bccomp($product->order_product_tax, 0, 5))
echo '<br/>'.JText::sprintf('PLUS_X_OF_VAT',
$this->currencyHelper->format($product->order_product_tax,
$this->order->order_currency_id));
?></td>
<td
class="hikamarket_order_item_quantity_value"><?php
echo (int)$product->order_product_quantity;
?></td>
<td
class="hikamarket_order_item_total_price_value"><?php
echo
$this->currencyHelper->format($product->order_product_total_price,
$this->order->order_currency_id);
?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
echo $this->popup->display(
'',
'HIKAM_SHOW_ORDER_PRODUCT',
hikamarket::completeLink('shop.product&task=show&cid=0',
true),
'hikamarket_showproduct_popup',
750, 460, 'style="display:none;"', '',
'link'
);
?>
<!-- OTHER COMPONENTS -->
<?php
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
JFactory::getApplication()->triggerEvent('onAfterOrderProductsListingDisplay',
array(&$this->order, 'order_frontvendor_vendor_show'));
?>
<!-- HISTORY -->
<?php if(hikamarket::acl('order/show/history') &&
!empty($this->order->history)) { ?>
<h3><?php echo JText::_('HISTORY')?></h3>
<div class="hikamarket_history_container">
<table id="hikamarket_order_history_listing"
class="hikam_listing hikam_table table table-striped
table-hover">
<thead>
<tr>
<th class="title"><?php echo
JText::_('HIKA_TYPE'); ?></th>
<th class="title"><?php echo
JText::_('ORDER_STATUS'); ?></th>
<th class="title"><?php echo
JText::_('REASON'); ?></th>
<th class="title"><?php echo
JText::_('DATE'); ?></th>
</tr>
</thead>
<tbody>
<?php
$userClass = hikamarket::get('shop.class.user');
foreach($this->order->history as $k => $history) {
?>
<tr>
<td><?php
$val =
preg_replace('#[^a-z0-9]#i','_',strtoupper($history->history_type));
$trans = JText::_($val);
if($val != $trans)
$history->history_type = $trans;
echo $history->history_type;
?></td>
<td><?php
echo hikamarket::orderStatus($history->history_new_status);
?></td>
<td><?php
echo $history->history_reason;
?></td>
<td><?php
echo hikamarket::getDate($history->history_created,'%Y-%m-%d
%H:%M');
?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php } ?>
</div>
<script type="text/javascript">
<!--
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.showProduct = function(el) {
window.hikashop.submitFct = function(data) { window.hikashop.closeBox();
};
var href = el.getAttribute('data-popup-href');
if(!href)
href = el.getAttribute('href');
window.hikashop.openBox('hikamarket_showproduct_popup', href);
return false;
};
window.orderMgr.editOrderStatus = function(el) {
window.hikamarket.submitFct = function(data) {
var orderstatus =
document.getElementById('hikamarket_order_status');
if(orderstatus) {
orderstatus.innerHTML = data.name;
orderstatus.className = 'order-label order-label-' +
data.order_status.replace(/[^a-z_0-9]/i, '_');
}
window.hikamarket.closeBox();
};
var href = el.getAttribute('href');
if(href == '' || href == null || href == '#')
href = null;
window.hikamarket.openBox('hikamarket_order_status_popup',
href);
return false;
};
// -->
</script>
PK��[B��
�
tmpl/status.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><form action="<?php echo
hikamarket::completeLink('order&task=save&cid='.$this->order->order_id);
?>" method="post" name="adminForm"
id="adminForm">
<dl class="hikam_options">
<dt><?php echo JText::_('ORDER_STATUS');
?></dt>
<dd><span class="order-label order-label-<?php echo
preg_replace('#[^a-z_0-9]#i', '_', str_replace('
','_',$this->order->order_status));
?>"><?php
echo hikamarket::orderStatus($this->order->order_status);
?></span></dd>
<dt><?php echo JText::_('ORDER_NEW_STATUS');
?></dt>
<dd><?php
echo
$this->order_status->display('order[general][order_status]',
$this->order->order_status,
'onchange="window.orderMgr.status_changed(this);"',
false, @$this->order_status_filters);
?></dd>
<?php
if(($this->vendor->vendor_id == 0 || $this->vendor->vendor_id
== 1) && hikamarket::acl('order/edit/notify')) {
?>
<dt id="hikamarket_order_notify_lbl"
style="display:none;"
class="hikamarket_order_notify"><label
for="order[notify]"><?php echo
JText::_('NOTIFICATION'); ?></label></dt>
<dd id="hikamarket_order_notify_val"
style="display:none;"
class="hikamarket_order_notify"><input
type="checkbox" id="order[notify]" value="1"
name="order[notify]"/><label
style="display:inline-block"
for="order[notify]"><?php echo
JText::_('NOTIFY_CUSTOMER'); ?></label></dd>
<?php
}
?>
</dl>
<script type="text/javascript">
if(!window.orderMgr)
window.orderMgr = {};
window.orderMgr.status_changed = function(el) {
var fields = ['hikamarket_order_notify_lbl',
'hikamarket_order_notify_val'], displayValue = '';
if(el.value == '<?php echo $this->order->order_status;
?>')
displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
};
window.orderMgr.general_history_changed = function(el) {
var fields = ['hikamarket_history_general_msg'], displayValue =
'';
if(!el.checked) displayValue = 'none';
window.hikamarket.setArrayDisplay(fields, displayValue);
};
</script>
<input type="hidden" name="closepopup"
value="1"/>
<input type="hidden" name="cid"
value="<?php echo (int)$this->order->order_id; ?>"
/>
<input type="hidden" name="option"
value="<?php echo HIKAMARKET_COMPONENT; ?>" />
<input type="hidden" name="task"
value="save" />
<input type="hidden" name="ctrl"
value="order" />
<?php if(hikaInput::get()->getCmd('tmpl', '') !=
'') { ?>
<input type="hidden" name="tmpl"
value="<?php echo
$this->escape(hikaInput::get()->getCmd('tmpl'));
?>" />
<?php } ?>
<?php echo JHTML::_('form.token'); ?>
</form>
PK��[HL�,��
view.html.phpnu�[���<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class ordermarketViewordermarket extends HikamarketView {
protected $ctrl = 'order';
protected $icon = 'order';
protected $triggerView = true;
public function display($tpl = null, $params = array()) {
$this->params =& $params;
$fct = $this->getLayout();
if(method_exists($this, $fct) && $this->$fct($tpl) === false)
return false;
parent::display($tpl);
}
public function listing($tpl = null) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$this->paramBase =
HIKAMARKET_COMPONENT.'.'.$this->getName().'.listing';
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid='&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$this->loadRef(array(
'toggleClass' => 'helper.toggle',
'paymentType' => 'type.paymentmethods',
'orderStatusType' => 'type.order_status',
'addressClass' => 'class.address',
'currencyHelper' => 'shop.class.currency',
'shopAddressClass' => 'shop.class.address',
'fieldClass' => 'shop.class.field',
'searchType' => 'type.search',
));
$filterType =
$app->getUserStateFromRequest($this->paramBase.'.filter_type',
'filter_type', 0, 'int');
$cfg = array(
'table' => 'shop.order',
'main_key' => 'order_id',
'order_sql_value' => 'hkorder.order_id'
);
$pageInfo = $this->getPageInfo($cfg['order_sql_value'],
'desc');
$pageInfo->filter->filter_status =
$app->getUserStateFromRequest($this->paramBase.'.filter_status',
'filter_status', '', 'string');
$pageInfo->filter->filter_payment =
$app->getUserStateFromRequest($this->paramBase.'.filter_payment',
'filter_payment', '', 'string');
$pageInfo->filter->filter_user =
$app->getUserStateFromRequest($this->paramBase.'.filter_user',
'filter_user', '', 'string');
$filters = array();
$searchMap = array(
'hkorder.order_id',
'hkorder.order_number',
'hkuser.user_email'
);
$orderingAccept = array('hkorder.','hkuser.');
$order = '';
$fields = array();
if(hikashop_level(2)) {
$null = null;
$fields =
$this->fieldClass->getFields('display:vendor_order_listing=1',
$null, 'order');
foreach($fields as $field) {
if($field->field_type == 'customtext')
continue;
$searchMap[] = 'hkorder.'.$field->field_namekey;
}
}
$this->assignRef('fields', $fields);
if(!empty($pageInfo->filter->filter_status))
$filters['order_status'] = 'hkorder.order_status = '
. $db->Quote($pageInfo->filter->filter_status);
if(!empty($pageInfo->filter->filter_payment))
$filters['order_payment_id'] = 'hkorder.order_payment_id
= ' . (int)$pageInfo->filter->filter_payment;
if(!empty($pageInfo->filter->filter_user) &&
(int)$pageInfo->filter->filter_user > 0)
$filters['order_user_id'] = 'hkorder.order_user_id =
' . (int)$pageInfo->filter->filter_user;
if($vendor->vendor_id > 1) {
$filters['order_vendor_id'] = 'hkorder.order_vendor_id =
' . $vendor->vendor_id;
$filters['order_type'] = 'hkorder.order_type IN (' .
$db->Quote('subsale') . ',' .
$db->Quote('sale') . ')';
} else {
$filters['order_vendor_id'] = '(hkorder.order_vendor_id =
0 OR hkorder.order_vendor_id = 1)';
$filters['order_type'] = 'hkorder.order_type = ' .
$db->Quote('sale');
}
$extrafilters = array();
$joins = array();
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
$app->triggerEvent('onBeforeOrderListing',
array($this->paramBase, &$extrafilters, &$pageInfo,
&$filters, &$joins, &$searchMap));
$this->assignRef('extrafilters', $extrafilters);
$this->processFilters($filters, $order, $searchMap, $orderingAccept);
$query = 'FROM
'.hikamarket::table($cfg['table']).' AS hkorder
'.
' LEFT JOIN '.hikamarket::table('shop.user').'
AS hkuser ON hkorder.order_user_id = hkuser.user_id '.
implode(' ', $joins).' '.$filters.$order;
$db->setQuery('SELECT hkorder.*, hkuser.* '.$query,
(int)$pageInfo->limit->start, (int)$pageInfo->limit->value);
if(empty($pageInfo->search)) {
$query = 'FROM
'.hikamarket::table($cfg['table']).' AS hkorder
'.$filters;
}
$orders = $db->loadObjectList('order_id');
$db->setQuery('SELECT COUNT(*) '.$query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $db->loadResult();
$pageInfo->elements->page = count($orders);
$this->assignRef('orders', $orders);
if(hikashop_level(2)) {
$this->fieldClass->handleZoneListing($fields, $orders);
}
$this->display_shipping =
(bool)$shopConfig->get('force_shipping', 1);
$addresses = null;
$address_fields = null;
$payments = array();
if(!empty($orders)) {
$query = 'SELECT DISTINCT a.* '.
' FROM ' . hikamarket::table('shop.address') .
' AS a '.
' INNER JOIN ' . hikamarket::table('shop.order') .
' AS o ON (a.address_id = o.order_billing_address_id OR a.address_id =
o.order_shipping_address_id) ' .
' WHERE o.order_id IN (' . implode(',',
array_keys($orders)) . ')';
$db->setQuery($query);
$addresses = $db->loadObjectList('address_id');
$this->shopAddressClass->loadZone($addresses);
$shopPluginClass = hikamarket::get('shop.class.plugins');
$paymentMethods = $shopPluginClass->getMethods('payment');
foreach($paymentMethods as $payment) {
$payments[$payment->payment_id] = $payment;
}
foreach($orders as &$order) {
$order->shipping_name = null;
if(empty($order->order_shipping_method) &&
empty($order->order_shipping_id))
continue;
$this->display_shipping = true;
if(!empty($order->order_shipping_method)) {
if(!is_numeric($order->order_shipping_id))
$order->shipping_name =
$this->getShippingName($order->order_shipping_method,
$order->order_shipping_id);
else
$order->shipping_name = $this->getShippingName(null,
$order->order_shipping_id);
} else {
$order->shipping_name = array();
$shipping_ids = explode(';', $order->order_shipping_id);
foreach($shipping_ids as $shipping_id) {
$order->shipping_name[] = $this->getShippingName(null,
$shipping_id);
}
if(count($order->shipping_name) == 1)
$order->shipping_name = reset($order->shipping_name);
}
}
unset($order);
}
$this->assignRef('addresses', $addresses);
$this->assignRef('address_fields', $address_fields);
$this->assignRef('payments', $payments);
$this->order_stats = null;
if($config->get('display_order_statistics', 0)) {
if($vendor->vendor_id > 1) {
$query = 'SELECT o.order_status, COUNT(o.order_id) as `total` FROM
'.hikamarket::table('shop.order').' AS o WHERE
o.order_type = \'subsale\' AND o.order_vendor_id =
'.(int)$vendor->vendor_id.' GROUP BY o.order_status';
} else {
$query = 'SELECT o.order_status, COUNT(o.order_id) as `total` FROM
'.hikamarket::table('shop.order').' AS o WHERE
o.order_type = \'sale\' GROUP BY o.order_status';
}
$db->setQuery($query);
$this->order_stats =
$db->loadObjectList('order_status');
ksort($this->order_stats);
}
$text_asc = JText::_('ASCENDING');
$text_desc = JText::_('DESCENDING');
$ordering_values = array(
'hkorder.order_id' => JText::_('SORT_ID'),
'hkorder.order_invoice_id' =>
JText::_('SORT_INVOICE'),
'hkorder.order_user_id' =>
JText::_('SORT_USER'),
'hkorder.order_created' =>
JText::_('SORT_CREATION'),
'hkorder.order_modified' =>
JText::_('SORT_MODIFICATION'),
'hkorder.order_full_price' =>
JText::_('SORT_PRICE'),
);
$this->ordering_values = array();
foreach($ordering_values as $k => $v) {
$this->ordering_values[$k.' asc'] = $v . ' '
.$text_asc;
$this->ordering_values[$k.' desc'] = $v . ' '
.$text_desc;
}
$this->full_ordering =
$this->pageInfo->filter->order->value . ' ' .
strtolower($this->pageInfo->filter->order->dir);
$this->toolbar = array(
'back' => array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_BACK'),
'url' => hikamarket::completeLink('vendor')
),
'report' => array(
'icon' => 'report',
'fa' => 'fa-bar-chart fa-chart-bar',
'name' => JText::_('HIKA_EXPORT'),
'url' =>
hikamarket::completeLink('order&task=export'),
'pos' => 'right',
'acl' => hikamarket::acl('order/export')
),
'new' => array(
'icon' => 'new',
'fa' => 'fa-plus-circle',
'name' => JText::_('HIKA_NEW'),
'url' =>
hikamarket::completeLink('order&task=create'),
'pos' => 'right',
'display' => ($vendor->vendor_id <= 1) ||
$config->get('vendor_edit_order', 0),
'acl' => hikamarket::acl('order/add')
),
'request' => array(
'icon' => 'pay',
'fa' => 'fa-money fa-money-bill-alt',
'name' => JText::_('HIKAM_PAYMENT_REQUEST'),
'url' =>
hikamarket::completeLink('order&task=request'),
'pos' => 'right',
'display' => ($vendor->vendor_id > 1),
'acl' => hikamarket::acl('order/request')
),
'payments' => array(
'icon' => 'pay',
'fa' => 'fa-list-alt',
'name' => JText::_('HIKAM_PAYMENT_LISTING'),
'url' =>
hikamarket::completeLink('order&task=payments'),
'pos' => 'right',
'display' => ($vendor->vendor_id > 1),
'acl' => hikamarket::acl('order/payments')
)
);
$this->getPagination();
$this->getOrdering('hkorder.ordering', !$filterType);
}
public function show($tpl = null, $toolbar = true) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$order_id = hikamarket::getCID('order_id', true);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$edit = hikaInput::get()->getCmd('task','') ==
'edit';
$this->assignRef('edit', $edit);
$address_mode = hikaInput::get()->getInt('address_mode',
0);
$this->assignRef('address_mode', $address_mode);
hikamarket::loadJslib('tooltip');
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid='&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$orderClass = hikamarket::get('shop.class.order');
$order = $orderClass->loadFullOrder($order_id, true, false);
if(!isset($order->hikamarket))
$order->hikamarket = new stdClass();
if(!empty($order) && $order->order_vendor_id !=
$vendor->vendor_id && ($vendor->vendor_id > 1 ||
($order->order_vendor_id > 1 &&
!hikamarket::acl('order/show/vendors')))) {
$order = null;
$app->enqueueMessage(JText::_('ORDER_ACCESS_FORBIDDEN'));
$app->redirect(hikamarket::completeLink('order'));
return false;
}
$editable_order = ($order->order_type === 'sale') &&
($vendor->vendor_id <= 1);
if($order->order_type === 'sale' &&
$vendor->vendor_id > 1 && (int)$order->order_vendor_id ==
$vendor->vendor_id &&
(int)$config->get('vendor_edit_order', 0) == 1) {
$editable_order = hikamarket::isEditableOrder($order_id,
$vendor->vendor_id);
}
$this->assignRef('editable_order', $editable_order);
if(empty($order->customer)) {
$userClass = hikamarket::get('shop.class.user');
$order->customer = $userClass->get($order->order_user_id);
}
if($order->order_type == 'sale') {
$filters = array(
'type' => 'o.order_type IN (' .
$db->Quote('subsale') . ', ' .
$db->Quote('vendorrefund') . ')',
'parent' => 'order_parent_id = ' .
(int)$order->order_id
);
$query = 'SELECT o.*, v.* FROM ' .
hikamarket::table('shop.order') . ' AS o ' .
' LEFT JOIN ' . hikamarket::table('vendor') .
' AS v ON o.order_vendor_id = v.vendor_id '.
' WHERE (' . implode(') AND (', $filters) . ')
' .
' ORDER BY v.vendor_id ASC, o.order_id ASC';
$db->setQuery($query);
$order->hikamarket->children =
$db->loadObjectList('order_id');
$refunds = false;
foreach($order->hikamarket->children as $d) {
if($d->order_type !== 'vendorrefund') {
$refunds = true;
break;
}
}
if($refunds) {
foreach($order->hikamarket->children as &$d) {
if($d->order_type !== 'subsale')
continue;
$m = false;
$total = (float)hikamarket::toFloat($d->order_vendor_price);
foreach($order->hikamarket->children as $o) {
if($o->order_type == 'vendorrefund' &&
$o->order_vendor_id == $d->order_vendor_id) {
$total += (float)hikamarket::toFloat($o->order_vendor_price);
$m = true;
}
}
if($m)
$d->order_vendor_price_with_refunds = $total;
}
unset($d);
}
}
if($order->order_type == 'subsale' &&
(int)$vendor->vendor_id <= 1) {
$vendorClass = hikamarket::get('class.vendor');
$order->hikamarket->vendor = $vendorClass->get(
(int)$order->order_vendor_id );
$query = 'SELECT order_number, order_invoice_number FROM ' .
hikamarket::table('shop.order') . ' WHERE order_id = '
. (int)$order->order_parent_id;
$db->setQuery($query);
$order->hikamarket->parent = $db->loadObject();
}
if(!empty($order->products)) {
$product_ids = array();
foreach($order->products as &$product) {
$product_ids[(int)$product->product_id] =
(int)$product->product_id;
$product->order_product_price =
(float)hikamarket::toFloat($product->order_product_price);
$product->order_product_tax =
(float)hikamarket::toFloat($product->order_product_tax);
$product->tax_rate = 0;
if($product->order_product_tax > 0 &&
$product->order_product_price != 0)
$product->tax_rate = $product->order_product_tax /
$product->order_product_price;
}
unset($product);
if($order->order_type == 'sale') {
$query = 'SELECT hkop.*, hko.order_vendor_id, hmv.vendor_name,
hmv.vendor_id '.
' FROM ' . hikamarket::table('shop.order_product')
. ' as hkop '.
' INNER JOIN ' . hikamarket::table('shop.order').
' AS hko ON hkop.order_id = hko.order_id '.
' LEFT JOIN ' . hikamarket::table('vendor').
' AS hmv ON hmv.vendor_id = hko.order_vendor_id '.
' WHERE hko.order_type = \'subsale\' AND
hko.order_parent_id = '. (int)$order->order_id .
' ORDER BY hko.order_id DESC';
$db->setQuery($query);
$vendorProducts = $db->loadObjectList();
foreach($order->products as &$product) {
$product->vendor_data = array();
foreach($vendorProducts as $vendorProduct) {
if((int)$vendorProduct->order_product_parent_id ==
$product->order_product_id) {
$product->vendor_data[] = $vendorProduct;
}
}
}
unset($product);
} elseif($order->order_type == 'subsale') {
$filters = array(
'f.file_ref_id IN ('.implode(',',
$product_ids).')',
'f.file_type = '.$db->quote('file')
);
$query = 'SELECT d.*, f.* '.
' FROM '.hikamarket::table('shop.file').' AS
f '.
' INNER JOIN
'.hikamarket::table('shop.download').' AS d ON
d.order_id = ' . (int)$order->order_parent_id . ' AND
f.file_id = d.file_id '.
' WHERE (' . implode(') AND
(',$filters).')'.
' ORDER BY f.file_ref_id ASC, f.file_ordering ASC, d.file_pos
ASC';
$db->setQuery($query);
$files = $db->loadObjectList();
foreach($files as $file) {
foreach($order->products as &$product) {
if(empty($product->files))
continue;
foreach($product->files as &$f) {
if((int)$f->file_id != (int)$file->file_id)
continue;
$f->download_number = $file->download_number;
$file->done = true;
break;
}
if($file->done)
break;
}
unset($product);
}
}
}
$this->assignRef('order', $order);
$rootCategory = 0;
$vendorCategories = 0;
$vendorClass = hikamarket::get('class.vendor');
$rootCategory = $vendorClass->getRootCategory($vendor);
$extra_categories = $vendorClass->getExtraCategories($vendor);
if(!empty($extra_categories))
$vendorCategories = array_merge(array($rootCategory),
$extra_categories);
if(empty($rootCategory))
$rootCategory = 1;
if(empty($vendorCategories))
$vendorCategories = $rootCategory;
$this->assignRef('rootCategory', $rootCategory);
$this->assignRef('vendorCategories', $vendorCategories);
$this->loadRef(array(
'toggleClass' => 'helper.toogle',
'currencyHelper' => 'shop.class.currency',
'payment' => 'shop.type.plugins',
'shipping' => 'shop.type.plugins',
'shippingClass' => 'shop.class.shipping',
'paymentClass' => 'shop.class.payment',
'fieldsClass' => 'shop.class.field',
'addressClass' => 'class.address',
'shopAddressClass' => 'shop.class.address',
'popup' => 'shop.helper.popup',
'order_status' => 'type.order_status',
'imageHelper' => 'shop.helper.image',
'dropdownHelper' => 'shop.helper.dropdown',
'nameboxType' => 'type.namebox',
'ratesType' => 'type.rates',
));
$this->payment->type = 'payment';
$this->shipping->type = 'shipping';
$fields = array();
if(!empty($order_id)) {
$order->order_discount_price =
(float)hikamarket::toFloat(@$order->order_discount_price);
$order->order_discount_tax =
(float)hikamarket::toFloat(@$order->order_discount_tax);
$order->order_discount_tax_rate = 0;
if(empty($order->order_discount_tax_namekey))
$order->order_discount_tax_namekey = '';
$order->order_payment_price =
(float)hikamarket::toFloat(@$order->order_payment_price);
$order->order_payment_tax =
(float)hikamarket::toFloat(@$order->order_payment_tax);
$order->order_payment_tax_rate = 0;
if(empty($order->order_payment_tax_namekey))
$order->order_payment_tax_namekey = '';
$order->order_shipping_price =
(float)hikamarket::toFloat(@$order->order_shipping_price);
$order->order_shipping_tax =
(float)hikamarket::toFloat(@$order->order_shipping_tax);
$order->order_shipping_tax_rate = 0;
if(empty($order->order_shipping_tax_namekey))
$order->order_shipping_tax_namekey = '';
$order->currency = $this->currencyHelper->get(
(int)$order->order_currency_id );
$order->fields =
$this->fieldsClass->getData('backend','address');
if(hikashop_level(2)) {
$fields['order'] =
$this->fieldsClass->getFields('display:vendor_order_show=1',
$order, 'order');
$null = null;
$fields['entry'] =
$this->fieldsClass->getFields('display:vendor_order_show=1',
$null, 'entry');
$fields['item'] =
$this->fieldsClass->getFields('display:vendor_order_show=1',
$null, 'item');
}
$query = 'SELECT * FROM
'.hikamarket::table('shop.history').' WHERE
history_order_id = '.(int)$order_id.' ORDER BY history_created
DESC';
$db->setQuery($query);
$order->history = $db->loadObjectList();
if(!empty($order->order_tax_info)) {
foreach($order->order_tax_info as $k => $v) {
if(isset($v->tax_amount_for_coupon) &&
empty($order->order_discount_tax_namekey)) {
$order->order_discount_tax_namekey = $k;
}
if(isset($v->tax_amount_for_payment) &&
empty($order->order_payment_tax_namekey)) {
$order->order_payment_tax_namekey = $k;
}
if(isset($v->tax_amount_for_shipping) &&
empty($order->order_shipping_tax_namekey)) {
$order->order_shipping_tax_namekey = $k;
}
}
}
if(!empty($order->order_discount_tax) &&
($order->order_discount_price - $order->order_discount_tax) != 0)
$order->order_discount_tax_rate = $order->order_discount_tax /
($order->order_discount_price - $order->order_discount_tax);
if(!empty($order->order_payment_tax) &&
($order->order_payment_price - $order->order_payment_tax) != 0)
$order->order_payment_tax_rate = $order->order_payment_tax /
($order->order_payment_price - $order->order_payment_tax);
if(!empty($order->order_shipping_tax) &&
($order->order_shipping_price - $order->order_shipping_tax) != 0)
$order->order_shipping_tax_rate = $order->order_shipping_tax /
($order->order_shipping_price - $order->order_shipping_tax);
if(!empty($order->order_payment_id)) {
if($order->order_type == 'subsale' &&
substr($order->order_payment_method, 0, 7) == 'market-')
$order->order_payment_method =
substr($order->order_payment_method, 7);
$order->payment_name = $order->order_payment_method . ' -
' . $order->order_payment_id;
$paymentMethod = $this->paymentClass->get(
(int)$order->order_payment_id );
if(!empty($paymentMethod->payment_name))
$order->payment_name = $paymentMethod->payment_name;
}
$order->shipping_name = null;
if(!empty($order->order_shipping_method)) {
if($order->order_type == 'subsale' &&
substr($order->order_shipping_method, 0, 7) == 'market-')
$order->order_shipping_method =
substr($order->order_shipping_method, 7);
if(!is_numeric($order->order_shipping_id))
$order->shipping_name =
$this->getShippingName($order->order_shipping_method,
$order->order_shipping_id);
else
$order->shipping_name = $this->getShippingName(null,
$order->order_shipping_id);
} else if(!empty($order->order_shipping_id)) {
$order->shipping_name = array();
$shipping_ids = explode(';', $order->order_shipping_id);
foreach($shipping_ids as $shipping_id) {
$order->shipping_name[] = $this->getShippingName(null,
$shipping_id);
}
if(count($order->shipping_name) == 1)
$order->shipping_name = reset($order->shipping_name);
}
if(!empty($order->order_vendor_params) &&
is_string($order->order_vendor_params))
$order->order_vendor_params =
hikamarket::unserialize($order->order_vendor_params);
if((int)$order->order_vendor_paid > 0) {
$query = 'SELECT * '.
' FROM ' . hikamarket::table('shop.order') .
' WHERE order_parent_id = ' . $order->order_parent_id .
' AND order_type = ' . $db->Quote('vendorrefund');
$db->setQuery($query);
$order->refunds = $db->loadObjectList();
foreach($order->refunds as $refund) {
if($refund->order_vendor_paid == 0)
$order->current_order_status = $refund->order_status;
}
}
$query = 'SELECT DISTINCT a.* '.
' FROM ' . hikamarket::table('shop.address') .
' AS a '.
' INNER JOIN ' . hikamarket::table('shop.order') .
' AS o ON (a.address_id = o.order_billing_address_id OR a.address_id =
o.order_shipping_address_id) ' .
' WHERE o.order_id = '.(int)$order->order_id;
$db->setQuery($query);
$addresses = $db->loadObjectList('address_id');
$this->assignRef('addresses', $addresses);
$address_fields = null;
$this->assignRef('address_fields', $address_fields);
$this->shopAddressClass->loadZone($addresses);
$bundles = array();
foreach($order->products as $p) {
if(empty($p->bundle))
continue;
foreach($p->bundle as $b) {
$bundles[(int)$b->product_id] = (int)$b->product_id;
}
}
if(!empty($bundles)) {
$filters = array(
'a.file_ref_id IN ('.implode(',',
$bundles).')',
'a.file_type = \'product\''
);
$query = 'SELECT a.* FROM
'.hikamarket::table('shop.file').' AS a WHERE
'.implode(' AND ',$filters).' ORDER BY file_ref_id ASC,
file_ordering ASC';
$db->setQuery($query);
$images = $db->loadObjectList();
if(!empty($images)) {
foreach($order->products as &$p) {
if(empty($p->bundle))
continue;
foreach($p->bundle as &$b) {
foreach($images as $image) {
if($b->product_id != $image->file_ref_id)
continue;
if(empty($b->images))
$b->images = array();
$b->images[] = $image;
}
}
unset($b);
}
unset($p);
}
}
}
$this->assignRef('fields',$fields);
if(empty($order->order_shipping_method) &&
!empty($order->shippings)) {
$this->loadRef(array(
'warehouseClass' => 'class.warehouse'
));
$order->shipping_data = array();
$shipping_ids = explode(';', $order->order_shipping_id);
$order->warehouses = array();
foreach($shipping_ids as $key) {
$shipping_data = '';
list($k, $w) = explode('@', $key);
$shipping_id = $k;
if(isset($order->shippings[$shipping_id])) {
$shipping = $order->shippings[$shipping_id];
$shipping_data = $shipping->shipping_name;
}
if(empty($shipping_data))
$shipping_data = $this->getShippingName(null, $shipping_id,
false);
if(empty($shipping_data)) {
foreach($order->products as $order_product) {
if($order_product->order_product_shipping_id != $key)
continue;
if(!is_numeric($order_product->order_product_shipping_id)) {
$shipping_data =
$this->getShippingName($order_product->order_product_shipping_method,
$shipping_id);
} else {
$shipping_method_data =
$this->shippingClass->get($shipping_id);
$shipping_data = $shipping_method_data->shipping_name;
}
break;
}
}
if(empty($shipping_data))
$shipping_data = '[ ' . $key . ' ]';
if(isset($order->order_shipping_params->prices[$key])) {
$price_params = $order->order_shipping_params->prices[$key];
if($this->shopConfig->get('price_with_tax'))
$shipping_data .= ' (' .
$this->currencyHelper->format($price_params->price_with_tax,
$order->order_currency_id) . ')';
else
$shipping_data .= ' (' .
$this->currencyHelper->format($price_params->price_with_tax -
@$price_params->tax, $order->order_currency_id) . ')';
}
$order->shipping_data[] = $shipping_data;
$order->warehouses[$key] = $this->warehouseClass->get($key);
}
}
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
JPluginHelper::importPlugin('hikashoppayment');
JPluginHelper::importPlugin('hikashopshipping');
$app->triggerEvent('onMarketOrderEditionLoading',
array(&$order) );
$app->triggerEvent('onHistoryDisplay',
array(&$order->history) );
if(class_exists('JDispatcher'))
$this->dispatcher = JDispatcher::getInstance();
if($toolbar) {
hikamarket::setPageTitle(JText::sprintf('HIKAM_ORDER',
$order->order_number));
$this->toolbar = array(
'back' => array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_BACK'),
'url' => hikamarket::completeLink('order')
),
'order-status' => array(
'icon' => 'order-status',
'fa' => 'fa-tasks',
'name' => JText::_('HIKAM_EDIT_ORDER_STATUS'),
'url' =>
hikamarket::completeLink('order&task=status&cid='.(int)$order->order_id,
true),
'popup' => array('id' =>
'hikamarket_order_status_popup', 'width' => 640,
'height' => 300),
'linkattribs' => '
onclick="if(window.orderMgr.editOrderStatus) return
window.orderMgr.editOrderStatus(this); window.hikashop.openBox(this);
return false;"',
'pos' => 'right',
'acl' => hikamarket::acl('order/edit/general')
),
'email' => array(
'icon' => 'email',
'fa' => 'fa-envelope',
'name' => JText::_('HIKA_EMAIL'),
'url' =>
hikamarket::completeLink('order&task=mail&cid='.(int)$order->order_id,
true),
'popup' => array('id' =>
'hikamarket_order_mail_popup', 'width' => 800,
'height' => 600),
'pos' => 'right',
'acl' => hikamarket::acl('order/edit/mail')
),
'invoice' => array(
'icon' => 'invoice',
'fa' => 'fa-book',
'name' => JText::_('INVOICE'),
'url' =>
hikamarket::completeLink('order&task=invoice&type=full&cid='.(int)$order->order_id,
true),
'popup' => array('id' =>
'hikamarket_order_invoice_popup', 'width' => 640,
'height' => 480),
'pos' => 'right',
'acl' => hikamarket::acl('order/show/invoice')
),
'shipping-invoice' => array(
'icon' => 'shipping-invoice',
'fa' => 'fa-truck fa-shipping-fast',
'name' => JText::_('SHIPPING_INVOICE'),
'url' =>
hikamarket::completeLink('order&task=invoice&type=shipping&cid='.(int)$order->order_id,
true),
'popup' => array('id' =>
'hikamarket_order_shippinginvoice_popup', 'width' =>
640, 'height' => 480),
'pos' => 'right',
'acl' =>
hikamarket::acl('order/show/shippinginvoice')
)
);
}
}
public function show_vendor($tpl = null) {
$this->show($tpl, true);
}
public function invoice() {
$app = JFactory::getApplication();
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$order_id = hikamarket::getCID('order_id');
$type = hikaInput::get()->getWord('type');
$this->assignRef('invoice_type', $type);
$nobutton = true;
$this->assignRef('nobutton', $nobutton);
$display_type = 'frontcomp';
$this->assignRef('display_type', $display_type);
$currencyClass = hikamarket::get('shop.class.currency');
$this->assignRef('currencyHelper', $currencyClass);
$orderClass = hikamarket::get('shop.class.order');
$order = $orderClass->loadFullOrder($order_id, true, false);
if(!empty($order) && $order->order_vendor_id !=
$vendor->vendor_id && ($vendor->vendor_id > 1 ||
($order->order_vendor_id > 1 &&
!hikamarket::acl('order/show/vendors')))) {
$order = null;
$app->enqueueMessage(JText::_('ORDER_ACCESS_FORBIDDEN'));
$app->redirect(hikamarket::completeLink('order'));
return false;
}
$fieldsClass = hikamarket::get('shop.class.field');
$this->assignRef('fieldsClass', $fieldsClass);
$fields = array();
if(hikashop_level(2)) {
$null = null;
if($this->invoice_type == 'shipping') {
$fields['item'] =
$fieldsClass->getFields('display:vendor_order_shipping_invoice=1',
$null, 'item');
$fields['order'] =
$fieldsClass->getFields('display:vendor_order_shipping_invoice=1',
$null, 'order');
} else {
$fields['item'] =
$fieldsClass->getFields('display:vendor_order_invoice=1',
$null, 'item');
$fields['order'] =
$fieldsClass->getFields('display:vendor_order_invoice=1',
$null, 'order');
}
}
$vendorFields = $vendor;
$extraFields = array(
'vendor' =>
$fieldsClass->getFields('frontcomp', $vendorFields,
'plg.hikamarket.vendor')
);
$this->assignRef('extraFields', $extraFields);
$this->assignRef('vendorFields', $vendorFields);
$store = str_replace(
array("\r\n","\n","\r"),
array('<br/>','<br/>','<br/>'),
$shopConfig->get('store_address','')
);
$this->assignRef('store_address', $store);
$this->assignRef('element', $order);
$this->assignRef('order', $order);
$this->assignRef('fields', $fields);
if(substr($order->order_shipping_method, 0, 7) ==
'market-')
$order->order_shipping_method =
substr($order->order_shipping_method, 7);
if(substr($order->order_payment_method, 0, 7) == 'market-')
$order->order_payment_method =
substr($order->order_payment_method, 7);
if(!empty($order->order_payment_id)) {
$pluginsPayment = hikamarket::get('shop.type.plugins');
$pluginsPayment->type = 'payment';
$this->assignRef('payment', $pluginsPayment);
}
if(!empty($order->order_shipping_id)) {
$pluginsShipping = hikamarket::get('shop.type.plugins');
$pluginsShipping->type = 'shipping';
$this->assignRef('shipping', $pluginsShipping);
if(empty($order->order_shipping_method)) {
$shippingClass = hikamarket::get('shop.class.shipping');
$this->assignRef('shippingClass', $shippingClass);
$shippings_data = array();
$shipping_ids = explode(';', $order->order_shipping_id);
foreach($shipping_ids as $key) {
$shipping_data = '';
list($k, $w) = explode('@', $key);
$shipping_id = $k;
if(isset($order->shippings[$shipping_id])) {
$shipping = $order->shippings[$shipping_id];
$shipping_data = $shipping->shipping_name;
} else {
foreach($order->products as $order_product) {
if($order_product->order_product_shipping_id == $key) {
if(!is_numeric($order_product->order_product_shipping_id)) {
$shipping_name =
$this->getShippingName($order_product->order_product_shipping_method,
$shipping_id);
$shipping_data = $shipping_name;
} else {
$shipping_method_data =
$this->shippingClass->get($shipping_id);
$shipping_data = $shipping_method_data->shipping_name;
}
break;
}
}
if(empty($shipping_data))
$shipping_data = '[ ' . $key . ' ]';
}
$shippings_data[] = $shipping_data;
}
$order->order_shipping_method = $shippings_data;
}
}
}
public function status() {
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$this->loadRef(array(
'orderClass' => 'shop.class.order',
'order_status' => 'type.order_status',
));
$order_id = hikamarket::getCID('order_id');
$order = $this->orderClass->loadFullOrder($order_id, true, false);
$this->assignRef('order', $order);
$order_status_filters = array();
if($order->order_type == 'subsale' &&
(int)$order->order_vendor_paid > 0 &&
$config->get('filter_orderstatus_paid_order', 1)) {
$valid_order_statuses = explode(',',
$config->get('valid_order_statuses',
'confirmed,shipped'));
if(in_array($order->order_status, $valid_order_statuses)) {
$order_status_filters = $valid_order_statuses;
} else {
$order_status_filters = array($order->order_status);
}
}
$this->assignRef('order_status_filters',
$order_status_filters);
$this->toolbar = array(
'back' => array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_CANCEL'),
'url' => '#cancel',
'linkattribs' => 'onclick="return
window.parent.hikamarket.closeBox();"',
),
'save' => array(
'icon' => 'apply',
'fa' => 'fa-check-circle',
'url' => '#apply',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'save\',\'adminForm\');"',
'name' => JText::_('HIKA_OK'), 'pos'
=> 'right'
)
);
}
public function showblock($tpl = null) {
$block = hikaInput::get()->getString('block', null);
$blocks = array(
'customer', 'edit_customer', 'details',
'general', 'history', 'products',
'coupon', 'edit_coupon', 'payment',
'edit_payment', 'shipping', 'edit_shipping',
'fields', 'edit_fields',
'product', 'edit_product',
'billingaddress', 'edit_billingaddress',
'shippingaddress', 'edit_shippingaddress',
'vendors',
);
if(!in_array($block, $blocks))
return false;
$translate_edit = array('coupon' => 'edit_coupon',
'payment' => 'edit_payment', 'shipping'
=> 'edit_shipping');
if(isset($translate_edit[$block]) &&
hikaInput::get()->getInt('blocksubmitted', 0) === 1)
$block = $translate_edit[$block];
$addresses_blocks = array(
'show' => array('billingaddress' =>
'billing', 'shippingaddress' =>
'shipping'),
'edit' => array('edit_billingaddress' =>
'billing', 'edit_shippingaddress' =>
'shipping'),
);
if(isset($addresses_blocks['show'][ $block ])) {
$this->block_show_address = $addresses_blocks['show'][
$block ];
$block = 'address';
}
if(isset($addresses_blocks['edit'][ $block ])) {
$this->block_edit_address = $addresses_blocks['edit'][
$block ];
$block = 'edit_address';
$this->edit_address_mode =
hikaInput::get()->getCmd('address_mode', '');
}
$this->show($tpl, false);
$this->ajax = true;
if(in_array($block, array('edit_product',
'product'))) {
$this->product = null;
$this->pid = hikaInput::get()->getInt('pid', 0);
if($this->pid == 0 &&
!hikamarket::acl('order/edit/products'))
return false;
foreach($this->order->products as $k => $v) {
if((int)$v->order_product_id == $this->pid)
$this->product = $v;
}
if($this->pid > 0 && empty($this->product))
return false;
}
if($block == 'edit_address') {
if($this->block_edit_address == 'billing') {
if(!empty($this->order->order_billing_address_id))
$this->order->billing_address =
$this->shopAddressClass->get($this->order->order_billing_address_id);
$f = (isset($this->order->billing_fields) ?
$this->order->billing_fields : $this->order->fields);
$this->fieldsClass->prepareFields($f,
$this->order->billing_address, 'address',
'checkout&task=state');
}
if($this->block_edit_address == 'shipping') {
if(!empty($this->order->order_shipping_address_id))
$this->order->shipping_address =
$this->shopAddressClass->get($this->order->order_shipping_address_id);
$f = (isset($this->order->shipping_fields) ?
$this->order->shipping_fields : $this->order->fields);
$this->fieldsClass->prepareFields($f,
$this->order->shipping_address, 'address',
'checkout&task=state');
}
}
$this->setLayout('show_block_' . $block);
echo $this->loadTemplate();
$orderClass = hikamarket::get('class.order');
$events = $orderClass->getEvents();
if(!empty($events)) {
echo "\r\n".'<script
type="text/javascript">'."\r\n";
foreach($events as $k => $v) {
echo 'window.Oby.fireAjax("'.$k.'",
'.json_encode($v).');' . "\r\n";
}
echo '</script>';
}
return false;
}
public function history() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$order_id = hikaInput::get()->getInt('order_id', 0);
$cid = hikamarket::getCID('cid');
$query = 'SELECT * FROM ' .
hikamarket::table('shop.history') . ' WHERE history_id =
' . (int)$cid . ' AND history_order_id = ' .
(int)$order_id;
$db->setQuery($query, 0, 1);
$history = $db->loadObject();
$this->assignRef('history', $history);
if(empty($history))
return;
$histories = array( &$history );
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
JPluginHelper::importPlugin('hikashoppayment');
JPluginHelper::importPlugin('hikashopshipping');
$app->triggerEvent('onHistoryDisplay', array(
&$histories ));
$history->user = null;
if(!empty($history->history_user_id) &&
(int)$history->history_user_id > 0) {
$userClass = hikamarket::get('shop.class.user');
$history->user = $userClass->get(
(int)$history->history_user_id );
unset($history->user->password);
}
if(!empty($history->history_data) &&
substr($history->history_data, 0, 1) == '{') {
$d = json_decode($history->history_data, true);
if(!empty($d))
$history->history_data = $d;
}
}
public function export_show() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$this->paramBase =
HIKAMARKET_COMPONENT.'.'.$this->getName().'.listing';
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid='&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$this->loadRef(array(
'toggleClass' => 'helper.toggle',
'currencyHelper' => 'shop.class.currency',
'paymentType' => 'shop.type.payment',
'orderStatusType' => 'type.order_status'
));
$pageInfo = new stdClass();
$pageInfo->search =
HikaStringHelper::strtolower($app->getUserStateFromRequest($this->paramBase.'.search',
'search', '', 'string'));
$pageInfo->filter = new stdClass();
$pageInfo->filter->filter_status =
$app->getUserStateFromRequest($this->paramBase.'.filter_status',
'filter_status', '', 'string');
$pageInfo->filter->filter_payment =
$app->getUserStateFromRequest($this->paramBase.'.filter_payment',
'filter_payment', '', 'string');
$pageInfo->filter->filter_startdate =
$app->getUserStateFromRequest($this->paramBase.'.filter_startdate',
'filter_startdate', '', 'string');
$pageInfo->filter->filter_enddate =
$app->getUserStateFromRequest($this->paramBase.'.filter_enddate',
'filter_enddate', '', 'string');
$this->assignRef('pageInfo', $pageInfo);
$this->toolbar = array(
array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_BACK'),
'url' => hikamarket::completeLink('order')
),
array(
'url' => '#export',
'fa' => 'fa-file-export',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'export\',\'hikamarket_order_export_form\');"',
'icon' => 'report',
'name' => JText::_('HIKA_EXPORT'),
'pos' => 'right'
)
);
}
public function export() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$this->paramBase =
HIKAMARKET_COMPONENT.'.'.$this->getName().'.listing';
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid='&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$this->loadRef(array(
'export' => 'shop.helper.spreadsheet'
));
$pageInfo = new stdClass();
$pageInfo->search =
HikaStringHelper::strtolower($app->getUserStateFromRequest($this->paramBase.'.search',
'search', '', 'string'));
$pageInfo->filter = new stdClass();
$pageInfo->filter->filter_status =
$app->getUserStateFromRequest($this->paramBase.'.filter_status',
'filter_status', '', 'string');
$pageInfo->filter->filter_payment =
$app->getUserStateFromRequest($this->paramBase.'.filter_payment',
'filter_payment', '', 'string');
$pageInfo->filter->filter_startdate =
$app->getUserStateFromRequest($this->paramBase.'.filter_startdate',
'filter_startdate', '', 'string');
$pageInfo->filter->filter_enddate =
$app->getUserStateFromRequest($this->paramBase.'.filter_enddate',
'filter_enddate', '', 'string');
$this->assignRef('pageInfo', $pageInfo);
$formData = hikaInput::get()->get('data', array(),
'array');
$export_format =
strtolower(@$formData['export']['format']);
if(empty($export_format) || !in_array($export_format,
array('csv', 'xls'))) {
$export_format = 'csv';
}
$this->assignRef('export_format', $export_format);
$cfg = array(
'table' => 'shop.order',
'main_key' => 'order_id',
'order_sql_value' => 'hkorder.order_id'
);
$filters = array();
$searchMap = array(
'hkorder.order_id',
'hkorder.order_user_id',
'hkorder.order_full_price',
'hkorder.order_number',
'hkuser.user_email',
'juser.username',
'juser.name'
);
$orderingAccept = array('hkorder.','hkuser.');
$order = ' ORDER BY hkorder.order_id';
if(!empty($pageInfo->filter->filter_status))
$filters['order_status'] = 'hkorder.order_status = '
. $db->Quote($pageInfo->filter->filter_status);
if(!empty($pageInfo->filter->filter_payment))
$filters['order_payment_method'] =
'hkorder.order_payment_id = ' .
$db->Quote($pageInfo->filter->filter_payment);
if($vendor->vendor_id > 1) {
$filters['vendor_id'] = 'hkorder.order_vendor_id = '
. $vendor->vendor_id;
$filters['order_type'] = 'hkorder.order_type = ' .
$db->Quote('subsale');
} else {
$filters['vendor_id'] = '(hkorder.order_vendor_id = 0 OR
hkorder.order_vendor_id = 1)';
$filters['order_type'] = 'hkorder.order_type = ' .
$db->Quote('sale');
}
if(!empty($pageInfo->filter->filter_enddate)) {
$filter_end = explode('-',
$pageInfo->filter->filter_enddate);
$noHourDay = explode(' ', $filter_end[2]);
$filter_end[2] = $noHourDay[0];
$filter_end = mktime(23, 59, 59, $filter_end[1], $filter_end[2],
$filter_end[0]);
}
if(!empty($pageInfo->filter->filter_startdate)) {
$filter_start =
explode('-',$pageInfo->filter->filter_startdate);
$noHourDay = explode(' ',$filter_start[2]);
$filter_start[2] = $noHourDay[0];
$filter_start = mktime(0, 0, 0, $filter_start[1], $filter_start[2],
$filter_start[0]);
if(!empty($pageInfo->filter->filter_enddate)) {
$filters['order_created'] = 'hkorder.order_created >
'.$filter_start. ' AND hkorder.order_created <
'.$filter_end;
} else {
$filters['order_created'] = 'hkorder.order_created >
'.$filter_start;
}
} else if(!empty($pageInfo->filter->filter_enddate)) {
$filters['order_created'] = 'hkorder.order_created <
'.$filter_end;
}
$select = '';
$from = '';
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
$app->triggerEvent('onBeforeOrderExportQuery',
array(&$select, &$from, &$filters, &$order,
&$searchMap, &$orderingAccept) );
$this->processFilters($filters, $order, $searchMap, $orderingAccept);
$query = 'FROM
'.hikamarket::table($cfg['table']).' AS hkorder
'.
'LEFT JOIN '.hikamarket::table('shop.user').'
AS hkuser ON hkorder.order_user_id = hkuser.user_id '.
'LEFT JOIN
'.hikamarket::table('joomla.users').' AS juser ON
hkuser.user_cms_id = juser.id '.
$from.' '.$filters.' '.$order;
if(!empty($select) && substr($select, 0, 1) != ',')
$select = ','.$select;
$db->setQuery('SELECT hkorder.*, hkuser.*, juser.name,
juser.username '.$select.$query);
$rows = $db->loadObjectList('order_id');
if(empty($rows)) {
$app->enqueueMessage(JText::_('HIKAM_NOTHING_TO_EXPORT'),
'error');
$app->redirect(hikamarket::completeLink('order&task=export'.$url_itemid,
false, true));
return false;
}
$addressIds = array();
foreach($rows as &$row) {
$row->products = array();
$addressIds[$row->order_shipping_address_id] =
$row->order_shipping_address_id;
$addressIds[$row->order_billing_address_id] =
$row->order_billing_address_id;
}
unset($row);
if(!empty($addressIds)) {
$db->setQuery('SELECT * FROM
'.hikamarket::table('shop.address').' WHERE address_id
IN ('.implode(',',$addressIds).')');
$addresses = $db->loadObjectList('address_id');
if(!empty($addresses)) {
$zoneNamekeys = array();
foreach($addresses as $address) {
$zoneNamekeys[$address->address_country] =
$db->Quote($address->address_country);
$zoneNamekeys[$address->address_state] =
$db->Quote($address->address_state);
}
if(!empty($zoneNamekeys)) {
$db->setQuery('SELECT zone_namekey,zone_name FROM
'.hikamarket::table('shop.zone').' WHERE zone_namekey
IN ('.implode(',',$zoneNamekeys).')');
$zones = $db->loadObjectList('zone_namekey');
if(!empty($zones)) {
foreach($addresses as &$address) {
if(!empty($zones[$address->address_country]))
$address->address_country =
$zones[$address->address_country]->zone_name;
if(!empty($zones[$address->address_state]))
$address->address_state =
$zones[$address->address_state]->zone_name;
}
unset($address);
}
}
$fields = array_keys(get_object_vars(reset($addresses)));
foreach($rows as $k => $row) {
if(!empty($addresses[$row->order_shipping_address_id])) {
foreach($addresses[$row->order_shipping_address_id] as $key =>
$val) {
$key = 'shipping_'.$key;
$rows[$k]->$key = $val;
}
} else {
foreach($fields as $field){
$key = 'shipping_'.$field;
$rows[$k]->$key = '';
}
}
if(!empty($addresses[$row->order_billing_address_id])) {
foreach($addresses[$row->order_billing_address_id] as $key =>
$val) {
$key = 'billing_'.$key;
$rows[$k]->$key = $val;
}
} else {
foreach($fields as $field) {
$key = 'billing_'.$field;
$rows[$k]->$key = '';
}
}
}
}
}
$orderIds = array_keys($rows);
$db->setQuery('SELECT * FROM
'.hikamarket::table('shop.order_product').' WHERE
order_id IN ('.implode(',', $orderIds).')');
$products = $db->loadObjectList();
foreach($products as $product) {
$order =& $rows[$product->order_id];
$order->products[] = $product;
if(!isset($order->order_full_tax)) {
$order->order_full_tax = 0;
}
$order->order_full_tax += round($product->order_product_quantity *
$product->order_product_tax, 2);
}
foreach($rows as $k => $row) {
$rows[$k]->order_full_tax += $row->order_shipping_tax -
$row->order_discount_tax;
}
$view =& $this;
$app->triggerEvent('onBeforeOrderExport', array(&$rows,
&$view) );
$this->assignRef('orders', $rows);
}
public function create() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$this->paramBase =
HIKAMARKET_COMPONENT.'.'.$this->getName().'.create';
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid = '&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$this->loadRef(array(
'currencyHelper' => 'shop.class.currency',
'nameboxType' => 'type.namebox',
'currencyType' => 'shop.type.currency',
));
$this->main_currency =
$shopConfig->get('main_currency');
hikamarket::setPageTitle(JText::_('HIKAM_ORDER_CREATION'));
$this->toolbar = array(
'back' => array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_BACK'),
'url' => hikamarket::completeLink('order')
),
'create' => array(
'icon' => 'new',
'fa' => 'fa-plus-circle',
'url' => '#create',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'add\',\'hikamarket_order_create_form\');"',
'name' => JText::_('HIKAM_CREATE_ORDER'),
'pos' => 'right'
)
);
}
public function request() {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$this->paramBase =
HIKAMARKET_COMPONENT.'.'.$this->getName().'.request';
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid = '&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$this->loadRef(array(
'vendorClass' => 'class.vendor',
'currencyHelper' => 'shop.class.currency'
));
$data = $this->vendorClass->getUnpaidOrders($vendor);
$this->assignRef('data', $data);
$total = new stdClass();
$total->count = 0;
$total->value = 0;
$total->currency = (int)$vendor->vendor_currency_id;
if(empty($total->currency))
$total->currency = hikashop_getCurrency();
foreach($data as $d) {
$total->count += (int)$d->count;
if($total->currency == $d->currency)
$total->value += hikamarket::toFloat( (int)$d->value );
else
$total->value +=
$this->currencyClass->convertUniquePrice((float)hikamarket::toFloat($d->value),
(int)$d->currency, (int)$total->currency);
}
$this->assignRef('total', $total);
$min_value =
hikamarket::toFloat($config->get('min_value_payment_request',
0.0));
if($min_value > 0.0) {
$main_currency = (int)$shopConfig->get('main_currency',
1);
if($total->currency != $main_currency) {
$min_value = $this->currencyClass->convertUniquePrice($min_value,
$main_currency, $total->currency);
}
}
$this->assignRef('min_value', $min_value);
hikamarket::setPageTitle(JText::_('HIKAM_PAYMENT_REQUEST'));
$this->toolbar = array(
array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_BACK'),
'url' => hikamarket::completeLink('order')
),
array(
'url' => '#request',
'fa' => 'fa-money fa-money-bill-alt',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'request\',\'hikamarket_order_request_form\');"',
'icon' => 'pay',
'name' => JText::_('HIKAM_DO_PAYMENT_REQUEST'),
'pos' => 'right',
'display' => ($this->total->value != 0) &&
($this->total->value > $min_value)
)
);
}
public function mail() {
$order_id = hikashop_getCID('order_id');
$config = hikamarket::config();
$this->assignRef('config', $config);
$orderClass = hikamarket::get('shop.class.order');
$this->loadRef(array(
'radioType' => 'shop.type.radio',
));
$formData = hikaInput::get()->get('data', array(),
'array');
$params = array();
if(!empty($formData['mail']['params'])) {
foreach($formData['mail']['params'] as $k => $v)
{
if(is_numeric($v))
$v = (int)$v;
if(is_string($v))
$v = strip_tags($v);
$params[$k] = $v;
}
}
$order = $orderClass->get($order_id);
$order->url_itemid = '';
$orderClass->loadOrderNotification($order,
'market.user_order_notification', $params);
$this->assignRef('element', $order);
$order->mail->dst_email = $order->customer->user_email;
$order->mail->dst_name = (!empty($order->customer->name)) ?
$order->customer->name : '';
$this->toolbar = array(
'send' => array(
'icon' => 'email',
'fa' => 'fa-envelope',
'url' => '#send',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'sendmail\',\'hikamarket_mail_form\');"',
'name' => JText::_('SEND_EMAIL'),
'pos' => 'right'
)
);
}
public function previewmail() {
$this->mail();
}
public function payments($tpl = null) {
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$ctrl = '';
$this->paramBase =
HIKAMARKET_COMPONENT.'.'.$this->getName().'.payments';
global $Itemid;
$url_itemid = '';
if(!empty($Itemid))
$url_itemid='&Itemid='.$Itemid;
$this->assignRef('Itemid', $Itemid);
$vendor = hikamarket::loadVendor(true, false);
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$this->loadRef(array(
'orderStatusType' => 'type.order_status',
'addressClass' => 'class.address',
'currencyHelper' => 'shop.class.currency',
'shopAddressClass' => 'shop.class.address',
));
$filterType =
$app->getUserStateFromRequest($this->paramBase.'.filter_type',
'filter_type', 0, 'int');
$cfg = array(
'table' => 'shop.order',
'main_key' => 'order_id',
'order_sql_value' => 'hkorder.order_id'
);
$pageInfo = $this->getPageInfo($cfg['order_sql_value'],
'desc');
$pageInfo->filter->filter_status =
$app->getUserStateFromRequest($this->paramBase.'.filter_status',
'filter_status', '', 'string');
$pageInfo->filter->filter_payment =
$app->getUserStateFromRequest($this->paramBase.'.filter_payment',
'filter_payment', '', 'string');
$pageInfo->filter->filter_user =
$app->getUserStateFromRequest($this->paramBase.'.filter_user',
'filter_user', '', 'string');
$filters = array();
$searchMap = array(
'hkorder.order_id',
'hkorder.order_number',
);
$orderingAccept = array('hkorder.');
$order = '';
$fields = array();
if(hikashop_level(2)) {
}
$this->assignRef('fields', $fields);
if(!empty($pageInfo->filter->filter_status))
$filters['order_status'] = 'hkorder.order_status = '
. $db->Quote($pageInfo->filter->filter_status);
if($vendor->vendor_id > 1) {
$filters['order_vendor_id'] = 'hkorder.order_vendor_id =
' . $vendor->vendor_id;
$filters['order_type'] = 'hkorder.order_type = ' .
$db->Quote('vendorpayment');
} else {
$filters['order_vendor_id'] = '(hkorder.order_vendor_id =
0 OR hkorder.order_vendor_id = 1)';
$filters['order_type'] = 'hkorder.order_type = ' .
$db->Quote('vendorpayment');
}
$extrafilters = array();
$joins = array();
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
$app->triggerEvent('onBeforeVendorPaymentListing',
array($this->paramBase, &$extrafilters, &$pageInfo,
&$filters, &$joins, &$searchMap));
$this->assignRef('extrafilters', $extrafilters);
$this->processFilters($filters, $order, $searchMap, $orderingAccept);
$query = 'FROM
'.hikamarket::table($cfg['table']).' AS hkorder
'.
implode(' ', $joins).' '.$filters.$order;
$db->setQuery('SELECT hkorder.* '.$query,
(int)$pageInfo->limit->start, (int)$pageInfo->limit->value);
if(empty($pageInfo->search)) {
$query = 'FROM
'.hikamarket::table($cfg['table']).' AS hkorder
'.$filters;
}
$orders = $db->loadObjectList('order_id');
$db->setQuery('SELECT COUNT(*) '.$query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $db->loadResult();
$pageInfo->elements->page = count($orders);
$order_ids = array_keys($orders);
$transaction_stats = array();
$transaction_old_stats = array();
if(!empty($order_ids)) {
$query = 'SELECT hkot.order_transaction_paid AS order_id,
COUNT(hkot.order_transaction_id) AS counter FROM
'.hikamarket::table('order_transaction').' AS hkot
'.
'WHERE hkot.order_transaction_paid IN
('.implode(',', $order_ids).') GROUP BY
hkot.order_transaction_paid';
$db->setQuery($query);
$transaction_stats = $db->loadObjectList('order_id');
$query = 'SELECT hko.order_vendor_paid AS order_id,
COUNT(hko.order_id) AS counter FROM
'.hikamarket::table('shop.order').' AS hko '.
'WHERE hko.order_type =
'.$db->quote('subsale').' AND hko.order_vendor_paid
IN ('.implode(',', $order_ids).') GROUP BY
hko.order_vendor_paid';
$db->setQuery($query);
$transaction_old_stats = $db->loadObjectList('order_id');
}
foreach($orders as &$o) {
$o->counter = 0;
if(isset($transaction_stats[(int)$o->order_id]))
$o->counter +=
(int)$transaction_stats[(int)$o->order_id]->counter;
if(isset($transaction_old_stats[(int)$o->order_id]))
$o->counter +=
(int)$transaction_old_stats[(int)$o->order_id]->counter;
}
unset($o);
unset($transaction_stats);
unset($transaction_old_stats);
$this->assignRef('orders', $orders);
$text_asc = JText::_('ASCENDING');
$text_desc = JText::_('DESCENDING');
$ordering_values = array(
'hkorder.order_id' => JText::_('SORT_ID'),
'hkorder.order_created' =>
JText::_('SORT_CREATION'),
'hkorder.order_modified' =>
JText::_('SORT_MODIFICATION'),
'hkorder.order_full_price' =>
JText::_('SORT_PRICE'),
);
$this->ordering_values = array();
foreach($ordering_values as $k => $v) {
$this->ordering_values[$k.' asc'] = $v . ' '
.$text_asc;
$this->ordering_values[$k.' desc'] = $v . ' '
.$text_desc;
}
$this->full_ordering =
$this->pageInfo->filter->order->value . ' ' .
strtolower($this->pageInfo->filter->order->dir);
$this->toolbar = array(
'back' => array(
'icon' => 'back',
'fa' => 'fa-arrow-circle-left',
'name' => JText::_('HIKA_BACK'),
'url' => hikamarket::completeLink('vendor')
),
);
$this->getPagination();
$this->getOrdering('hkorder.ordering', !$filterType);
}
protected function getShippingName($shipping_method, $shipping_id,
$default_return = true) {
static $cache = array();
if(strpos($shipping_id, '@') !== false)
list($shipping_id, $warehouse) = explode('@', $shipping_id,
2);
$key = md5($shipping_method . '##' . $shipping_id);
if(isset($cache[$key]))
return $cache[$key];
$shipping_name = false;
if($default_return)
$shipping_name = $shipping_method . ' ' . $shipping_id;
if(strpos($shipping_id, '-') !== false) {
if(empty($this->shippingClass))
$this->shippingClass =
hikamarket::get('shop.class.shipping');
$shipping_ids = explode('-', $shipping_id, 2);
$shipping = $this->shippingClass->get($shipping_ids[0]);
if(!empty($shipping->shipping_params) &&
is_string($shipping->shipping_params))
$shipping->shipping_params =
hikamarket::unserialize($shipping->shipping_params);
if(empty($shipping_method) && !empty($shipping))
$shipping_method = $shipping->shipping_type;
$shippingMethod = hikamarket::import('hikashopshipping',
$shipping_method);
$methods = array();
if(!empty($shippingMethod))
$methods = $shippingMethod->shippingMethods($shipping);
if(isset($methods[$shipping_id]))
$shipping_name = $shipping->shipping_name.' -
'.$methods[$shipping_id];
$cache[$key] = $shipping_name;
} else if($shipping_method === null && !empty($shipping_id)) {
if(empty($this->shippingClass))
$this->shippingClass =
hikamarket::get('shop.class.shipping');
$shipping = $this->shippingClass->get($shipping_id);
$shipping_name = $shipping->shipping_name;
$cache[$key] = $shipping_name;
}
return $shipping_name;
}
public function show_general() {
$this->show($tpl, false);
}
public function show_history() {
$this->show($tpl, false);
}
public function edit_additional() {
$vendor = hikamarket::loadVendor(true, false);
if($vendor->vendor_id != 0 && $vendor->vendor_id != 1) {
return hikamarket::deny('order',
JText::sprintf('HIKAM_ACTION_DENY',
JText::_('HIKAM_ACT_ORDER_EDIT')));
}
$this->show($tpl, false);
if(hikashop_level(2)) {
$this->fields['order'] =
$this->fieldsClass->getFields('display:vendor_order_edit=1',
$order, 'order');
$null = null;
$this->fields['entry'] =
$this->fieldsClass->getFields('display:vendor_order_edit=1',
$null, 'entry');
$this->fields['item'] =
$this->fieldsClass->getFields('display:vendor_order_edit=1',
$null, 'item');
}
$this->toolbar = array(
array(
'url' => '#save',
'fa' => 'fa-save',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'save\',\'hikamarket_order_additional_form\');"',
'icon' => 'save',
'name' => JText::_('HIKA_SAVE'), 'pos'
=> 'right'
)
);
$ratesType = hikamarket::get('type.rates');
$this->assignRef('ratesType',$ratesType);
$pluginsPayment = hikamarket::get('shop.type.plugins');
$pluginsPayment->type = 'payment';
$this->assignRef('paymentPlugins', $pluginsPayment);
$pluginsShipping = hikamarket::get('shop.type.plugins');
$pluginsShipping->type = 'shipping';
$this->assignRef('shippingPlugins', $pluginsShipping);
}
public function show_additional() {
$task = hikaInput::get()->getCmd('task', '');
if($task == 'save') {
$html = '<html><body><script
type="text/javascript">'."\r\n".
'window.parent.hikamarket.submitFct();'."\r\n".
'</script></body></html>';
die($html);
}
$this->show($tpl, false);
}
public function show_shipping_address() {
$address_type = 'shipping';
$this->assignRef('type', $address_type);
$this->show($tpl, false);
if($this->edit) {
if(!empty($this->order->order_shipping_address_id)) {
$addressClass = hikamarket::get('shop.class.address');
$this->order->shipping_address =
$addressClass->get($this->order->order_shipping_address_id);
}
$f = (isset($this->order->shipping_fields) ?
$this->order->shipping_fields : $this->order->fields);
$this->fieldsClass->prepareFields($f,
$this->order->shipping_address, 'address',
'checkout&task=state');
}
$this->setLayout('show_address');
}
public function show_billing_address() {
$address_type = 'billing';
$this->assignRef('type', $address_type);
$this->show($tpl, false);
if($this->edit) {
if(!empty($this->order->order_billing_address_id)) {
$addressClass = hikamarket::get('shop.class.address');
$this->order->billing_address =
$addressClass->get($this->order->order_billing_address_id);
}
$f = (isset($this->order->billing_fields) ?
$this->order->billing_fields : $this->order->fields);
$this->fieldsClass->prepareFields($f,
$this->order->billing_address, 'address',
'checkout&task=state');
}
$this->setLayout('show_address');
}
public function show_products() {
$task = hikaInput::get()->getCmd('task', '');
if($task == 'save') {
$html = '<html><body><script
type="text/javascript">'."\r\n".
'window.parent.hikamarket.submitFct();'."\r\n".
'</script></body></html>';
die($html);
}
$this->show($tpl, false);
}
public function edit_products() {
$vendor = hikamarket::loadVendor(true, false);
if($vendor->vendor_id != 0 && $vendor->vendor_id != 1) {
return hikamarket::deny('order',
JText::sprintf('HIKAM_ACTION_DENY',
JText::_('HIKAM_ACT_ORDER_EDIT')));
}
$this->assignRef('vendor', $vendor);
$config = hikamarket::config();
$this->assignRef('config', $config);
$shopConfig = hikamarket::config(false);
$this->assignRef('shopConfig', $shopConfig);
$db = JFactory::getDBO();
$productClass = hikamarket::get('shop.class.product');
$fieldsClass = hikamarket::get('shop.class.field');
$this->assignRef('fieldsClass', $fieldsClass);
$order_id = hikaInput::get()->getInt('order_id');
$order_product_id =
hikaInput::get()->getInt('order_product_id', 0);
$this->toolbar = array(
array(
'url' => '#save',
'fa' => 'fa-save',
'linkattribs' => 'onclick="return
window.hikamarket.submitform(\'save\',\'hikamarket_order_product_form\');"',
'icon' => 'save',
'name' => JText::_('HIKA_SAVE'), 'pos'
=> 'right'
)
);
$orderClass = hikamarket::get('shop.class.order');
$order = $orderClass->get($order_id);
$originalProduct = new stdClass();
if(!empty($order_product_id)) {
$orderProductClass =
hikamarket::get('shop.class.order_product');
$orderProduct = $orderProductClass->get($order_product_id);
if(empty($orderProduct) || $orderProduct->order_id != $order_id) {
$orderProduct = new stdClass();
$orderProduct->order_id = $order_id;
}
if(!empty($orderProduct->product_id)) {
$originalProduct =
$productClass->get($orderProduct->product_id);
}
} else {
$orderProduct = new stdClass();
$orderProduct->order_id = $order_id;
$product_id = hikaInput::get()->get('cid', array(),
'array');
if(!empty($product_id) &&
$productClass->getProducts($product_id)) {
$products = $productClass->products;
$product = $products[ (int)$product_id[0] ];
$product->options = array();
$originalProduct = $product;
$orderProduct->product_id = $product->product_id;
$orderProduct->order_product_name = $product->product_name;
$orderProduct->order_product_code = $product->product_code;
$orderProduct->order_product_quantity = 1;
$currencyClass = hikamarket::get('shop.class.currency');
$main_currency =
(int)$shopConfig->get('main_currency',1);
$discount_before_tax =
(int)$shopConfig->get('discount_before_tax',0);
$currency_id = $order->order_currency_id;
if($shopConfig->get('tax_zone_type', 'shipping')
== 'billing')
$zone_id = hikamarket::getZone('billing');
else
$zone_id = hikamarket::getZone('shipping');
$rows = array($product);
$currencyClass->getPrices($rows, $product_id, $currency_id,
$main_currency, $zone_id, $discount_before_tax);
$currencyClass->pricesSelection($rows[0]->prices, 0);
if(!empty($rows[0]->prices)) {
foreach($rows[0]->prices as $price) {
$orderProduct->order_product_price = $price->price_value;
$orderProduct->order_product_tax =
(@$price->price_value_with_tax - @$price->price_value);
$orderProduct->order_product_tax_info = @$price->taxes;
}
}
}
}
if(!empty($orderProduct->order_product_id) &&
(int)$orderProduct->order_product_id > 0) {
if(empty($orderProduct->order_product_parent_id)) {
$query = 'SELECT hkop.*, hko.order_vendor_id, hmv.* FROM ' .
hikamarket::table('shop.order_product') . ' as hkop '.
' INNER JOIN ' . hikamarket::table('shop.order').
' AS hko ON hkop.order_id = hko.order_id '.
' LEFT JOIN ' . hikamarket::table('vendor').
' AS hmv ON hmv.vendor_id = hko.order_vendor_id '.
' WHERE hko.order_type = \'subsale\' AND
order_product_parent_id = '. (int)$orderProduct->order_product_id
.
' ORDER BY hko.order_id DESC';
$db->setQuery($query);
$orderProduct->vendor_data = $db->loadObject();
}
} else if(!empty($orderProduct->product_id)) {
$query = 'SELECT p.product_vendor_id, pp.product_vendor_id AS
parent_vendor_id FROM
'.hikamarket::table('shop.product').' AS p '.
' LEFT JOIN
'.hikamarket::table('shop.product').' AS pp ON
p.product_parent_id = pp.product_id '.
' WHERE p.product_id = '. (int)$orderProduct->product_id;
$db->setQuery($query);
$productVendor = $db->loadObject();
$orderProduct->vendor_data = $productVendor;
$vendor_id = 0;
if(!empty($productVendor->product_vendor_id))
$vendor_id = (int)$productVendor->product_vendor_id;
else if(!empty($productVendor->parent_vendor_id))
$vendor_id = (int)$productVendor->parent_vendor_id;
$vendorObj = null;
if(!empty($vendor_id)) {
$vendorClass = hikamarket::get('class.vendor');
$vendorObj = $vendorClass->get($vendor_id);
}
$orderProduct->vendor = $vendorObj;
}
$this->assignRef('orderProduct', $orderProduct);
$this->assignRef('originalProduct', $originalProduct);
$ratesType = hikamarket::get('type.rates');
$this->assignRef('ratesType',$ratesType);
if(hikashop_level(2)) {
$null = null;
$this->fields['item'] =
$this->fieldsClass->getFields('display:vendor_order_edit=1',
$null, 'item','checkout&task=state');
}
}
public function customer_set() {
$users = hikaInput::get()->get('cid', array(),
'array');
$closePopup = hikaInput::get()->getInt('finalstep', 0);
if($closePopup) {
$formData = hikaInput::get()->get('data', array(),
'array');
$users = array(
(int)$formData['order']['order_user_id'] );
}
$rows = array();
$data = '';
$singleSelection = true;
//hikaInput::get()->getBool('single', false);
$order_id = hikaInput::get()->getInt('order_id', 0);
$elemStruct = array(
'user_email',
'user_cms_id',
'name',
'username',
'email'
);
$set_address = hikaInput::get()->getInt('set_user_address',
0);
if(!empty($users)) {
hikamarket::toInteger($users);
$db = JFactory::getDBO();
$query = 'SELECT a.*, b.* FROM
'.hikamarket::table('user','shop').' AS a
INNER JOIN '.hikamarket::table('users', false).' AS b
ON a.user_cms_id = b.id WHERE a.user_id IN
('.implode(',',$users).')';
$db->setQuery($query);
$rows = $db->loadObjectList();
if(!empty($rows)) {
$data = array();
foreach($rows as $v) {
$d = '{id:'.$v->user_id;
foreach($elemStruct as $s) {
if($s == 'id')
continue;
$d .= ','.$s.':\''.
str_replace('"','\'',$v->$s).'\'';
}
if($set_address && $singleSelection)
$d .=
',updates:[\'billing\',\'history\']';
$data[] = $d.'}';
}
if(!$singleSelection)
$data = '['.implode(',',$data).']';
else {
$data = $data[0];
$rows = $rows[0];
}
}
}
$this->assignRef('rows', $rows);
$this->assignRef('data', $data);
$this->assignRef('confirm', $confirm);
$this->assignRef('singleSelection', $singleSelection);
$this->assignRef('order_id', $order_id);
if($closePopup) {
$js =
'window.hikashop.ready(function(){window.top.hikamarket.submitBox('.$data.');});';
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
}
}
}
PK��[wtW�
index.htmlnu�[���PK��['*6���Ttmpl/create.phpnu�[���PK��[�P����atmpl/customer_set.phpnu�[���PK��[�4��t*t*vtmpl/edit_additional.phpnu�[���PK��[�!!2>tmpl/edit_products.phpnu�[���PK��[;�L]AA�Wtmpl/export.phpnu�[���PK��[=�s_
_
`tmpl/export_show.phpnu�[���PK��[�F�zD#D#�mtmpl/history.phpnu�[���PK��[wtW�@�tmpl/index.htmlnu�[���PK��[��&�;;��tmpl/invoice.phpnu�[���PK��[~�㏦$�$��tmpl/listing.phpnu�[���PK��[F� �����tmpl/listing.xmlnu�[���PK��[@/а��
��tmpl/mail.phpnu�[���PK��[����}tmpl/payments.phpnu�[���PK��[��o�))�tmpl/previewmail.phpnu�[���PK��[�=�����tmpl/request.phpnu�[���PK��[[]�ZKK
tmpl/show.phpnu�[���PK��[��c�)�)�9tmpl/show_additional.phpnu�[���PK��[���FFmctmpl/show_address.phpnu�[���PK��[2@n/xx�vtmpl/show_block_address.phpnu�[���PK��[�+�����tmpl/show_block_customer.phpnu�[���PK��[�N�x-x-��tmpl/show_block_details.phpnu�[���PK��[L"{N�%�%
��tmpl/show_block_edit_address.phpnu�[���PK��[xd�����tmpl/show_block_edit_coupon.phpnu�[���PK��[C�g,��!��tmpl/show_block_edit_customer.phpnu�[���PK��[=�����tmpl/show_block_edit_fields.phpnu�[���PK��[��X�7
7
��tmpl/show_block_edit_payment.phpnu�[���PK��[��gJ
3tmpl/show_block_edit_product.phpnu�[���PK��[YrD�xx!�#tmpl/show_block_edit_shipping.phpnu�[���PK��[�es==g8tmpl/show_block_fields.phpnu�[���PK��[�x�
�=tmpl/show_block_general.phpnu�[���PK��[����%
%
<Htmpl/show_block_history.phpnu�[���PK��[J��CC�Utmpl/show_block_product.phpnu�[���PK��[��y1+"+":stmpl/show_block_products.phpnu�[���PK��[�0�
��tmpl/show_block_vendors.phpnu�[���PK��[5I�WW�tmpl/show_general.phpnu�[���PK��[B"Z~����tmpl/show_history.phpnu�[���PK��[���
w�tmpl/show_legacy.phpnu�[���PK��[7j�AL"L"��tmpl/show_products.phpnu�[���PK��[��L��@�@Z�tmpl/show_vendor.phpnu�[���PK��[B��
�
<4tmpl/status.phpnu�[���PK��[HL�,��
X?view.html.phpnu�[���PK**"TZ