Esempio n. 1
0
 /**
  * Send 'view_product' event
  */
 public static function ViewProductEvent($data)
 {
     $model = $data['model'];
     $template_data = array('id' => $model->firstVariant->getId(), 'name' => $model->getName(), 'url' => shop_url('product/' . $model->getUrl()), 'category_id' => $model->getCategories()->getData()[0]->getId());
     $convead_js = \CMSFactory\assetManager::create()->setData($template_data)->fetchTemplate('product');
     \CMSFactory\assetManager::create()->registerJsScript($convead_js, FALSE, 'before');
 }
        }
        if (!empty($_POST['status_send'])) {
            $plugin['order_status'][] = 'SENT';
        }
        if (!empty($_POST['status_back'])) {
            $plugin['order_status'][] = 'RETURN';
        }
        if (!empty($_POST['status_done'])) {
            $plugin['order_status'][] = 'COMPLETED';
        }
        $plugin['order_status'] = implode('-', $plugin['order_status']);
        if ($plugin['order_status'] == '') {
            $plugin['order_status'] = 'NEW-ORDER';
        }
        $sql = 'UPDATE ' . DB_PREPEND . "phpwcms_shop_orders SET order_status='" . aporeplace($plugin['order_status']) . "' ";
        $sql .= "WHERE order_id=" . intval($_POST['order_status']);
        if (_dbQuery($sql, 'UPDATE')) {
            set_status_message($BLM['shopprod_status_msg'], 'success');
        }
    }
    $sql = 'SELECT *, UNIX_TIMESTAMP(order_date) AS order_date_unix FROM ' . DB_PREPEND . 'phpwcms_shop_orders ';
    $sql .= "WHERE order_id = " . intval($_GET['show']);
    $plugin['data'] = _dbQuery($sql);
    if (isset($plugin['data'][0])) {
        $plugin['data'] = $plugin['data'][0];
        $plugin['data']['order_data'] = @unserialize($plugin['data']['order_data']);
    } else {
        headerRedirect(shop_url('controller=order', ''));
    }
    $BLM['shopprod_payby_INVOICE'] = $BLM['shopprod_payby_onbill'];
}
	<tr><td colspan="4" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>

