3 |
21 |
22 | {% if error.warning %}
23 |
24 |
25 | {{ error.warning }}
26 | ×
27 |
28 | {% endif %}
29 |
30 |
31 |
43 |
44 | {{ footer }}
45 |
--------------------------------------------------------------------------------
/catalog/controller/extension/d_vuefront/common/country.php:
--------------------------------------------------------------------------------
1 | load->model('extension/'.$this->codename.'/country');
10 | $information_info = $this->model_extension_d_vuefront_country->getCountry($args['id']);
11 |
12 | return array(
13 | 'id' => $information_info['country_id'],
14 | 'name' => $information_info['name']
15 | );
16 | }
17 |
18 | public function getList($args) {
19 | $this->load->model('extension/'.$this->codename.'/country');
20 |
21 | $countries = array();
22 |
23 | $filter_data = array(
24 | 'sort' => $args['sort'],
25 | 'order' => $args['order']
26 | );
27 |
28 | if($args['size'] != -1) {
29 | $filter_data['start'] = ($args['page'] - 1) * $args['size'];
30 | $filter_data['limit'] = $args['size'];
31 | }
32 |
33 | if (!empty($args['search'])) {
34 | $filter_data['filter_name'] = $args['search'];
35 | }
36 |
37 | $country_total = $this->model_extension_d_vuefront_country->getTotalCountries($filter_data);
38 |
39 | $results = $this->model_extension_d_vuefront_country->getCountries($filter_data);
40 |
41 | if($args['size'] == -1) {
42 | $args['size'] = $country_total;
43 | }
44 |
45 | foreach ($results as $result) {
46 | $countries[] = $this->get(array('id' => $result['country_id']));
47 | }
48 |
49 | return array(
50 | 'content' => $countries,
51 | 'first' => $args['page'] === 1,
52 | 'last' => $args['page'] === ceil($country_total / $args['size']),
53 | 'number' => (int)$args['page'],
54 | 'numberOfElements' => count($countries),
55 | 'size' => (int)$args['size'],
56 | 'totalPages' => (int)ceil($country_total / $args['size']),
57 | 'totalElements' => (int)$country_total,
58 | );
59 | }
60 | }
--------------------------------------------------------------------------------
/catalog/controller/extension/d_vuefront/common/language.php:
--------------------------------------------------------------------------------
1 | load->model('localisation/language');
10 |
11 | $languages = array();
12 |
13 | $results = $this->model_localisation_language->getLanguages();
14 |
15 | $siteUrl = $this->request->server['HTTPS'] ? $this->config->get('config_ssl') : $this->config->get('config_url');
16 |
17 | foreach ($results as $result) {
18 | if ($result['status']) {
19 | $code = $result['code'];
20 |
21 | if(VERSION < '2.2.0.0') {
22 | $code = $code == 'en' ? 'en-gb' : $code;
23 | $code = $code == 'ru' ? 'ru-ru' : $code;
24 | }
25 | $languages[] = array(
26 | 'name' => $result['name'],
27 | 'code' => $code,
28 | 'image' => $siteUrl."catalog/language/".$result['code']."/".$result['code'].".png",
29 | 'active' => $this->session->data['language'] == $result['code']
30 | );
31 | }
32 | }
33 |
34 | return $languages;
35 | }
36 |
37 | public function edit($args)
38 | {
39 | $this->session->data['language'] = $args['code'];
40 |
41 | return $this->get();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/catalog/controller/extension/d_vuefront/store/compare.php:
--------------------------------------------------------------------------------
1 | load->model("extension/".$this->codename."/compare");
10 | $compare = array();
11 | $results = $this->model_extension_d_vuefront_compare->getCompare();
12 |
13 | foreach ($results as $product_id) {
14 | $compare[] = $this->vfload->data('store/product/get', array('id' => $product_id));
15 | }
16 |
17 | return $compare;
18 | }
19 |
20 | public function add($args)
21 | {
22 | $this->load->model("extension/".$this->codename."/compare");
23 | $this->request->post['product_id'] = $args['id'];
24 |
25 | $this->model_extension_d_vuefront_compare->addCompare($args['id']);
26 |
27 |
28 | return $this->get(array());
29 | }
30 |
31 | public function remove($args)
32 | {
33 | $this->load->model("extension/".$this->codename."/compare");
34 | $this->model_extension_d_vuefront_compare->deleteCompare($args['id']);
35 |
36 | return $this->get(array());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/catalog/controller/extension/d_vuefront/store/currency.php:
--------------------------------------------------------------------------------
1 | load->model('localisation/currency');
10 |
11 | $currencies = array();
12 |
13 | $results = $this->model_localisation_currency->getCurrencies();
14 |
15 | foreach ($results as $result) {
16 | if ($result['status']) {
17 | $currencies[] = array(
18 | 'title' => $result['title'],
19 | 'name' => $result['title'],
20 | 'code' => $result['code'],
21 | 'symbol_left' => $result['symbol_left'],
22 | 'symbol_right' => $result['symbol_right'],
23 | 'active' => $this->session->data['currency'] == $result['code']
24 | );
25 | }
26 | }
27 |
28 | return $currencies;
29 | }
30 |
31 | public function edit($args)
32 | {
33 | $this->session->data['currency'] = $args['code'];
34 |
35 | unset($this->session->data['shipping_method']);
36 | unset($this->session->data['shipping_methods']);
37 |
38 | return $this->get();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/catalog/controller/extension/d_vuefront/store/review.php:
--------------------------------------------------------------------------------
1 | load->model('catalog/review');
10 |
11 | $reviewData = array(
12 | 'name' => $args['author'],
13 | 'text' => $args['content'],
14 | 'rating' => $args['rating']
15 | );
16 |
17 | $this->model_catalog_review->addReview($args['id'], $reviewData);
18 |
19 | return $this->vfload->data('store/product/get', $args);
20 | }
21 |
22 | public function get($data)
23 | {
24 | $this->load->model('catalog/review');
25 | $product = $data['parent'];
26 |
27 | $results = $this->model_catalog_review->getReviewsByProductId($product['id']);
28 |
29 | $reviews = array();
30 |
31 | foreach ($results as $result) {
32 | $reviews[] = array(
33 | 'author' => $result['author'],
34 | 'author_email' => '',
35 | 'content' => nl2br($result['text']),
36 | 'rating' => (float)$result['rating'],
37 | 'created_at' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
38 |
39 | );
40 | }
41 |
42 | return $reviews;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/catalog/controller/extension/d_vuefront/store/wishlist.php:
--------------------------------------------------------------------------------
1 | load->model("extension/".$this->codename."/wishlist");
10 | $wishlist = array();
11 | $results = $this->model_extension_d_vuefront_wishlist->getWishlist();
12 |
13 | foreach ($results as $product_id) {
14 | $wishlist[] = $this->vfload->data('store/product/get', array('id' => $product_id));
15 | }
16 |
17 | return $wishlist;
18 | }
19 |
20 | public function add($args)
21 | {
22 | $this->request->post['product_id'] = $args['id'];
23 |
24 | $this->load->controller('account/wishlist/add');
25 |
26 | return $this->getList(array());
27 | }
28 |
29 | public function remove($args)
30 | {
31 | $this->load->model("extension/".$this->codename."/wishlist");
32 | $this->model_extension_d_vuefront_wishlist->deleteWishlist($args['id']);
33 |
34 | return $this->getList(array());
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/catalog/controller/extension/module/d_vuefront_schema/schemaAdmin.graphql:
--------------------------------------------------------------------------------
1 | type CustomerResult {
2 | content: [Customer]
3 | first: Boolean
4 | last: Boolean
5 | number: Int
6 | numberOfElements: Int
7 | size: Int
8 | totalPages: Int
9 | totalElements: Int
10 | }
11 | type OptionResult {
12 | content: [Option]
13 | first: Boolean
14 | last: Boolean
15 | number: Int
16 | numberOfElements: Int
17 | size: Int
18 | totalPages: Int
19 | totalElements: Int
20 | }
21 |
22 | type Option {
23 | id: String
24 | name: String
25 | type: String
26 | sort_order: Int
27 | values: [OptionValue]
28 | }
29 |
30 | input InputAppSetting {
31 | eventUrl: String
32 | jwt: String
33 | authUrl: String
34 | }
35 |
36 | type AppSetting {
37 | codename: String
38 | authUrl: String
39 | eventUrl: String
40 | jwt: String
41 | }
42 |
43 | type RootQueryType {
44 | customersList(page: Int = 1, size: Int = 10, search: String, sort: String = "email", order: String = "ASC"): CustomerResult
45 | customer(id: String): Customer
46 | option(id: String): Option
47 | optionsList(page: Int = 1, size: Int = 10, search: String, sort: String = "sort_order", order: String = "ASC"): OptionResult
48 | }
49 | type RootMutationType {
50 | updateApp(name: String, settings: InputAppSetting): AppSetting
51 | updateSite(number: Int): Boolean
52 | }
53 |
--------------------------------------------------------------------------------
/catalog/model/extension/d_vuefront/compare.php:
--------------------------------------------------------------------------------
1 | session->data['compare'])) {
9 | $result = $this->session->data['compare'];
10 | }
11 |
12 | return $result;
13 | }
14 |
15 | public function addCompare($product_id)
16 | {
17 | $this->load->model('catalog/product');
18 |
19 | $product_info = $this->model_catalog_product->getProduct($product_id);
20 |
21 | if ($product_info) {
22 | if (!isset($this->session->data['compare'])) {
23 | $this->session->data['compare'] = array();
24 | }
25 | if (!in_array($product_id, $this->session->data['compare'])) {
26 | if (count($this->session->data['compare']) >= 4) {
27 | array_shift($this->session->data['compare']);
28 | }
29 | $this->session->data['compare'][] = (int)$product_id;
30 | }
31 | }
32 | }
33 |
34 | public function deleteCompare($product_id)
35 | {
36 | if (!empty($this->session->data['compare'])) {
37 | $key = array_search($product_id, $this->session->data['compare']);
38 |
39 | if ($key !== false) {
40 | unset($this->session->data['compare'][$key]);
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/catalog/view/javascript/d_vuefront/css/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | overflow: hidden;
6 | }
7 |
8 | #root {
9 | height: 100%;
10 | }
11 |
12 | body {
13 | font-family: 'Open Sans', sans-serif;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | color: rgba(0,0,0,.8);
17 | line-height: 1.5;
18 | height: 100vh;
19 | letter-spacing: 0.53px;
20 | margin-right: -1px !important;
21 | }
22 |
23 | html, body, p, a, h1, h2, h3, h4, ul, pre, code {
24 | margin: 0;
25 | padding: 0;
26 | color: inherit;
27 | }
28 |
29 | a:active, a:focus, button:focus, input:focus {
30 | outline: none;
31 | }
32 |
33 | input, button, submit {
34 | border: none;
35 | }
36 |
37 | input, button, pre {
38 | font-family: 'Open Sans', sans-serif;
39 | }
40 |
41 | code {
42 | font-family: Consolas, monospace;
43 | }
44 |
45 | /*# sourceMappingURL=index.css.map*/
--------------------------------------------------------------------------------
/catalog/view/javascript/d_vuefront/css/index.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../index.css"],"names":[],"mappings":"AAAA;EACE,SAAS;EACT,UAAU;EACV,uBAAuB;EACvB,gBAAgB;AAClB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,oCAAoC;EACpC,mCAAmC;EACnC,kCAAkC;EAClC,qBAAqB;EACrB,gBAAgB;EAChB,aAAa;EACb,sBAAsB;EACtB,6BAA6B;AAC/B;;AAEA;EACE,SAAS;EACT,UAAU;EACV,cAAc;AAChB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,gCAAgC;AAClC","file":"static/css/index.css","sourcesContent":["body {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n overflow: hidden;\n}\n\n#root {\n height: 100%;\n}\n\nbody {\n font-family: 'Open Sans', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: rgba(0,0,0,.8);\n line-height: 1.5;\n height: 100vh;\n letter-spacing: 0.53px;\n margin-right: -1px !important;\n}\n\nhtml, body, p, a, h1, h2, h3, h4, ul, pre, code {\n margin: 0;\n padding: 0;\n color: inherit;\n}\n\na:active, a:focus, button:focus, input:focus {\n outline: none;\n}\n\ninput, button, submit {\n border: none;\n}\n\ninput, button, pre {\n font-family: 'Open Sans', sans-serif;\n}\n\ncode {\n font-family: Consolas, monospace;\n}\n"],"sourceRoot":""}
--------------------------------------------------------------------------------
/catalog/view/theme/default/template/extension/module/d_vuefront.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |