-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.php
35 lines (28 loc) · 1.28 KB
/
run.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$ecwid_html_index = $ecwid_title = '';
if (isset($_GET['_escaped_fragment_'])) {
$catalog = new EcwidCatalog($ecwid_store_id, ecwid_page_url());
$params = $catalog->parse_escaped_fragment($_GET['_escaped_fragment_']);
if (isset($params['mode']) && in_array($params['mode'], array('product', 'category'))) {
if ($params['mode'] == 'product') {
$ecwid_html_index = $catalog->get_product($params['id']);
$ecwid_title = $catalog->get_product_name($params['id']);
$ecwid_description = $catalog->get_product_description($params['id']);
} elseif ($params['mode'] == 'category') {
$ecwid_html_index = $catalog->get_category($params['id']);
$ecwid_default_category_str = ',"defaultCategoryId=' . $params['id'] . '"';
$ecwid_title = $catalog->get_category_name($params['id']);
$ecwid_description = $catalog->get_category_description($params['id']);
}
$ecwid_html_index .= <<<HTML
<script type="text/javascript">
if (!document.location.hash) {
document.location.hash = '!$_GET[_escaped_fragment_]';
}
</script>
HTML;
$ecwid_description = ecwid_prepare_meta_description($ecwid_description);
} else {
$ecwid_html_index = $catalog->get_category(0);
}
}