<?php 
// loop listing available newsletters
$row_count = 0;
$sql = "SELECT C1.*, ";
$sql .= "IFNULL(CONCAT(C2.cat_name, ' / ', C1.cat_name), C1.cat_name) AS category FROM ";
$sql .= DB_PREPEND . 'phpwcms_categories C1 ';
$sql .= 'LEFT JOIN ' . DB_PREPEND . 'phpwcms_categories C2 ';
$sql .= 'ON C1.cat_pid=C2.cat_id ';
$sql .= 'WHERE ' . str_replace('cat_', 'C1.cat_', $_entry['query']) . ' ';
$sql .= 'ORDER BY C1.cat_sort DESC, C2.cat_sort DESC, category ASC ';
$sql .= 'LIMIT ' . ($_SESSION['detail_page'] - 1) * $_SESSION['list_count'] . ',' . $_SESSION['list_count'];
$data = _dbQuery($sql);
$_controller_link = shop_url('controller=cat');
if (isset($data[0]['cat_id'])) {
    foreach ($data as $row) {
        echo '<tr';
        if ($row_count % 2) {
            echo ' bgcolor="#F3F5F8"';
        }
        if (!$row['cat_pid']) {
            echo " onmouseover=\"Tip('" . $BL['be_admin_page_category'] . " ID: <b>" . $row["cat_id"] . "</b><br />" . $BL['be_cnt_sorting'] . ": <b>" . $row["cat_sort"] . "</b>');\"";
        }
        echo '>' . LF;
        echo '<td width="25" style="padding:2px 3px 2px 4px;">';
        echo '<img src="img/famfamfam/tag_';
        echo $row['cat_pid'] ? 'orange' : 'blue';
        echo '.gif" alt="' . $BLM['shop_category'] . '" /></td>' . LF;
        echo '<td class="dir" width="85%">';
                <?php 
        }
        ?>
                <!-- End. article & variant name & brand name -->
                <?php 
        if (!$opi_vertical) {
            ?>
                    <?php 
            if ($p->enable_comments && intval($Comments[$p->getId()]) !== 0) {
                ?>
                        <div class="frame-star f-s_0">
                            <?php 
                $CI->load->module('star_rating')->show_star_rating($p, false);
                ?>
                            <a href="<?php 
                echo shop_url('product/' . $p->url . '#comment');
                ?>
" class="count-response">
                                <?php 
                echo lang("Отзывы", 'lightVertical');
                ?>
                                <?php 
                echo intval($Comments[$p->getId()]);
                ?>
                            </a>
                        </div>
                    <?php 
            }
            ?>
                <?php 
        }
                </div>
                <div class="head-work">
                    <?php 
echo widget('work');
?>
                </div>
                <!--                End. Contacts block-->
                <div class="frame-search-cleaner">
                    <!--                Start. Include cart data template-->

                    <!--                    End. Include cart data template-->
                    <!--                Start. Show search form-->
                    <div class="frame-search-form">
                        <div class="p_r">
                            <form name="search" method="get" action="<?php 
echo shop_url('search');
?>
">
                                <span class="btn-search">
                                    <button type="submit"><span class="icon_search"></span><span class="text-el"><?php 
echo lang('Найти', 'lightVertical');
?>
</span></button>
                                </span>
                                <div class="frame-search-input">
                                    <input type="text" class="input-search" id="inputString" name="text" autocomplete="off" value="<?php 
if (strpos($CI->uri->uri_string, 'search') !== false) {
    echo htmlspecialchars($_GET['text']);
}
?>
"  placeholder="<?php 
Esempio n. 6
0
		<th style="text-align:right;padding-right:5px;">&nbsp;<?php 
echo $BLM['th_price'];
?>
&nbsp;</th>
		<th>&nbsp;</th>
	</tr>


<?php 
// loop listing available newsletters
$row_count = 0;
$sql = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_shop_products WHERE ' . $_entry['query'] . ' ';
$sql .= 'LIMIT ' . ($_SESSION['detail_page'] - 1) * $_SESSION['list_count'] . ',' . $_SESSION['list_count'];
$data = _dbQuery($sql);
if ($data) {
    $_controller_link = shop_url('controller=prod');
    foreach ($data as $row) {
        echo '<tr' . ($row_count % 2 ? ' class="adsAltRow"' : '') . '>' . LF;
        echo '<td width="25" style="padding:2px 3px 2px 4px;">';
        echo '<img src="img/famfamfam/package.gif" alt="' . $BLM['shop_product'] . '" /></td>' . LF;
        echo '<td class="dir">';
        if (SHOP_FELANG_SUPPORT) {
            $row['shopprod_lang'] = html_specialchars(strtolower($row['shopprod_lang']));
            echo '<img src="img/famfamfam/lang/' . ($row['shopprod_lang'] ? $row['shopprod_lang'] : 'all') . '.png" alt="' . $row['shopprod_lang'] . '" />';
        }
        echo '&nbsp;' . html_specialchars($row['shopprod_ordernumber']) . "</td>\n";
        echo '<td class="dir">&nbsp;' . html_specialchars($row['shopprod_model']) . "</td>\n";
        echo '<td class="dir">&nbsp;' . html_specialchars($row['shopprod_name1']) . "</td>\n";
        echo '<td class="dir listNumber">&nbsp;' . html_specialchars(number_format(round($row['shopprod_price'], 2), 2, $BLM['dec_point'], $BLM['thousands_sep'])) . "&nbsp;</td>\n";
        echo '<td align="right" nowrap="nowrap" class="button_td">';
        echo '<a href="' . $_controller_link . '&amp;edit=' . $row["shopprod_id"] . '">';
Esempio n. 7
0
	<tr>
		<td class="chatlist" style="padding-top:7px;"><?php 
    echo $BLM['shopprod_email_shop'];
    ?>
:&nbsp;</td>
		<td class="email"><pre><?php 
    // only a slight fix
    if (PHPWCMS_CHARSET !== 'utf-8' && strpos($plugin['data']['order_data']['mail_self'], 'Ã') !== false) {
        $plugin['data']['order_data']['mail_self'] = mb_convert_encoding($plugin['data']['order_data']['mail_self'], PHPWCMS_CHARSET, 'utf-8');
    }
    echo html($plugin['data']['order_data']['mail_self']);
    ?>
</pre></td>
	</tr>

<?php 
}
?>

</table>

</div>

<input type="button" class="button" style="margin-top:5px;" value="<?php 
echo $BL['be_func_struct_close'];
?>
" onclick="document.location.href='<?php 
echo shop_url('controller=order');
?>
'" />
            $plugin['data']['shopprod_filecaption'] = array();
            $plugin['data']['shopprod_url'] = isset($plugin['data']['shopprod_var']['url']) ? $plugin['data']['shopprod_var']['url'] : '';
        } else {
            headerRedirect(shop_url('controller=prod', ''));
        }
    }
    $sql = 'SELECT C1.cat_id, C1.cat_name, C1.cat_pid, C1.cat_status, ';
    $sql .= "IFNULL(CONCAT(C2.cat_name, '>', C1.cat_name), C1.cat_name) AS category ";
    $sql .= 'FROM ' . DB_PREPEND . 'phpwcms_categories C1 ';
    $sql .= 'LEFT JOIN ' . DB_PREPEND . 'phpwcms_categories C2 ';
    $sql .= 'ON C1.cat_pid=C2.cat_id ';
    $sql .= "WHERE C1.cat_type='module_shop' AND C1.cat_status!=9 ";
    $sql .= 'ORDER BY category';
    $plugin['data']['categories'] = _dbQuery($sql);
} elseif ($action == 'status') {
    list($plugin['data']['shopprod_id'], $plugin['data']['shopprod_status']) = explode('-', $_GET['status']);
    $plugin['data']['shopprod_id'] = intval($plugin['data']['shopprod_id']);
    $plugin['data']['shopprod_status'] = empty($plugin['data']['shopprod_status']) ? 1 : 0;
    $sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_shop_products SET ';
    $sql .= "shopprod_status = " . $plugin['data']['shopprod_status'] . " ";
    $sql .= "WHERE shopprod_id = " . $plugin['data']['shopprod_id'];
    _dbQuery($sql, 'UPDATE');
    headerRedirect(shop_url('controller=prod', ''));
} elseif ($action == 'delete') {
    $plugin['data']['shopprod_id'] = intval($_GET['delete']);
    $sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_shop_products SET ';
    $sql .= "shopprod_status = 9 ";
    $sql .= "WHERE shopprod_id = " . $plugin['data']['shopprod_id'];
    _dbQuery($sql, 'UPDATE');
    headerRedirect(shop_url('controller=prod', ''));
}
                        } else {
                            ?>
                                            href="<?php 
                            echo shop_url('brand/' . strtolower($model->getUrl()) . '/' . $subItem['id']);
                            ?>
"
                                            <?php 
                        }
                        ?>
                                            >-->
                                            <a rel="nofollow" data-id="<?php 
                        echo $subItem['id'];
                        ?>
