Skip to content

armgit / Vvveb

Public Imported from GitHub
0

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

Added id to post and product url

givanz1b409509518a
diff --git a/install/controller/index.php b/install/controller/index.php
index 9587d30..e055577 100755
--- a/install/controller/index.php
+++ b/install/controller/index.php
@@ -368,7 +368,7 @@ class Index extends Base {
$menus = new menuSQL();
foreach ([1, 5] as $menu_id) { //main menu and footer menu id's
- $menuItems = $menus->getMenus(['menu_id' => $menu_id, 'language_id' => 1])['menus'] ?? [];
+ $menuItems = $menus->getAll(['menu_id' => $menu_id, 'language_id' => 1])['menus'] ?? [];
foreach ($menuItems as $menuItem) {
$data = ['url' => V_SUBDIR_INSTALL . $menuItem['url'], 'menu_item_content' => []];
diff --git a/install/sql/insert/menu/menu_item.sql b/install/sql/insert/menu/menu_item.sql
index bb85b24..20fabd7 100755
--- a/install/sql/insert/menu/menu_item.sql
+++ b/install/sql/insert/menu/menu_item.sql
@@ -50,29 +50,30 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
-- (47,1,'link','//github.com/givanz/Vvveb/discussions',44,null,0,1),
-- (48,1,'link','//dev.*.*',44,null,3,1),
-(49,1,'link','/page/contact-7',0,null,6,1),
-(59,1,'link','/page/about-11',0,null,1,1),
+(49,1,'page','/page/contact-7',0,7,6,1),
+(59,1,'page','/page/about-11',0,11,1,1),
-- (60,1,'link','/page/contact-7',59,null,0,1),
-- (61,1,'link','/page/contact-7',59,null,3,1),
-- (62,1,'link','/page/contact-7',59,null,2,1),
-(63,1,'link','/page/services-12',0,null,4,1),
-(64,1,'link','/page/pricing-13',63,null,0,1),
-(65,1,'link','/page/services-12',63,null,0,1),
-(66,1,'link','/page/portfolio-14',63,null,0,1),
-(67,1,'text','/page/portfolio-14',0,NULL,3, 0),
-(68,1,'text','/page/about-11',67,NULL,0,0),
+(63,1,'page','/page/services-12',0,12,4,1),
+(64,1,'page','/page/pricing-13',63,13,0,1),
+(65,1,'page','/page/services-12',63,12,0,1),
+(80,5,'page','/page/marketplace-15',63,15,0,1),
+(66,1,'page','/page/portfolio-14',63,14,0,1),
+(67,1,'text','#',0,14,3,0),
+(68,1,'text','#',67,11,0,0),
-- footer
(50,5,'link','',0,null,0,1),
(51,5,'link','/',50,null,0,1),
(52,5,'link','/shop',50,null,0,1),
(53,5,'link','/',0,null,0,1),
-(54,5,'link','/page/shipping-delivery-8',53,null,0,1),
-(55,5,'link','/page/terms-conditions-9',53,null,0,1),
-(56,5,'link','/page/contact-7',0,null,0,1),
-(57,5,'link','/page/contact-7',56,null,0,1),
-(58,5,'link','/page/portfolio-14',56,null,0,1),
+(54,5,'page','/page/shipping-delivery-8',8,8,0,1),
+(55,5,'page','/page/terms-conditions-9',9,9,0,1),
+(56,5,'page','/page/contact-7',0,7,0,1),
+(57,5,'page','/page/contact-7',56,7,0,1),
+(58,5,'page','/page/portfolio-14',56,14,0,1),
(73,5,'link','/user/return-form',56,null,0,1),
@@ -85,7 +86,7 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
(74,5,'link','/blog',50,null,0,1),
-(75,5,'link','/page/services-12',50,null,0,1),
-(76,5,'link','/page/about-11',56,null,0,1),
+(75,5,'page','/page/services-12',50,12,0,1),
+(76,5,'page','/page/about-11',56,11,0,1),
(77,5,'link','/brand',53,null,0,1),
(78,5,'link','/vendor',53,null,0,1);
diff --git a/install/sql/insert/menu/menu_item_content.sql b/install/sql/insert/menu/menu_item_content.sql
index d7fbc09..497ac2d 100755
--- a/install/sql/insert/menu/menu_item_content.sql
+++ b/install/sql/insert/menu/menu_item_content.sql
@@ -134,6 +134,7 @@ INSERT INTO `menu_item_content` VALUES
(74,1, 'Blog', 'Blog', ''),
(75,1, 'Services', 'Services', ''),
(76,1, 'About us', 'About us', ''),
+(80,1, 'Marketplace', 'Marketplace', ''),
(53,1, 'Information', 'Information', ''),
(54,1, 'Delivery Information', 'Delivery Information', 'Delivery Information'),
diff --git a/install/sql/insert/post/post.sql b/install/sql/insert/post/post.sql
index f91c1c6..f4ae9a2 100755
--- a/install/sql/insert/post/post.sql
+++ b/install/sql/insert/post/post.sql
@@ -15,6 +15,7 @@ INSERT INTO `post` (`admin_id`, `status`, `image`, `comment_status`, `password`,
(1,'publish','','open','',0,0,'page','about.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
(1,'publish','','open','',0,0,'page','services.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
(1,'publish','','open','',0,0,'page','pricing.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','portfolio.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
+(1,'publish','','open','',0,0,'page','portfolio.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
--- UNLOCK TABLES
\ No newline at end of file
+-- UNLOCK TABLES
diff --git a/install/sql/insert/post/post_content.sql b/install/sql/insert/post/post_content.sql
index a6f79d8..0305f2a 100755
--- a/install/sql/insert/post/post_content.sql
+++ b/install/sql/insert/post/post_content.sql
@@ -205,6 +205,38 @@ INSERT INTO `post_content` VALUES
(12,1,'Services','services','Services', '','',''),
(13,1,'Pricing','pricing','Pricing', '','',''),
(14,1,'Portfolio','portfolio','Portfolio', '','',''),
+(15,1,'Marketplace','marketplace','Marketplace', '
+<div class="text-center m-4">
+<div class="my-5"><img src="../../media/biglogo.png"></div>
+<h1 class="mb-3">Marketplace vendor</h1>
+<p class="lead">Become a vendor and sell your products on our marketplace</p>
+<p class="lead">Access a market of million of customers</p>
+<div class="mt-4"><a href="/vendor/signup" class="btn btn-primary btn-lg btn-login"><span>Signup now</span> <i class="la la-arrow-right float-end ms-2"></i></a> <a href="/vendor" class="btn btn-secondary btn-lg"><span>Login</span> <i class="la la-user float-end ms-2"></i></a></div>
+<div class="mt-4">Frequently asked questions:</div>
+<div class="my-4 text-start row">
+<div class="col-md-6 mx-auto">
+<details>
+<summary>What kind of products can I sell?</summary>
+<p>You can sell any products that match our categories.</p>
+</details>
+<details>
+<summary>How much does it cost?</summary>
+<p>It`s free, we only take a ##% comission on each sale.</p>
+</details>
+<details>
+<summary>Q3</summary>
+<p>A</p>
+</details>
+<details>
+<summary>Q4</summary>
+<p>A</p>
+</details>
+<br>
+<p class="">Check our <a href="/blog">knowledge base</a> for more information </p>
+</div>
+</div>
+<p class="text-muted small">Our marketplace is subject to certain <a href="/page/terms-conditions-9">terms and conditions</a></p>
+</div>','',''),
(1,2,'Incepe fiecare zi prin a-ti spune','buna-lume-1','
<blockquote cite="https://en.wikipedia.org/wiki/Marcus_Aurelius">
<p>Spuneţi în fiecare dimineaţă: astăzi o să mă întâlnesc cu un om nechibzuit, nerecunoscător, neruşinat, viclean, invidios, nesociabil. Toate defectele acestea sunt urmările neştiinţei oamenilor cu privire la bine şi la rău. Eu însă am recunoscut clar că binele din firea sa este frumos, şi răul este urât, că omul care păcătuieşte contra mea, în realitate îmi este înrudit, nu doar că am fi din acelaşi sânge şi origine, ci fiindcă suntem deopotrivă părtaşi la raţiune, la menirea divină.</p>
diff --git a/install/sql/mysqli/schema/post/post.sql b/install/sql/mysqli/schema/post/post.sql
index c6aa302..57e4264 100755
--- a/install/sql/mysqli/schema/post/post.sql
+++ b/install/sql/mysqli/schema/post/post.sql
@@ -18,5 +18,6 @@ CREATE TABLE `post` (
PRIMARY KEY (`post_id`),
KEY `type_status_date` (`type`,`status`,`sort_order`,`created_at`,`post_id`),
KEY `parent` (`parent`),
- KEY `author` (`admin_id`)
+ KEY `author` (`admin_id`),
+ KEY `updated_at` (`updated_at`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/product/product.sql b/install/sql/mysqli/schema/product/product.sql
index d163cc4..3e4930b 100755
--- a/install/sql/mysqli/schema/product/product.sql
+++ b/install/sql/mysqli/schema/product/product.sql
@@ -11,6 +11,10 @@ CREATE TABLE `product` (
`jan` varchar(13) NOT NULL DEFAULT '',
`isbn` varchar(17) NOT NULL DEFAULT '',
`mpn` varchar(64) NOT NULL DEFAULT '',
+ `barcode` varchar(13) NOT NULL DEFAULT '',
+ `hs_code` varchar(10) NOT NULL DEFAULT '',
+ `origin_country` varchar(64) NOT NULL DEFAULT '',
+ `mid_code` varchar(13) NOT NULL DEFAULT '',
`location` varchar(128) NOT NULL DEFAULT '',
`stock_quantity` int(4) NOT NULL DEFAULT '0',
`stock_status_id` INT UNSIGNED NOT NULL DEFAULT 1,
@@ -21,6 +25,7 @@ CREATE TABLE `product` (
`price` decimal(15,4) NOT NULL DEFAULT 0.0000,
`points` int(8) NOT NULL DEFAULT '0',
`tax_type_id` INT UNSIGNED NOT NULL DEFAULT 0,
+ `material` varchar(64) NOT NULL DEFAULT '',
`weight` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`weight_type_id` INT UNSIGNED NOT NULL DEFAULT '0',
`length` decimal(15,8) NOT NULL DEFAULT '0.00000000',
@@ -39,6 +44,10 @@ CREATE TABLE `product` (
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`product_id`),
KEY `type_status_date` (`type`,`status`,`created_at`,`product_id`),
- KEY `stock_status_id` (`stock_status_id`)
+ KEY `stock_status_id` (`stock_status_id`),
+ KEY `vendor_id` (`vendor_id`),
+ KEY `manufacturer_id` (`stock_status_id`),
+ KEY `barcode` (`barcode`),
+ KEY `sku` (`sku`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/pgsql/schema/geoip/region_to_region_group.sql b/install/sql/pgsql/schema/geoip/region_to_region_group.sql
index 6fcee19..0471a6d 100755
--- a/install/sql/pgsql/schema/geoip/region_to_region_group.sql
+++ b/install/sql/pgsql/schema/geoip/region_to_region_group.sql
@@ -7,7 +7,7 @@ SELECT setval('region_to_region_group_seq', 108, true); -- last inserted id by s
CREATE TABLE region_to_region_group (
"region_to_region_group_id" int check ("region_to_region_group_id" > 0) NOT NULL DEFAULT NEXTVAL ('region_to_region_group_seq'),
"country_id" int check ("country_id" > 0) NOT NULL,
- "region_id" int check ("region_id" > 0) NOT NULL DEFAULT 0,
+ "region_id" int check ("region_id" >= 0) NOT NULL DEFAULT 0,
"region_group_id" int check ("region_group_id" > 0) NOT NULL,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
PRIMARY KEY ("region_to_region_group_id")
diff --git a/install/sql/pgsql/schema/order/order.sql b/install/sql/pgsql/schema/order/order.sql
index ea1f2f6..eff2134 100755
--- a/install/sql/pgsql/schema/order/order.sql
+++ b/install/sql/pgsql/schema/order/order.sql
@@ -4,11 +4,11 @@ DROP SEQUENCE IF EXISTS order_seq;
CREATE SEQUENCE order_seq;
-- SELECT setval('order_seq', 0, true); -- last inserted id by sample data
-CREATE TYPE shipping_status AS ENUM
- ('not_fulfilled', 'partially_fulfilled', 'fulfilled', 'partially_shipped', 'shipped', 'partially_returned', 'returned', 'canceled', 'requires_action');
+-- CREATE TYPE shipping_status AS ENUM
+-- ('not_fulfilled', 'partially_fulfilled', 'fulfilled', 'partially_shipped', 'shipped', 'partially_returned', 'returned', 'canceled', 'requires_action');
-CREATE TYPE shipping_status AS ENUM
- ('not_paid', 'awaiting', 'captured', 'partially_refunded', 'refunded', 'canceled', 'requires_action');
+-- CREATE TYPE shipping_status AS ENUM
+-- ('not_paid', 'awaiting', 'captured', 'partially_refunded', 'refunded', 'canceled', 'requires_action');
CREATE TABLE "order" (
@@ -70,5 +70,5 @@ CREATE TABLE "order" (
PRIMARY KEY ("order_id")
);
-CREATE INDEX "order_order_status_id" ON order ("site_id","order_status_id","created_at");
-CREATE INDEX "order_customer_order_id" ON order ("customer_order_id","order_status_id","created_at");
\ No newline at end of file
+CREATE INDEX "order_order_status_id" ON "order" ("site_id","order_status_id","created_at");
+CREATE INDEX "order_customer_order_id" ON "order" ("customer_order_id","order_status_id","created_at");
diff --git a/install/sql/pgsql/schema/post/post.sql b/install/sql/pgsql/schema/post/post.sql
index e3b4f23..42d704e 100755
--- a/install/sql/pgsql/schema/post/post.sql
+++ b/install/sql/pgsql/schema/post/post.sql
@@ -26,3 +26,4 @@ CREATE TABLE post (
CREATE INDEX "post_type_status_date" ON post ("type","status","sort_order","created_at","post_id");
CREATE INDEX "post_parent" ON post ("parent");
CREATE INDEX "post_author" ON post ("admin_id");
+CREATE INDEX "post_updated_at" ON post ("updated_at");
diff --git a/install/sql/pgsql/schema/user/user.sql b/install/sql/pgsql/schema/user/user.sql
index e29f5fb..e4008b1 100755
--- a/install/sql/pgsql/schema/user/user.sql
+++ b/install/sql/pgsql/schema/user/user.sql
@@ -21,6 +21,7 @@ CREATE TABLE "user" (
"avatar" varchar(250) NOT NULL DEFAULT '',
"bio" varchar(250) NOT NULL DEFAULT '',
"token" varchar(32) NOT NULL DEFAULT '',
+ "subscribe" smallint check ("status" >= 0) NOT NULL DEFAULT '0',
"created_at" timestamp(0) NOT NULL DEFAULT now(),
"updated_at" timestamp(0) NOT NULL DEFAULT now(),
PRIMARY KEY ("user_id")
diff --git a/install/sql/sqlite/schema/post/post.sql b/install/sql/sqlite/schema/post/post.sql
index fc196a4..0d0c3f0 100755
--- a/install/sql/sqlite/schema/post/post.sql
+++ b/install/sql/sqlite/schema/post/post.sql
@@ -21,3 +21,4 @@ CREATE TABLE `post` (
CREATE INDEX `post_type_status_date` ON `post` (`type`);
CREATE INDEX `post_parent` ON `post` (`parent`);
CREATE INDEX `post_author` ON `post` (`admin_id`);
+CREATE INDEX `post_updated_at` ON `post` (`updated_at`);