$cartProduct['PRODUCT_NAME'] = $t;
 $t = '';
 $statusDownload = explode(',', $config->get('order_status_for_download', 'confirmed,shipped'));
 if (!empty($item->files) && in_array($data->order->order_status, $statusDownload)) {
     $t .= '<p>';
     foreach ($item->files as $file) {
         $fileName = empty($file->file_name) ? $file->file_path : $file->file_name;
         $file_pos = empty($file->file_pos) ? '' : '&file_pos=' . $file->file_pos;
         if (empty($customer->user_cms_id)) {
             $file_pos .= '&email=' . $customer->user_email;
         }
         $oid = $data->order_id;
         if (!empty($data->cart->order_parent_id)) {
             $oid = $data->cart->order_parent_id;
         }
         $t .= '<a href="' . hikashop_frontendLink('index.php?option=com_hikashop&ctrl=order&task=download&file_id=' . $file->file_id . '&order_id=' . $oid . $file_pos . $url_itemid) . '">' . $fileName . '</a><br/>';
     }
     $t .= '</p>';
 }
 $cartProduct['PRODUCT_DOWNLOAD'] = $t;
 if ($config->get('price_with_tax')) {
     $unit_price = $currencyHelper->format($item->order_product_price + $item->order_product_tax, $data->cart->order_currency_id);
     $total_price = $currencyHelper->format($item->order_product_total_price, $data->cart->order_currency_id);
     $subtotal += $item->order_product_total_price;
 } else {
     $unit_price = $currencyHelper->format($item->order_product_price, $data->cart->order_currency_id);
     $total_price = $currencyHelper->format($item->order_product_total_price_no_vat, $data->cart->order_currency_id);
     $subtotal += $item->order_product_total_price_no_vat;
 }
 $cartProduct['PRODUCT_PRICE'] = $unit_price;
 $cartProduct['PRODUCT_TOTAL'] = $total_price;