"
                                               href="<?php 
                        echo shop_url('brand/' . strtolower($model->getUrl()) . '/' . $subItem['id']);
                        ?>
"
                                            >
                                            <span class="text-el"><?php 
                        echo $subItem['name'];
                        ?>
</span>
                                            <span class="count">(<?php 
                        echo $subItem['count'];
                        ?>
)</span>
                                        </a>
                                        <?php 
                    }
                    ?>
Esempio n. 10
0
&nbsp;</th>
		<th>&nbsp;<?php 
echo $BLM['th_payment'];
?>
</th>
		<th>&nbsp;&nbsp;&nbsp;</th>
	</tr>


<?php 
// loop listing available orders
$BLM['shopprod_payby_INVOICE'] = $BLM['shopprod_payby_onbill'];
$sql = "SELECT *, DATE_FORMAT(order_date,'%d.%m.%Y') AS order_fdate FROM " . DB_PREPEND . "phpwcms_shop_orders WHERE ";
$sql .= "order_status NOT IN ('ARCHIVED', 'CLOSED') ORDER BY order_date DESC";
$data = _dbQuery($sql);
$_controller_link = shop_url('controller=order');
if ($data) {
    foreach ($data as $key => $row) {
        echo '<tr' . ($key % 2 ? ' class="adsAltRow"' : '') . '>' . LF;
        echo '<td width="25" style="padding:2px 3px 2px 4px;">';
        echo '<a href="' . $_controller_link . '&amp;show=' . $row["order_id"] . '">';
        echo '<img src="img/famfamfam/cart_go.gif" alt="' . $BLM['shop_order'] . '" border="0" />';
        echo '</a></td>' . LF;
        echo '<td class="dir nowrap" width="13%">';
        if (SHOP_FELANG_SUPPORT) {
            $row['order_data'] = @unserialize($row['order_data']);
            $row['shopprod_lang'] = empty($row['order_data']['lang']) ? '' : html_specialchars(strtolower($row['order_data']['lang']));
            echo '<img src="img/famfamfam/lang/' . ($row['shopprod_lang'] ? $row['shopprod_lang'] : 'all') . '.png" alt="' . $row['shopprod_lang'] . '" style="position:relative;top:1px;margin:0 3px 0 3px;" />';
        }
        echo html_specialchars($row['order_number']) . "&nbsp;</td>\n";
        echo '<td class="dir" align="right" width="13%">&nbsp;' . html_specialchars($row['order_fdate']) . "&nbsp;</td>\n";
<?php

if ($compare = $CI->session->userdata('shopForCompare')) {
    ?>
    <?php 
    $count = count($compare);
} else {
    ?>
    <?php 
    $count = 0;
}
?>
<div class="compare-list-btn tinyCompareList">
    <button data-href="<?php 
echo shop_url('compare');
?>
" data-drop=".drop-info-compare" data-place="inherit" data-overlay-opacity="0">
        <span class="icon_compare_list"></span>
        <span class="text-compare-list">
            <span class="js-empty empty" <?php 
if ($count == 0) {
    ?>
style="display: inline"<?php 
}
?>
>
                <span class="text-el"><?php 
echo lang('Товары на сравнение', 'lightVertical');
?>
 </span>
                <span class="text-el">(</span>
                <div class="title-h3 title"><?php 
    echo lang('Категории', 'lightVertical');
    ?>
:</div>
            </div>
        </div>
        <div class="inside-padd">
            <nav>
                <ul class="nav nav-vertical nav-category">
                    <?php 
    if (is_true_array($category->getChildsByParentIdI18n($category->getId()))) {
        foreach ($category->getChildsByParentIdI18n($category->getId()) as $key => $value) {
            ?>
                        <li>
                            <a href="<?php 
            echo shop_url('category/' . $value->getFullPath());
            ?>
"><?php 
            echo $value->getName();
            ?>
</a>
                        </li>
                    <?php 
        }
    }
    ?>
                </ul>
            </nav>
        </div>
    </div>
<?php 
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
?>
<h1 class="title" style="margin-bottom:10px"><?php 
echo $BLM['cat_edit'];
if ($plugin['data']['cat_id'] && empty($plugin['data']['cat_pid'])) {
    echo ' <span style="font-weight:normal">[ID: ' . $plugin['data']['cat_id'] . ']</span>';
}
?>
</h1>

<form action="<?php 
echo shop_url(array('controller=cat', 'edit=' . $plugin['data']['cat_id']));
?>
" method="post" style="background:#F3F5F8;border-top:1px solid #92A1AF;border-bottom:1px solid #92A1AF;margin:0 0 5px 0;padding:10px 8px 15px 8px">
<input type="hidden" name="cat_id" value="<?php 
echo $plugin['data']['cat_id'];
?>
" />
<table border="0" cellpadding="0" cellspacing="0" width="100%" summary="">

	<tr> 
		<td align="right" class="chatlist"><?php 
echo $BL['be_cnt_last_edited'];
?>
:&nbsp;</td>
		<td class="v10" width="410"><?php 
echo html_specialchars(date($BL['be_fprivedit_dateformat'], $plugin['data']['cat_changedate']));
        $plugin['data']['cat_status'] = 1;
        $plugin['data']['cat_sort'] = 0;
    } else {
        $sql = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_categories WHERE ';
        $sql .= "cat_type='module_shop' AND cat_id = " . $plugin['data']['cat_id'] . ' LIMIT 1';
        $plugin['data'] = _dbQuery($sql);
        if (isset($plugin['data'][0])) {
            $plugin['data'] = $plugin['data'][0];
            $plugin['data']['cat_changedate'] = strtotime($plugin['data']['cat_changedate']);
        } else {
            headerRedirect(shop_url('controller=cat', ''));
        }
    }
} elseif ($action == 'status') {
    list($plugin['data']['cat_id'], $plugin['data']['cat_status']) = explode('-', $_GET['status']);
    $plugin['data']['cat_id'] = intval($plugin['data']['cat_id']);
    $plugin['data']['cat_status'] = empty($plugin['data']['cat_status']) ? 1 : 0;
    $sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_categories SET ';
    $sql .= "cat_status = " . $plugin['data']['cat_status'] . " ";
    $sql .= "WHERE cat_type='module_shop' AND cat_id = " . $plugin['data']['cat_id'];
    _dbQuery($sql, 'UPDATE');
    headerRedirect(shop_url('controller=cat', ''));
} elseif ($action == 'delete') {
    $plugin['data']['cat_id'] = intval($_GET['delete']);
    $sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_categories SET ';
    $sql .= "cat_status = 9 ";
    $sql .= "WHERE cat_type='module_shop' AND ";
    $sql .= "(cat_id = " . $plugin['data']['cat_id'] . " OR cat_pid = " . $plugin['data']['cat_id'] . ")";
    _dbQuery($sql, 'UPDATE');
    headerRedirect(shop_url('controller=cat', ''));
}
    ?>
" data-data='{"product_id": <?php 
    echo $model->getId();
    ?>
}' data-selector=".inside-padd > .text"><?php 
    echo lang('Полное описание', 'lightVertical');
    ?>
