Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

User dashboard improvements, order/downloads view, order tracking

givanz8f24a6ae1f51
diff --git a/admin/component/products.php b/admin/component/products.php
index 21b28f7..3d6a295 100755
--- a/admin/component/products.php
+++ b/admin/component/products.php
@@ -22,6 +22,8 @@
namespace Vvveb\Component;
+use Vvveb\System\Cart\Currency;
+use Vvveb\System\Cart\Tax;
use Vvveb\System\Component\ComponentBase;
use Vvveb\System\Event;
use Vvveb\System\Images;
@@ -47,23 +49,33 @@ class Products extends ComponentBase {
}
function results() {
+
$products = new \Vvveb\Sql\ProductSQL();
$results = $products->getAll($this->options);
$results['products'] = $results['products'] ?? [];
- foreach ($results['products'] as $id => &$product) {
- if (isset($product['images'])) {
- $product['images'] = json_decode($product['images'], true);
+ if ($results['products']) {
+ $tax = Tax::getInstance($this->options);
+ $currency = Currency::getInstance($this->options);
- foreach ($product['images'] as &$image) {
- $image['image'] = Images::image($image['image'], 'product');
+ foreach ($results['products'] as $id => &$product) {
+ if (isset($product['images'])) {
+ $product['images'] = json_decode($product['images'], true);
+
+ foreach ($product['images'] as &$image) {
+ $image['image'] = Images::image($image['image'], 'product');
+ }
+ }
+
+ if (isset($product['image']) && $product['image']) {
+ $product['image'] =Images::image($product['image'], 'product');
}
- }
- if (isset($product['image']) && $product['image']) {
- $product['image'] =Images::image($product['image'], 'product');
+ $product['price_tax'] = $tax->addTaxes($product['price'], $product['tax_type_id']);
+ $product['price_tax_formatted'] = $currency->format($product['price_tax']);
+ $product['price_formatted'] = $currency->format($product['price']);
}
}
diff --git a/app/component/comments.php b/app/component/comments.php
index aa3172c..1adcb2e 100755
--- a/app/component/comments.php
+++ b/app/component/comments.php
@@ -38,6 +38,7 @@ class Comments extends ComponentBase {
public static $defaultOptions = [
'post_id' => 'url',
+ 'user_id' => null,
'slug' => 'url',
'post_title' => NULL, //include post title (for recent comments etc)
'status' => 1, //approved comments
diff --git a/app/component/digital_assets.php b/app/component/digital_assets.php
new file mode 100644
index 0000000..ac8566e
--- /dev/null
+++ b/app/component/digital_assets.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * Vvveb
+ *
+ * Copyright (C) 2022 Ziadin Givan
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Vvveb\Component;
+
+use Vvveb\System\Component\ComponentBase;
+use Vvveb\System\Event;
+use Vvveb\System\Images;
+use function Vvveb\url;
+
+class Digital_assets extends ComponentBase {
+ public static $defaultOptions = [
+ 'start' => 0,
+ 'user_id' => null,
+ 'order_status_id' => null,
+ 'limit' => ['url', 4],
+ 'digital_asset' => ['url', 'price asc'],
+ ];
+
+ public $options = [];
+
+ function results() {
+ $digital_asset = new \Vvveb\Sql\Digital_assetSQL();
+
+ $results = $digital_asset->getAll($this->options);
+
+ if (isset($results['digital_asset'])) {
+ foreach ($results['digital_asset'] as $id => &$digital_asset) {
+ if (isset($digital_asset['images'])) {
+ $digital_asset['images'] = json_decode($digital_asset['images'], 1);
+
+ foreach ($digital_asset['images'] as &$image) {
+ $image = Images::image('digital_asset', $image);
+ }
+ }
+
+ if (isset($digital_asset['image'])) {
+ $digital_asset['images'][] = Images::image('digital_asset', $digital_asset['image']);
+ }
+
+ $digital_asset['url'] = url('user/digital_assets/digital_asset', ['digital_asset_id' => $digital_asset['digital_asset_id']]);
+ }
+ }
+
+ list($results) = Event :: trigger(__CLASS__,__FUNCTION__, $results);
+
+ return $results;
+ }
+}
diff --git a/app/component/order.php b/app/component/order.php
index 5ac7118..f0f8663 100755
--- a/app/component/order.php
+++ b/app/component/order.php
@@ -28,12 +28,15 @@ use Vvveb\System\Component\ComponentBase;
use Vvveb\System\Core\Request;
use Vvveb\System\Event;
use Vvveb\System\Images;
+use Vvveb\System\Sites;
class Order extends ComponentBase {
public static $defaultOptions = [
- 'user_id' => null,
- 'order_id' => null,
- 'limit' => ['url', 4],
+ 'order_id' => null,
+ 'customer_order_id' => null,
+ 'user_id' => null,
+ 'email' => null,
+ 'image_size' => 'thumb',
];
public $options = [];
@@ -43,31 +46,45 @@ class Order extends ComponentBase {
$request = Request::getInstance();
- if ($this->options['order_id']) {
+ if ($this->options['order_id'] || $this->options['customer_order_id']) {
$orders = new \Vvveb\Sql\OrderSQL();
$results = $orders->get($this->options);
+ $site = Sites :: getSiteData();
+ $scheme = $_SERVER['REQUEST_SCHEME'] ?? 'http';
+ $url = ['host' => SITE_URL, 'scheme' => $scheme];
+ $host = $scheme . '://' . SITE_URL;
- if ($results) {
+ if ($results && $results['order']) {
$currency = Currency::getInstance();
if (isset($results['products'])) {
foreach ($results['products'] as $id => &$product) {
- $product['url'] = htmlentities(\Vvveb\url('product/product/index', $product));
+ $product['url'] = htmlentities(\Vvveb\url('product/product/index', $product + $url));
if (isset($product['images'])) {
$product['images'] = json_decode($product['images'], true);
foreach ($product['images'] as &$image) {
- $image['image'] = Images::image($image['image'], 'product');
+ $image['image'] = $host . Images::image($image['image'], 'product', $this->options['image_size']);
}
}
if (isset($product['image']) && $product['image']) {
- $product['image'] =Images::image($product['image'], 'product');
+ $product['image'] = $host . Images::image($product['image'], 'product', $this->options['image_size']);
//$product['images'][] = ['image' => Images::image($product['image'], 'product')];
}
+ if (isset($product['option_value'])) {
+ $product['option_value'] = json_decode($product['option_value'], true);
+
+ foreach ($product['option_value'] as &$option) {
+ if (isset($option['price'])) {
+ $option['price_formatted'] = $currency->format($option['price']);
+ }
+ }
+ }
+
$product['tax_formatted'] = $currency->format($product['tax']);
}
}
@@ -78,14 +95,13 @@ class Order extends ComponentBase {
$order = &$results['order'];
$order['total_formatted'] = $currency->format($order['total']);
- $order['shipping_data'] = json_decode($order['shipping_data'], true);
- $order['payment_data'] = json_decode($order['payment_data'], true);
+ $order['shipping_data'] = isset($order['shipping_data']) ? json_decode($order['shipping_data'], true) : [];
+ $order['payment_data'] = isset($order['payment_data']) ? json_decode($order['payment_data'], true) : [];
$order += prefixArrayKeys('shipping_', $order['shipping_data']) ?? [];
$order += prefixArrayKeys('payment_', $order['payment_data']) ?? [];
}
- //\Vvveb\dd($results);
list($results) = Event :: trigger(__CLASS__,__FUNCTION__, $results);
}
diff --git a/app/component/orders.php b/app/component/orders.php
index 629699f..d38db59 100755
--- a/app/component/orders.php
+++ b/app/component/orders.php
@@ -29,10 +29,11 @@ use function Vvveb\url;
class Orders extends ComponentBase {
public static $defaultOptions = [
- 'start' => 0,
- 'order_id' => 'url',
- 'limit' => ['url', 4],
- 'order' => ['url', 'price asc'],
+ 'start' => 0,
+ 'order_id' => null,
+ 'customer_order_id' => null,
+ 'limit' => ['url', 4],
+ 'order' => ['url', 'price asc'],
];
public $options = [];
@@ -56,7 +57,7 @@ class Orders extends ComponentBase {
$order['images'][] = Images::image('order', $order['image']);
}
- $order['url'] = url('user/orders/order', ['order_id' => $order['order_id']]);
+ $order['url'] = url('user/orders/order', ['customer_order_id' => $order['customer_order_id']]);
}
}
diff --git a/app/component/product/attributes.php b/app/component/product/attributes.php
index b0f0c45..2a0776f 100644
--- a/app/component/product/attributes.php
+++ b/app/component/product/attributes.php
@@ -39,6 +39,13 @@ class Attributes extends ComponentBase {
function results() {
$category = new AttributeSQL();
+
+ if (isset($this->options['product_id'])) {
+ if (! is_array($this->options['product_id'])) {
+ $this->options['product_id'] = [$this->options['product_id']];
+ }
+ }
+
$results = $category->getAll($this->options);
$attributes = [];
$group = false;
diff --git a/app/component/user/address.php b/app/component/user/address.php
index 7b94293..2ef8f37 100755
--- a/app/component/user/address.php
+++ b/app/component/user/address.php
@@ -29,8 +29,9 @@ use function Vvveb\url;
class Address extends ComponentBase {
public static $defaultOptions = [
- 'start' => 0,
- 'limit' => 10,
+ 'user_id' => null,
+ 'start' => 0,
+ 'limit' => 10,
];
//don't cache
diff --git a/app/controller/user/address.php b/app/controller/user/address.php
index 99ef120..8fd4a9e 100755
--- a/app/controller/user/address.php
+++ b/app/controller/user/address.php
@@ -23,18 +23,44 @@
namespace Vvveb\Controller\User;
use function Vvveb\__;
+use Vvveb\Sql\CountrySQL;
+use Vvveb\Sql\RegionSQL;
use Vvveb\Sql\User_AddressSQL;
+use function Vvveb\url;
class Address extends Base {
function index() {
}
+ private function save() {
+ }
+
+ private function data() {
+ $countryModel = new CountrySQL();
+ $options = $this->global;
+ $options['status'] = 1;
+ unset($options['limit']);
+ $country = $countryModel->getAll($options);
+ $this->view->countries = $country['country'] ?? [];
+
+ $this->view->regionsUrl = url(['module' => 'checkout/checkout', 'action' => 'regions']);
+ }
+
function edit() {
$user_address_id = $this->request->get['user_address_id'] ?? false;
$user_address = [];
$addressModel = new User_AddressSQL();
+ if ($user_address_id) {
+ $options = ['user_address_id' => $user_address_id, 'user_id' => $this->global['user_id']];
+ $user_address = $addressModel->get($options);
+
+ if (! $user_address) {
+ $this->notFound();
+ }
+ }
+
if (isset($this->request->post['user_address'])) {
$user_address = $this->request->post['user_address'];
$user_address['user_id'] = $this->global['user_id'];
@@ -55,11 +81,9 @@ class Address extends Base {
}
}
- if ($user_address_id) {
- $options = ['user_address_id' => $user_address_id] + $this->global;
- $user_address = $addressModel->get($options);
- }
+ $this->data();
+ $this->view->regionsUrl = url(['module' => 'checkout/checkout', 'action' => 'regions']);
$this->view->user_address_id = $user_address_id;
$this->view->user_address = $user_address;
}
diff --git a/app/controller/user/signup.php b/app/controller/user/signup.php
index 2991ecc..48c1575 100755
--- a/app/controller/user/signup.php
+++ b/app/controller/user/signup.php
@@ -23,11 +23,13 @@
namespace Vvveb\Controller\User;
use function Vvveb\__;
+use function Vvveb\url;
use function Vvveb\email;
use function Vvveb\siteSettings;
use Vvveb\System\Event;
use Vvveb\System\User\User;
use Vvveb\System\Validator;
+use Vvveb\System\Sites;
class Signup extends \Vvveb\Controller\Base {
function addUser() {
@@ -56,7 +58,13 @@ class Signup extends \Vvveb\Controller\Base {
$user_id = $result['user'];
$this->request->request['user_id'] = $user_id;
- $site = siteSettings();
+ $site = siteSettings();
+ $siteData = Sites :: getSiteData();
+
+ $userInfo['website'] = url('user/index', [
+ 'host' => $siteData['host'] ?? false,
+ 'scheme' => $_SERVER['REQUEST_SCHEME'] ?? 'http',
+ ]);
try {
$error = __('Error sending account creation mail!');
diff --git a/app/sql/mysqli/digital_asset.sql b/app/sql/mysqli/digital_asset.sql
new file mode 100644
index 0000000..79cb69c
--- /dev/null
+++ b/app/sql/mysqli/digital_asset.sql
@@ -0,0 +1,5 @@
+-- Digital asset
+
+ -- get common code from admin
+ import(/admin/digital_asset.sql);
+
diff --git a/app/sql/pgsql/setting_content.sql b/app/sql/pgsql/setting_content.sql
new file mode 100644
index 0000000..b324bf7
--- /dev/null
+++ b/app/sql/pgsql/setting_content.sql
@@ -0,0 +1,5 @@
+-- Setting content
+
+ -- get common code from admin
+ import(/admin/setting_content.sql);
+
diff --git a/app/sql/sqlite/setting_content.sql b/app/sql/sqlite/setting_content.sql
new file mode 100644
index 0000000..b324bf7
--- /dev/null
+++ b/app/sql/sqlite/setting_content.sql
@@ -0,0 +1,5 @@
+-- Setting content
+
+ -- get common code from admin
+ import(/admin/setting_content.sql);
+
diff --git a/app/template/components.tpl b/app/template/components.tpl
index 8f4fdc9..1e04ea8 100755
--- a/app/template/components.tpl
+++ b/app/template/components.tpl
@@ -32,4 +32,6 @@ import(components/orders.tpl, [data-v-component-orders])
import(components/order.tpl, [data-v-component-order])
import(components/checkout/payment.tpl, [data-v-component-checkout-payment])
import(components/checkout/shipping.tpl, [data-v-component-checkout-shipping])
-import(components/site.tpl, [data-v-component-site])
\ No newline at end of file
+import(components/digital_assets.tpl, [data-v-component-digital_assets])
+import(components/user/wishlist.tpl, [data-v-component-user-wishlist])
+import(components/site.tpl, [data-v-component-site])
diff --git a/app/template/components/cart.tpl b/app/template/components/cart.tpl
index 9a38154..4fe2a0a 100755
--- a/app/template/components/cart.tpl
+++ b/app/template/components/cart.tpl
@@ -31,10 +31,9 @@ if($products) {
//@cart-product [data-v-product-content] = $product['content']
//catch all data attributes
+ @cart-product a[data-v-cart-product-*]|href = $product['@@__data-v-cart-product-(*)__@@']
@cart-product [data-v-cart-product-*]|innerText = $product['@@__data-v-cart-product-(*)__@@']
- @cart-product [data-v-cart-product-url]|href =
- <?php echo htmlentities(Vvveb\url(['module' => 'product', 'product_id' => $product['product_id']]));?>
@cart-product [data-v-cart-product-remove-url]|href =
<?php echo htmlentities(Vvveb\url(['module' => 'cart', 'action' => 'remove', 'product_id' => $product['product_id']]));?>
diff --git a/app/template/components/digital_assets.tpl b/app/template/components/digital_assets.tpl
new file mode 100644
index 0000000..2b48420
--- /dev/null
+++ b/app/template/components/digital_assets.tpl
@@ -0,0 +1,38 @@
+@digital_assetcomp = [data-v-component-digital_assets]
+@digital_asset = [data-v-component-digital_assets] [data-v-digital_asset]
+
+@digital_asset|deleteAllButFirstChild
+
+@digital_assetcomp|prepend = <?php
+$vvveb_is_page_edit = Vvveb\isEditor();
+
+if (isset($_digital_assetcomp_idx)) $_digital_assetcomp_idx++; else $_digital_assetcomp_idx = 0;
+$previous_component = isset($current_component)?$current_component:null;
+$digital_assetcomp = $current_component = $this->_component['digital_assets'][$_digital_assetcomp_idx] ?? [];
+
+$count = $_pagination_count = $digital_assetcomp['count'] ?? 0;
+$_pagination_limit = isset($digital_assetcomp['limit']) ? $digital_assetcomp['limit'] : 5;
+?>
+
+
+@digital_asset|before = <?php
+$_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => []] : false;
+$digital_assetcomp['digital_asset'] = empty($digital_assetcomp['digital_asset']) ? $_default : $digital_assetcomp['digital_asset'];
+
+if($digital_assetcomp && is_array($digital_assetcomp['digital_asset'])) {
+ foreach ($digital_assetcomp['digital_asset'] as $index => $digital_asset) {?>
+
+ @digital_asset|data-digital_asset_id = $digital_asset['digital_asset_id']
+
+ @digital_asset|id = <?php echo 'digital_asset-' . $digital_asset['digital_asset_id'];?>
+
+ @digital_asset img[data-v-digital_asset-*]|src = $digital_asset['@@__data-v-digital_asset-(*)__@@']
+
+ @digital_asset [data-v-digital_asset-*]|innerText = $digital_asset['@@__data-v-digital_asset-(*)__@@']
+
+ @digital_asset a[data-v-digital_asset-*]|href = $digital_asset['@@__data-v-digital_asset-(*)__@@']
+
+ @digital_asset|after = <?php
+ }
+}
+?>
diff --git a/app/template/components/order.tpl b/app/template/components/order.tpl
index a82274c..34cb0af 100755
--- a/app/template/components/order.tpl
+++ b/app/template/components/order.tpl
@@ -3,7 +3,7 @@ if (isset($order_idx)) $order_idx++; else $order_idx = 0;
$order = $this->_component['order'][$order_idx] ?? [];
?>
-@order-product = [data-v-component-order] [data-v-order-product]
+@order-product = [data-v-component-order] [data-v-cart] [data-v-order-product]
@order-product|deleteAllButFirstChild
@order-product|before = <?php
@@ -24,6 +24,24 @@ if(is_array($products)) foreach ($products as $index => $product) {
@order-product|after = <?php }?>
+@cart-option = [data-v-component-order] [data-v-order-product] [data-v-product-option]
+@cart-option|deleteAllButFirstChild
+
+
+@cart-option|before = <?php
+$_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => 'product_option_value_id'] : false;
+$option_value = empty($product['option_value']) ? $_default : $product['option_value'];
+
+if($option_value) {
+ foreach ($option_value as $product_option_value_id => $value) { ?>
+
+ @cart-option [data-v-product-option-*]|innerText = $value['@@__data-v-product-option-(*)__@@']
+
+
+@cart-option|after = <?php }
+}
+?>
+
@total = [data-v-component-order] [data-v-order-totals-total]
@total|deleteAllButFirstChild
diff --git a/app/template/components/site.tpl b/app/template/components/site.tpl
index b59c1bc..802e1a3 100755
--- a/app/template/components/site.tpl
+++ b/app/template/components/site.tpl
@@ -12,11 +12,19 @@
[data-v-component-site] a[data-v-site-*]|href = <?php
$name = '@@__data-v-site-(*)__@@';
-if ($name == 'phone-number') echo 'tel:';
+if (strpos($name, 'phone-number') !== false) echo 'tel:';
if (strpos($name, 'email') !== false) echo 'mailto:';
echo $site[$name] ?? '';
?>
+[data-v-component-site] a[data-v-site-description-*]|href = <?php
+$name = '@@__data-v-site-description-(*)__@@';
+if (strpos($name, 'phone-number') !== false) echo 'tel:';
+if (strpos($name, 'email') !== false) echo 'mailto:';
+echo $site['description'][$name] ?? '';
+?>
+
+
[data-v-component-site]|append = <?php
$component = $previous_component;
?>
\ No newline at end of file
diff --git a/app/template/components/user/address.tpl b/app/template/components/user/address.tpl
index 8485e70..3512b87 100755
--- a/app/template/components/user/address.tpl
+++ b/app/template/components/user/address.tpl
@@ -29,13 +29,13 @@ if($addresses) {
@address [data-v-user_address-label-id]|id = <?php echo 'address_' . $address['user_address_id'];?>
@address [data-v-user_address-label-for]|for = <?php echo 'address_' . $address['user_address_id'];?>
- @address img[data-v-user_address-*]|src = $address['@@__data-v-user_address-([a-zA-Z_\d]+)__@@']
+ @address img[data-v-user_address-*]|src = $address['@@__data-v-user_address-(*)__@@']
- @address [data-v-user_address-*]|innerText = $address['@@__data-v-user_address-([a-zA-Z_\d]+)__@@']
+ @address [data-v-user_address-*]|innerText = $address['@@__data-v-user_address-(*)__@@']
- @address input[data-v-user_address-*]|value = $address['@@__data-v-user_address-([a-zA-Z_\d]+)__@@']
+ @address input[data-v-user_address-*]|value = $address['@@__data-v-user_address-(*)__@@']
- @address a[data-v-user_address-*]|href = $address['@@__data-v-user_address-([a-zA-Z_\d]+)__@@']
+ @address a[data-v-user_address-*]|href = $address['@@__data-v-user_address-(*)__@@']
@address|after = <?php
}
diff --git a/app/template/email/user/signup.tpl b/app/template/email/user/signup.tpl
index d6e87f6..a99d893 100755
--- a/app/template/email/user/signup.tpl
+++ b/app/template/email/user/signup.tpl
@@ -1 +1,3 @@
import(email/common.tpl)
+
+a[data-v-website]|href = $this->website
diff --git a/app/template/product/manufacturer.tpl b/app/template/product/manufacturer.tpl
index 0be43c4..9659252 100755
--- a/app/template/product/manufacturer.tpl
+++ b/app/template/product/manufacturer.tpl
@@ -3,3 +3,7 @@ import(common.tpl)
head > title = <?php echo htmlentities(ucfirst($this->manufacturer_name));?>
[data-v-manufacturer-name] = <?php echo htmlentities(ucfirst($this->manufacturer_name));?>
+
+[data-v-manufacturer-*]|innerText = $this->manufacturer['@@__data-v-manufacturer-(*)__@@']
+img[data-v-manufacturer-*]|src = $this->manufacturer['@@__data-v-manufacturer-(*)__@@']
+[data-v-manufacturer-name] = <?php echo htmlentities(ucfirst($this->manufacturer['name'] ?? ''));?>
diff --git a/app/template/product/vendor.tpl b/app/template/product/vendor.tpl
index baf6c15..961425d 100755
--- a/app/template/product/vendor.tpl
+++ b/app/template/product/vendor.tpl
@@ -4,4 +4,4 @@ head > title = <?php echo htmlentities(ucfirst($this->vendor_name));?>
[data-v-vendor-*]|innerText = $this->vendor['@@__data-v-vendor-(*)__@@']
img[data-v-vendor-*]|src = $this->vendor['@@__data-v-vendor-(*)__@@']
-[data-v-vendor-name] = <?php echo htmlentities(ucfirst($this->vendor['name']));?>
+[data-v-vendor-name] = <?php echo htmlentities(ucfirst($this->vendor['name'] ?? ''));?>
diff --git a/app/template/user/address/edit.tpl b/app/template/user/address/edit.tpl
index 2645c35..c781ea8 100755
--- a/app/template/user/address/edit.tpl
+++ b/app/template/user/address/edit.tpl
@@ -1,3 +1,26 @@
import(common.tpl)
-[data-v-user_address-*] = <?php echo $this->user_address['@@__data-v-user_address-([a-zA-Z_\d]+)__@@'] ?? '';?>
+[data-v-user_address-*] = <?php echo $this->user_address['@@__data-v-user_address-(*)__@@'] ?? '';?>
+
+[data-v-countries]|data-v-region-id = $this->user_address['region_id']
+
+@country = [data-v-countries] option
+@country|deleteAllButFirstChild
+
+@country|before = <?php
+$count = 0;
+$country_index = 0;
+if(isset($this->countries) && is_array($this->countries)) {
+ foreach ($this->countries as $country_index => $country) {?>
+
+ [data-v-country-*]|innerText = $country['@@__data-v-country-(*)__@@']
+ option[data-v-country-*]|value = $country['@@__data-v-country-(*)__@@']
+
+ @country|innerText = $country['name']
+ @country|value = $country['country_id']
+ @country|addNewAttribute = <?php if (isset($region['country_id']) && ($country['country_id'] == $region['country_id'])) echo 'selected';?>
+
+ @country|after = <?php
+ $count++;
+ }
+}?>
diff --git a/app/template/user/profile.tpl b/app/template/user/profile.tpl
index 54bf529..370f646 100755
--- a/app/template/user/profile.tpl
+++ b/app/template/user/profile.tpl
@@ -1,3 +1,3 @@
import(common.tpl)
-[data-v-user-*] = <?php echo $this->user['@@__data-v-user-([a-zA-Z_\d]+)__@@'] ?? '';?>
+[data-v-user-*] = <?php echo $this->user['@@__data-v-user-(*)__@@'] ?? '';?>
diff --git a/config/routes.php b/config/routes.php
index 34bc7c7..68e187c 100755
--- a/config/routes.php
+++ b/config/routes.php
@@ -26,7 +26,7 @@ return [
//homepage
'/' => ['module' => 'index/index'],
-
+
//pagination for blog posts when home has blog posts
'/p/#page#' => ['module' => 'index/index'],
@@ -38,8 +38,9 @@ return [
'/user/reset/{token}/{username}' => ['module' => 'user/reset/reset'],
//user dashboard
+ '/user/order-tracking' => ['module' => 'user/order-tracking/index'],
'/user/orders' => ['module' => 'user/orders/index'],
- '/user/order/#order_id#' => ['module' => 'user/orders/order'],
+ '/user/order/{customer_order_id}' => ['module' => 'user/orders/order'],
'/user/downloads' => ['module' => 'user/downloads/index'],
'/user/downloads/#page#' => ['module' => 'user/downloads/index'],
'/user/downloads/#download_id#' => ['module' => 'user/downloads/download'],
@@ -71,23 +72,21 @@ return [
//ecommerce
- //catalog - multi language - language code must be at least 2 characters
- '/{language{2,5}}/shop' => ['module' => 'product/index'],
- '/{language{2,5}}/shop/{slug}' => ['module' => 'product/index'],
- '/{language{2,5}}/shop/{slug}/#page#' => ['module' => 'product/index'],
- '/{language{2,5}}/manufacturer/{slug}' => ['module' => 'product/manufacturer'],
- '/{language{2,5}}/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
-
//catalog
- '/shop' => ['module' => 'product/index'],
- '/shop/#page#' => ['module' => 'product/index'],
- '/shop/{slug}' => ['module' => 'product/category/index'],
- '/shop/{slug}/#page#' => ['module' => 'product/category/index'],
- '/shop/{slug}/#page#/filters-{filters}' => ['module' => 'product/category/index'],
- '/manufacturer/{slug}' => ['module' => 'product/manufacturer/index'],
- '/vendor/{slug}' => ['module' => 'product/vendor/index'],
- '/vendor/{slug}/#page#' => ['module' => 'product/vendor/index'],
- '/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
+ '/shop' => ['module' => 'product/index'],
+ '/shop/#page#' => ['module' => 'product/index'],
+ '/shop/#page#/filters-{filters}' => ['module' => 'product/category/index'],
+ '/shop/{slug}' => ['module' => 'product/category/index'],
+ '/shop/{slug}/#page#' => ['module' => 'product/category/index'],
+ '/shop/{slug}/#page#/filters-{filters}' => ['module' => 'product/category/index'],
+ '/brand/{slug}' => ['module' => 'product/manufacturer/index'],
+ '/brand' => ['module' => 'product/manufacturer/index'],
+ '/brand/#page#' => ['module' => 'product/manufacturer/index'],
+ '/vendor/{slug}' => ['module' => 'product/vendor/index'],
+ '/vendor/{slug}/#page#' => ['module' => 'product/vendor/index'],
+ '/vendor' => ['module' => 'product/vendor/index'],
+ '/vendor/#page#' => ['module' => 'product/vendor/index'],
+ '/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
//compare
'/cart/compare' => ['module' => 'cart/compare/index'],