示例#2
0
 function loadOrderNotification(&$order, $type = 'order_status_notification')
 {
     if (empty($order->order_user_id) || empty($order->order_status)) {
         $dbOrder = parent::get($order->order_id);
         $order->order_user_id = @$dbOrder->order_user_id;
         if (empty($order->order_status)) {
             $order->order_status = @$dbOrder->order_status;
         }
     }
     if (empty($order->customer) || @$order->customer->user_id != $order->order_user_id) {
         $userClass = hikashop_get('class.user');
         $order->customer = $userClass->get($order->order_user_id);
     }
     $this->orderNumber($order);
     global $Itemid;
     $url = '';
     if (!empty($Itemid)) {
         $url = '&Itemid=' . $Itemid;
     }
     if (isset($order->url_itemid)) {
         $url = (!empty($order->url_itemid) ? '&Itemid=' : '') . $order->url_itemid;
     }
     $order->order_url = hikashop_frontendLink('index.php?option=com_hikashop&ctrl=order&task=show&cid[]=' . $order->order_id . $url);
     $app = JFactory::getApplication();
     if (!isset($order->mail_status)) {
         if (isset($order->order_status)) {
             if ($app->isAdmin()) {
                 $locale = $this->loadLocale($order);
                 if (!empty($order->order_current_locale) && $order->order_current_locale != $locale) {
                     $translationHelper = hikashop_get('helper.translation');
                     if ($translationHelper->isMulti(true, false)) {
                         $lgid = $translationHelper->getId($locale);
                         $trans_table = 'jf_content';
                         if ($translationHelper->falang) {
                             $trans_table = 'falang_content';
                         }
                         $query = 'SELECT b.value ' . ' FROM ' . hikashop_table('category') . ' AS a ' . ' LEFT JOIN ' . hikashop_table($trans_table, false) . ' AS b ON (a.category_id = b.reference_id AND b.reference_table = \'hikashop_category\' AND b.reference_field = \'category_name\' AND b.published = 1 AND language_id = ' . $lgid . ') ' . ' WHERE a.category_type=\'status\' AND a.category_name=' . $this->database->Quote($order->order_status);
                         $this->database->setQuery($query);
                         $result = $this->database->loadResult();
                         if (!empty($result)) {
                             $order->mail_status = $result;
                         }
                     }
                 } elseif (!empty($order->value)) {
                     $order->mail_status = $order->value;
                 }
             } else {
                 $query = 'SELECT * FROM ' . hikashop_table('category') . ' WHERE category_type=\'status\' AND category_name=' . $this->database->Quote($order->order_status);
                 $this->database->setQuery($query);
                 $status = $this->database->loadObject();
                 if (!empty($status->category_name) && $status->category_name != $order->order_status) {
                     $order->mail_status = $status->category_name;
                 }
             }
             if (empty($order->mail_status)) {
                 $val = str_replace(' ', '_', strtoupper($order->order_status));
                 $trans = JText::_($val);
                 if ($val == $trans) {
                     $order->mail_status = $order->order_status;
                 } else {
                     $order->mail_status = $trans;
                 }
             }
         } else {
             $order->mail_status = '';
         }
     }
     $mail_status = $order->mail_status;
     $mailClass = hikashop_get('class.mail');
     $order->mail = $mailClass->get($type, $order);
     $order->mail_status = $mail_status;
     $order->mail->subject = JText::sprintf($order->mail->subject, $order->order_number, $mail_status, HIKASHOP_LIVE);
     if (!empty($order->customer->user_email)) {
         $order->mail->dst_email =& $order->customer->user_email;
     } else {
         $order->mail->dst_email = '';
     }
     if (!empty($order->customer->name)) {
         $order->mail->dst_name =& $order->customer->name;
     } else {
         $order->mail->dst_name = '';
     }
     $this->loadBackLocale();
 }
    ob_start();
    if ($data->cart->full_total->prices[0]->price_value_with_tax > 0) {
        echo '<p>' . JText::_('ORDER_VALID_AFTER_PAYMENT') . '</p>';
    }
    if (in_array($data->order_payment_method, array('banktransfer', 'check', 'purchaseorder'))) {
        $amount = $currencyHelper->format($data->cart->full_total->prices[0]->price_value_with_tax, $data->cart->order_currency_id);
        $paymentClass = hikashop_get('class.payment');
        $payment = $paymentClass->get($data->order_payment_id);
        $information = $payment->payment_params->information;
        if (preg_match('#^[a-z0-9_]*$#i', $information)) {
            $information = JText::_($information);
        }
        if ($data->order_payment_method == 'banktransfer') {
            echo '<p>' . JText::sprintf('PLEASE_TRANSFERT_MONEY', $amount) . '<br/>' . $information . '<br/>' . JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER', $data->order_number) . '</p>';
        } elseif ($data->order_payment_method == 'check') {
            echo '<p>' . JText::sprintf('PLEASE_SEND_CHECK', $amount) . '<br/>' . $information . '<br/>' . JText::sprintf('INCLUDE_ORDER_NUMBER_TO_CHECK', $data->order_number) . '</p>';
        } elseif ($data->order_payment_method == 'purchaseorder') {
            echo '<p>' . JText::sprintf('PLEASE_SEND_PURCHASEORDER', $amount) . '<br/>' . $information . '<br/>' . JText::sprintf('INCLUDE_ORDER_NUMBER_TO_PURCHASEORDER', $data->order_number) . '</p>';
        }
    } else {
        if ($data->cart->full_total->prices[0]->price_value_with_tax > 0 && hikashop_level(1) && $config->get('allow_payment_button', 1)) {
            $pay_url = hikashop_frontendLink('index.php?option=com_hikashop&ctrl=order&task=pay&order_id=' . $data->order_id . $url_itemid);
            if ($config->get('force_ssl', 0) && strpos('https://', $pay_url) === false) {
                $pay_url = str_replace('http://', 'https://', $pay_url);
            }
            echo '<p><a href="' . $pay_url . '">' . JText::_('PAY_NOW') . '</a></p>';
        }
    }
    $content = ob_get_clean();
    $vars['ORDER_SUMMARY'] .= $content;
}
示例#4
0
文件: atos.php 项目: q0821/esportshop
    function _generateFiles(&$element)
    {
        $app = JFactory::getApplication();
        jimport('joomla.filesystem.file');
        jimport('joomla.filesystem.path');
        if ($element->payment_params->debug == 1) {
            $debug = 'YES';
        } else {
            $debug = 'NO';
        }
        if (empty($element->payment_params->merchant_id)) {
            return true;
        }
        $message = $this->_getLanguage();
        $logoPath = JURI::base(true) . $element->payment_params->logo_folder_relative;
        $logoPath = str_replace('administrator', '', $logoPath);
        $safe_mode = ini_get('safe_mode') == 1 || !strcasecmp(ini_get('safe_mode'), 'On');
        if (str_replace(JPATH_ROOT, '', $element->payment_params->upload_folder) != $element->payment_params->upload_folder) {
            $path = $element->payment_params->upload_folder;
        } else {
            $path = JPATH_ROOT . DS . $element->payment_params->upload_folder;
        }
        $lang =& JFactory::getLanguage();
        $locale = strtolower(substr($lang->get('tag'), 0, 2));
        $atos = '<?php
$_GET[\'option\']=\'com_hikashop\';
$_GET[\'tmpl\']=\'component\';
$_GET[\'ctrl\']=\'checkout\';
$_GET[\'task\']=\'notify\';
$_GET[\'notif_payment\']=\'atos\';
$_GET[\'lang\']=\'' . $locale . '\';
$_REQUEST[\'option\']=\'com_hikashop\';
$_REQUEST[\'tmpl\']=\'component\';
$_REQUEST[\'ctrl\']=\'checkout\';
$_REQUEST[\'task\']=\'notify\';
$_REQUEST[\'notif_payment\']=\'atos\';
$_REQUEST[\'lang\']=\'' . $locale . '\';
include(\'index.php\');
';
        $success = '<?php header("Location: ' . hikashop_frontendLink('index.php?option=com_hikashop&ctrl=checkout&task=after_end') . '");';
        $path = $this->_addLastSlash($path);
        $os = substr(PHP_OS, 0, 3);
        $os = strtolower($os);
        if ($os == 'win') {
            $logoPath = str_replace('/', DS, $logoPath);
        }
        $pathfile = 'DEBUG!' . $debug . '!' . "\r\n" . 'D_LOGO!' . $logoPath . '!' . "\r\n" . 'F_DEFAULT!' . $path . 'pc.x!' . "\r\n" . 'F_PARAM!' . $path . 'pc!' . "\r\n" . 'F_CERTIFICATE!' . $path . 'b' . DS . 'ct!' . "\r\n";
        $parcom = 'TEMPLATE!' . $element->payment_params->template . '!' . "\r\n";
        $pc = '';
        JFile::write($path . 'pc.x', $parcom);
        JFile::write($path . 'pc.' . $element->payment_params->merchant_id, $pc);
        JFile::write($path . 'pathfile', $pathfile);
        $rights = JPath::getPermissions(JPATH_ROOT);
        if ($rights[1] != 'w' && !JFile::exists(JPATH_ROOT . DS . 'atos.php')) {
            $app->enqueueMessage($message['autoresponse_cannot_be_created'], 'error');
            return true;
        }
        JFile::write(JPATH_ROOT . DS . 'atos.php', $atos);
        JFile::write(JPATH_ROOT . DS . 'success.php', $success);
    }
<?php

/**
 * @package	HikaShop for Joomla!
 * @version	2.6.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2015 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
global $Itemid;
$url_itemid = '';
if (!empty($Itemid)) {
    $url_itemid = '&Itemid=' . $Itemid;
}
$texts = array('MAIL_HEADER' => JText::_('HIKASHOP_MAIL_HEADER'), 'WAITLIST_TITLE' => JText::_('WAITLIST_EMAIL_TITLE'), 'WAITLIST_BEGIN_MESSAGE' => JText::_('WAITLIST_BEGIN_MESSAGE'), 'USER' => JText::_('HIKA_USER'), 'PRODUCT' => JText::_('PRODUCT'), 'HI_USER' => JText::sprintf('HI_CUSTOMER', ''), 'FOR_PRODUCT' => JText::sprintf('WAITLIST_FOR_PRODUCT', $data->product->product_name));
$admin_product_url = JRoute::_('administrator/index.php?option=com_hikashop&ctrl=product&task=edit&cid[]=' . $data->product->product_id, false, true);
$productClass = hikashop_get('class.product');
$productClass->addAlias($data->product);
$front_product_url = hikashop_frontendLink('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $data->product->product_id . '&name=' . $data->product->alias . $url_itemid);
$vars = array('LIVE_SITE' => HIKASHOP_LIVE, 'URL' => HIKASHOP_LIVE, 'USER_DETAILS' => htmlentities($data->user->name . ' ( ' . $data->user->user_email . ' )', ENT_COMPAT, 'UTF-8'), 'PRODUCT_DETAILS' => '<a href="' . $admin_product_url . '">' . strip_tags($data->product->product_name . ' (' . $data->product->product_code . ')') . '</a>', 'FRONT_PRODUCT_DETAILS' => '<a href="' . $front_product_url . '">' . strip_tags($data->product->product_name . ' (' . $data->product->product_code . ')') . '</a>');
示例#6
0
文件: form.php 项目: q0821/esportshop
</th>
							<th class="hikashop_order_item_action_title title titletoggle"><?php 
echo JText::_('ACTIONS');
?>
</th>
						</tr>
					</thead>
					<tbody>
<?php 
foreach ($this->order->products as $k => $product) {
    ?>
						<tr>
							<td class="hikashop_order_item_name_value">
								<span class="hikashop_order_item_name">
									<?php 
    echo $this->popup->display($product->order_product_name . ' ' . $product->order_product_code, $product->order_product_name . ' ' . $product->order_product_code, hikashop_frontendLink('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $product->product_id, true), 'hikashop_see_product_' . $product->product_id, 760, 480, '', '', 'link');
    $config =& hikashop_config();
    $manage = hikashop_isAllowed($config->get('acl_product_manage', 'all'));
    if ($manage) {
        ?>
										<a target="_blank" href="<?php 
        echo hikashop_completeLink('product&task=edit&cid[]=' . $product->product_id);
        ?>
">
											<img style="vertical-align:middle;" src="<?php 
        echo HIKASHOP_IMAGES;
        ?>
go.png" alt="<?php 
        echo JText::_('HIKA_EDIT');
        ?>
" />
示例#7
0
"><img src="<?php 
    echo HIKASHOP_IMAGES;
    ?>
delete.png" alt="<?php 
    echo JText::_('HIKA_DELETE');
    ?>
"/></a>
			</td>
		</tr>
<?php 
}
?>
	</tbody>
</table>
<?php 
echo $this->popup->display('', JText::_('COM_HIKASHOP_PRODUCT_FORM_VIEW_DEFAULT_TITLE'), hikashop_frontendLink('index.php?option=com_hikashop&ctrl=product&task=show&cid=0', true), 'hikashop_showproduct_popup', 750, 460, 'style="display:none;"', '', 'link');
?>
<script type="text/javascript">
<!--
window.orderMgr.showProduct = function(el) {
	window.hikashop.submitFct = function(data) { window.hikashop.closeBox(); };
	window.hikashop.openBox('hikashop_showproduct_popup', el.getAttribute('href'));
	return false;
}
//-->
</script>
<?php 
echo $this->popup->display('', JText::_('HIKA_MODIFY_ORDER_PRODUCT'), hikashop_completeLink('order&task=edit&subtask=products&order_id=' . $this->order->order_id . '&order_product_id=0', true), 'hikashop_editproduct_popup', 550, 350, 'style="display:none;"', '', 'link');
?>
<script type="text/javascript">
<!--
示例#8
0
文件: form.php 项目: q0821/esportshop
            }
        }
        if ($k == 1) {
            $k = 0;
        } else {
            $k = 1;
        }
        if ($cart->product_type == 'main' && $cart->cart_product_quantity == 0 || $cart->cart_product_quantity == 0) {
            continue;
        }
        ?>
								<tr>
									<td class="hikashop_order_item_name_value">
										<span class="hikashop_order_item_name">
											<?php 
        echo $this->popup->display($cart->product_name . ' ' . $cart->product_code, $cart->product_name . ' ' . $cart->product_code, hikashop_frontendLink('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $cart->product_id . '&tmpl=component'), 'hikashop_see_product_' . $cart->product_id, 760, 480, '', '', 'link');
        $config =& hikashop_config();
        $manage = hikashop_isAllowed($config->get('acl_product_manage', 'all'));
        if ($manage) {
            ?>
												<a target="_blank" href="<?php 
            echo hikashop_completeLink('product&task=edit&cid[]=' . $cart->product_id);
            ?>
">
													<img src="<?php 
            echo HIKASHOP_IMAGES;
            ?>
go.png" alt="<?php 
            echo JText::_('HIKA_EDIT');
            ?>
" />