</button></li>
    <?php 
}
?>
    <?php 
if ($accessories) {
    ?>
    <li><button data-href="#fourth" data-source="<?php 
    echo shop_url('product_api/getAccessories');
    ?>
" data-data='{"product_id": <?php 
    echo $model->getId();
    ?>
, "arrayVars": <?php 
    echo json_encode(array('opi_defaultItem' => true));
    ?>
}' data-selector=".inside-padd > .items"><?php 
    echo lang('Аксессуары', 'lightVertical');
    ?>
</button></li>
    <?php 
}
?>
    <!--Output of the block comments-->
Esempio n. 16
0
 public static function addProductWhenDelete($arg)
 {
     $models = $arg['model'];
     $ci =& get_instance();
     foreach ($models as $model) {
         $array = array('trash_id' => $model->category_id, 'trash_url' => 'shop/product/' . $model->url, 'trash_redirect_type' => 'category', 'trash_type' => '301', 'trash_redirect' => shop_url('category/' . $model->getMainCategory()->getFullPath()));
         $ci->db->insert('trash', $array);
     }
 }
Esempio n. 17
0
// ----------------------------------------------------------------
$BE['HEADER']['optionselect.js'] = getJavaScriptSourceLink('include/inc_js/optionselect.js');
if (!isset($plugin['data']['shopprod_duplicate'])) {
    $plugin['data']['shopprod_duplicate'] = 0;
}
if (!isset($plugin['data']['shopprod_overwrite_meta'])) {
    $plugin['data']['shopprod_overwrite_meta'] = 1;
}
?>
<h1 class="title" style="margin-bottom:10px"><?php 
echo $BLM['prod_edit'];
?>
</h1>

<form action="<?php 
echo shop_url(array('controller=prod', 'edit=' . $plugin['data']['shopprod_id']));
?>
" method="post" class="editform" onsubmit="selectAllOptions(this.shopprod_images);selectAllOptions(this.shopprod_files);">

<input type="hidden" name="shopprod_id" value="<?php 
echo $plugin['data']['shopprod_id'];
?>
" /><?php 
if (SHOP_FELANG_SUPPORT === false) {
    ?>
<input type="hidden" name="shopprod_lang" value="<?php 
    echo $plugin['data']['shopprod_lang'];
    ?>
" /><?php 
}
?>
 *
 * @author Oliver Georgi <*****@*****.**>
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
?>
<form action="<?php 
echo shop_url('controller=pref');
?>
" method="post" class="editform1">

<table border="0" cellpadding="0" cellspacing="0" width="100%" summary="">

	<!-- Frontend Language Support -->
	<tr>
		<td align="right" class="chatlist tdtop5"><?php 
echo $BL['be_profile_label_lang'];
?>
:&nbsp;</td>
		<td><table summary="" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td><input type="checkbox" name="pref_felang" id="pref_felang" value="1"<?php 
is_checked('1', $plugin['data']['shop_pref_felang']);
Esempio n. 19
0
 public function processPayment()
 {
     $PSystem_ID = $_GET['PSystem_ID'];
     $order_key = $this->order->getKey();
     $order_id = $this->order->getId();
     $paymentMethod = $this->paymentMethod->getId();
     $CurrencyId = $this->paymentMethod->getCurrencyId();
     $data = $this->loadSettings();
     $MerchantGuid = $data['MerchantGuid'];
     $MerchantSecretKey = $data['MerchantSecretKey'];
     $currencies = SCurrenciesQuery::create()->find();
     foreach ($currencies as $c) {
         $this->currencies[$c->getId()] = $c;
     }
     $currency = $this->currencies[$CurrencyId];
     $currency_Code = $currency->code;
     $currency_Rate = $currency->getRate();
     $TotalPrice = 0;
     $PSystem_ID = isset($PSystem_ID) ? $PSystem_ID : $this->getPSI();
     $send_data['SelectedPaySystemId'] = $PSystem_ID;
     $db = \CI::$APP->db;
     $db->where('shop_orders_products.order_id', $order_id);
     $db->join('shop_products', 'shop_orders_products.product_id=shop_products.id', 'left outer');
     $Products = $db->get('shop_orders_products')->result_array();
     foreach ($Products as $orderProduct) {
         $product_item = array();
         $product_item['ImageUrl'] = productImageUrl($orderProduct['mainModImage']);
         $product_item['ProductItemsNum'] = number_format($orderProduct['quantity'], 2, '.', '');
         $product_item['ProductName'] = $orderProduct['product_name'];
         $product_item['ProductPrice'] = number_format($orderProduct['price'] * $currency_Rate, 2, '.', '');
         $product_item['ProductId'] = $orderProduct['product_id'];
         $send_data['Products'][] = $product_item;
         $TotalPrice += $product_item['ProductPrice'] * $product_item['ProductItemsNum'];
         $product_count += $product_item['ProductItemsNum'];
     }
     $TotalPrice = number_format($TotalPrice, 2, '.', '');
     $product_count = number_format($product_count, 2, '.', '');
     //Инициализация
     if ($PSystem_ID && !$_GET['back']) {
         if ($user_id = $this->order->getUserId()) {
             $profile = SUserProfileQuery::create()->filterById($user_id)->findone();
         } else {
             $user_id = 1;
         }
         $send_data['PaymentDetails']['MerchantInternalPaymentId'] = $order_id;
         $send_data['PaymentDetails']['MerchantInternalUserId'] = $user_id;
         $send_data['PaymentDetails']['EMail'] = $this->order->user_email;
         $send_data['PaymentDetails']['PhoneNumber'] = $profile->getPhone();
         $send_data['PaymentDetails']['Description'] = "Оплата заказа {$order_id}";
         $send_data['PaymentDetails']['DeliveryType'] = $this->order->getSDeliveryMethods()->getName();
         $send_data['PaymentDetails']['CustomMerchantInfo'] = '';
         $send_data['PaymentDetails']['StatusUrl'] = shop_url("cart/view/{$order_key}?back=1&pm={$paymentMethod}");
         $send_data['PaymentDetails']['ReturnUrl'] = shop_url("cart/view/{$order_key}?back=1");
         $send_data['PaymentDetails']['BuyerLastname'] = '';
         $send_data['PaymentDetails']['BuyerFirstname'] = $this->order->user_full_name;
         $send_data['PaymentDetails']['BuyerPatronymic'] = '';
         $send_data['PaymentDetails']['BuyerStreet'] = $profile->getAddress();
         $send_data['PaymentDetails']['BuyerCity'] = '';
         $send_data['PaymentDetails']['BuyerZone'] = '';
         $send_data['PaymentDetails']['BuyerZip'] = '';
         $send_data['PaymentDetails']['BuyerCountry'] = '';
         $send_data['PaymentDetails']['DeliveryLastname'] = '';
         $send_data['PaymentDetails']['DeliveryFirstname'] = $this->order->user_full_name;
         $send_data['PaymentDetails']['DeliveryPatronymic'] = '';
         $send_data['PaymentDetails']['DeliveryStreet'] = $profile->getAddress();
         $send_data['PaymentDetails']['DeliveryCity'] = '';
         $send_data['PaymentDetails']['DeliveryZone'] = '';
         $send_data['PaymentDetails']['DeliveryZip'] = '';
         $send_data['PaymentDetails']['DeliveryCountry'] = '';
         $signature_s = $MerchantGuid . $TotalPrice . $product_count . $send_data['PaymentDetails']['MerchantInternalUserId'] . $send_data['PaymentDetails']['MerchantInternalPaymentId'] . $PSystem_ID . $data['MerchantSecretKey'];
         if (stristr($currency_Code, 'R') === 0) {
             $currency_Code = 'RUB';
         } elseif (stristr($currency_Code, 'UA') === 0) {
             $currency_Code = 'UAH';
         } elseif (stristr($currency_Code, 'US') === 0) {
             $currency_Code = 'USD';
         } elseif (stristr($currency_Code, 'E') === 0) {
             $currency_Code = 'EUR';
         }
         $send_data['Signature'] = md5($signature_s);
         $send_data['MerchantGuid'] = $MerchantGuid;
         $send_data['Currency'] = $currency_Code;
         $res = $this->Treasurer_Request($this->URL_CreatePayment, $send_data);
         $data = json_decode($res, 1);
         $ErrorCode = $data['ErrorCode'];
         $ExternalForm = $data['ExternalForm'];
         if ($ErrorCode) {
             die("ErrorCode={$ErrorCode}");
         }
         $ExternalForm = base64_decode($ExternalForm);
         die($ExternalForm);
     } else {
         //CallBack оплаты
         $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents('php://input');
         $req_data = json_decode($HTTP_RAW_POST_DATA, 1);
         $MerchantInternalPaymentId = abs(intval($req_data['MerchantInternalPaymentId']));
         $Signature = strtoupper($req_data['Signature']);
         $Sum = $req_data['Sum'];
         $ErrorCode = $req_data['ErrorCode'];
         $MerchantInternalUserId = $req_data['MerchantInternalUserId'];
         $CustomMerchantInfo = $req_data['CustomMerchantInfo'];
         if (!$MerchantInternalPaymentId) {
             return false;
         }
         if ($ErrorCode) {
             return false;
         }
         $Sum = number_format($Sum, 2, '.', '');
         //857.00 => 857 WTF!!!
         $signature_true = strtoupper(md5($ErrorCode . $order_id . $MerchantInternalUserId . $Sum . $CustomMerchantInfo . $MerchantSecretKey));
         if ($Signature != $signature_true) {
             return false;
         }
         if ($this->order->getPaid() == true) {
             return ERROR_ORDER_PAID_BEFORE;
         }
         $this->setOrderPaid();
         die("OK{$order_id}");
     }
 }