Skip to content

Commit 1b40950

Browse files
committed
Added id to post and product url
1 parent 5ebe2eb commit 1b40950

File tree

12 files changed

+75
-27
lines changed

12 files changed

+75
-27
lines changed

install/controller/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ function install() {
368368
$menus = new menuSQL();
369369

370370
foreach ([1, 5] as $menu_id) { //main menu and footer menu id's
371-
$menuItems = $menus->getMenus(['menu_id' => $menu_id, 'language_id' => 1])['menus'] ?? [];
371+
$menuItems = $menus->getAll(['menu_id' => $menu_id, 'language_id' => 1])['menus'] ?? [];
372372

373373
foreach ($menuItems as $menuItem) {
374374
$data = ['url' => V_SUBDIR_INSTALL . $menuItem['url'], 'menu_item_content' => []];

install/sql/insert/menu/menu_item.sql

+16-15
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,30 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
5050
-- (47,1,'link','//github.com/givanz/Vvveb/discussions',44,null,0,1),
5151
-- (48,1,'link','//dev.*.*',44,null,3,1),
5252

53-
(49,1,'link','/page/contact-7',0,null,6,1),
54-
(59,1,'link','/page/about-11',0,null,1,1),
53+
(49,1,'page','/page/contact-7',0,7,6,1),
54+
(59,1,'page','/page/about-11',0,11,1,1),
5555
-- (60,1,'link','/page/contact-7',59,null,0,1),
5656
-- (61,1,'link','/page/contact-7',59,null,3,1),
5757
-- (62,1,'link','/page/contact-7',59,null,2,1),
5858

59-
(63,1,'link','/page/services-12',0,null,4,1),
60-
(64,1,'link','/page/pricing-13',63,null,0,1),
61-
(65,1,'link','/page/services-12',63,null,0,1),
62-
(66,1,'link','/page/portfolio-14',63,null,0,1),
63-
(67,1,'text','/page/portfolio-14',0,NULL,3, 0),
64-
(68,1,'text','/page/about-11',67,NULL,0,0),
59+
(63,1,'page','/page/services-12',0,12,4,1),
60+
(64,1,'page','/page/pricing-13',63,13,0,1),
61+
(65,1,'page','/page/services-12',63,12,0,1),
62+
(80,5,'page','/page/marketplace-15',63,15,0,1),
63+
(66,1,'page','/page/portfolio-14',63,14,0,1),
64+
(67,1,'text','#',0,14,3,0),
65+
(68,1,'text','#',67,11,0,0),
6566

6667
-- footer
6768
(50,5,'link','',0,null,0,1),
6869
(51,5,'link','/',50,null,0,1),
6970
(52,5,'link','/shop',50,null,0,1),
7071
(53,5,'link','/',0,null,0,1),
71-
(54,5,'link','/page/shipping-delivery-8',53,null,0,1),
72-
(55,5,'link','/page/terms-conditions-9',53,null,0,1),
73-
(56,5,'link','/page/contact-7',0,null,0,1),
74-
(57,5,'link','/page/contact-7',56,null,0,1),
75-
(58,5,'link','/page/portfolio-14',56,null,0,1),
72+
(54,5,'page','/page/shipping-delivery-8',8,8,0,1),
73+
(55,5,'page','/page/terms-conditions-9',9,9,0,1),
74+
(56,5,'page','/page/contact-7',0,7,0,1),
75+
(57,5,'page','/page/contact-7',56,7,0,1),
76+
(58,5,'page','/page/portfolio-14',56,14,0,1),
7677
(73,5,'link','/user/return-form',56,null,0,1),
7778

7879

@@ -85,7 +86,7 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
8586

8687

8788
(74,5,'link','/blog',50,null,0,1),
88-
(75,5,'link','/page/services-12',50,null,0,1),
89-
(76,5,'link','/page/about-11',56,null,0,1),
89+
(75,5,'page','/page/services-12',50,12,0,1),
90+
(76,5,'page','/page/about-11',56,11,0,1),
9091
(77,5,'link','/brand',53,null,0,1),
9192
(78,5,'link','/vendor',53,null,0,1);

install/sql/insert/menu/menu_item_content.sql

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ INSERT INTO `menu_item_content` VALUES
134134
(74,1, 'Blog', 'Blog', ''),
135135
(75,1, 'Services', 'Services', ''),
136136
(76,1, 'About us', 'About us', ''),
137+
(80,1, 'Marketplace', 'Marketplace', ''),
137138

138139
(53,1, 'Information', 'Information', ''),
139140
(54,1, 'Delivery Information', 'Delivery Information', 'Delivery Information'),

install/sql/insert/post/post.sql

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ INSERT INTO `post` (`admin_id`, `status`, `image`, `comment_status`, `password`,
1515
(1,'publish','','open','',0,0,'page','about.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
1616
(1,'publish','','open','',0,0,'page','services.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
1717
(1,'publish','','open','',0,0,'page','pricing.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
18-
(1,'publish','','open','',0,0,'page','portfolio.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
18+
(1,'publish','','open','',0,0,'page','portfolio.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
19+
(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
1920

20-
-- UNLOCK TABLES
21+
-- UNLOCK TABLES

install/sql/insert/post/post_content.sql

+32
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,38 @@ INSERT INTO `post_content` VALUES
205205
(12,1,'Services','services','Services', '','',''),
206206
(13,1,'Pricing','pricing','Pricing', '','',''),
207207
(14,1,'Portfolio','portfolio','Portfolio', '','',''),
208+
(15,1,'Marketplace','marketplace','Marketplace', '
209+
<div class="text-center m-4">
210+
<div class="my-5"><img src="../../media/biglogo.png"></div>
211+
<h1 class="mb-3">Marketplace vendor</h1>
212+
<p class="lead">Become a vendor and sell your products on our marketplace</p>
213+
<p class="lead">Access a market of million of customers</p>
214+
<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>
215+
<div class="mt-4">Frequently asked questions:</div>
216+
<div class="my-4 text-start row">
217+
<div class="col-md-6 mx-auto">
218+
<details>
219+
<summary>What kind of products can I sell?</summary>
220+
<p>You can sell any products that match our categories.</p>
221+
</details>
222+
<details>
223+
<summary>How much does it cost?</summary>
224+
<p>It`s free, we only take a ##% comission on each sale.</p>
225+
</details>
226+
<details>
227+
<summary>Q3</summary>
228+
<p>A</p>
229+
</details>
230+
<details>
231+
<summary>Q4</summary>
232+
<p>A</p>
233+
</details>
234+
<br>
235+
<p class="">Check our <a href="/blog">knowledge base</a> for more information </p>
236+
</div>
237+
</div>
238+
<p class="text-muted small">Our marketplace is subject to certain <a href="/page/terms-conditions-9">terms and conditions</a></p>
239+
</div>','',''),
208240
(1,2,'Incepe fiecare zi prin a-ti spune','buna-lume-1','
209241
<blockquote cite="https://en.wikipedia.org/wiki/Marcus_Aurelius">
210242
<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>

install/sql/mysqli/schema/post/post.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ CREATE TABLE `post` (
1818
PRIMARY KEY (`post_id`),
1919
KEY `type_status_date` (`type`,`status`,`sort_order`,`created_at`,`post_id`),
2020
KEY `parent` (`parent`),
21-
KEY `author` (`admin_id`)
21+
KEY `author` (`admin_id`),
22+
KEY `updated_at` (`updated_at`)
2223
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

install/sql/mysqli/schema/product/product.sql

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ CREATE TABLE `product` (
1111
`jan` varchar(13) NOT NULL DEFAULT '',
1212
`isbn` varchar(17) NOT NULL DEFAULT '',
1313
`mpn` varchar(64) NOT NULL DEFAULT '',
14+
`barcode` varchar(13) NOT NULL DEFAULT '',
15+
`hs_code` varchar(10) NOT NULL DEFAULT '',
16+
`origin_country` varchar(64) NOT NULL DEFAULT '',
17+
`mid_code` varchar(13) NOT NULL DEFAULT '',
1418
`location` varchar(128) NOT NULL DEFAULT '',
1519
`stock_quantity` int(4) NOT NULL DEFAULT '0',
1620
`stock_status_id` INT UNSIGNED NOT NULL DEFAULT 1,
@@ -21,6 +25,7 @@ CREATE TABLE `product` (
2125
`price` decimal(15,4) NOT NULL DEFAULT 0.0000,
2226
`points` int(8) NOT NULL DEFAULT '0',
2327
`tax_type_id` INT UNSIGNED NOT NULL DEFAULT 0,
28+
`material` varchar(64) NOT NULL DEFAULT '',
2429
`weight` decimal(15,8) NOT NULL DEFAULT '0.00000000',
2530
`weight_type_id` INT UNSIGNED NOT NULL DEFAULT '0',
2631
`length` decimal(15,8) NOT NULL DEFAULT '0.00000000',
@@ -39,6 +44,10 @@ CREATE TABLE `product` (
3944
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
4045
PRIMARY KEY (`product_id`),
4146
KEY `type_status_date` (`type`,`status`,`created_at`,`product_id`),
42-
KEY `stock_status_id` (`stock_status_id`)
47+
KEY `stock_status_id` (`stock_status_id`),
48+
KEY `vendor_id` (`vendor_id`),
49+
KEY `manufacturer_id` (`stock_status_id`),
50+
KEY `barcode` (`barcode`),
51+
KEY `sku` (`sku`)
4352
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
4453

install/sql/pgsql/schema/geoip/region_to_region_group.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SELECT setval('region_to_region_group_seq', 108, true); -- last inserted id by s
77
CREATE TABLE region_to_region_group (
88
"region_to_region_group_id" int check ("region_to_region_group_id" > 0) NOT NULL DEFAULT NEXTVAL ('region_to_region_group_seq'),
99
"country_id" int check ("country_id" > 0) NOT NULL,
10-
"region_id" int check ("region_id" > 0) NOT NULL DEFAULT 0,
10+
"region_id" int check ("region_id" >= 0) NOT NULL DEFAULT 0,
1111
"region_group_id" int check ("region_group_id" > 0) NOT NULL,
1212
"created_at" timestamp(0) NOT NULL DEFAULT now(),
1313
PRIMARY KEY ("region_to_region_group_id")

install/sql/pgsql/schema/order/order.sql

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ DROP SEQUENCE IF EXISTS order_seq;
44
CREATE SEQUENCE order_seq;
55
-- SELECT setval('order_seq', 0, true); -- last inserted id by sample data
66

7-
CREATE TYPE shipping_status AS ENUM
8-
('not_fulfilled', 'partially_fulfilled', 'fulfilled', 'partially_shipped', 'shipped', 'partially_returned', 'returned', 'canceled', 'requires_action');
7+
-- CREATE TYPE shipping_status AS ENUM
8+
-- ('not_fulfilled', 'partially_fulfilled', 'fulfilled', 'partially_shipped', 'shipped', 'partially_returned', 'returned', 'canceled', 'requires_action');
99

10-
CREATE TYPE shipping_status AS ENUM
11-
('not_paid', 'awaiting', 'captured', 'partially_refunded', 'refunded', 'canceled', 'requires_action');
10+
-- CREATE TYPE shipping_status AS ENUM
11+
-- ('not_paid', 'awaiting', 'captured', 'partially_refunded', 'refunded', 'canceled', 'requires_action');
1212

1313

1414
CREATE TABLE "order" (
@@ -70,5 +70,5 @@ CREATE TABLE "order" (
7070
PRIMARY KEY ("order_id")
7171
);
7272

73-
CREATE INDEX "order_order_status_id" ON order ("site_id","order_status_id","created_at");
74-
CREATE INDEX "order_customer_order_id" ON order ("customer_order_id","order_status_id","created_at");
73+
CREATE INDEX "order_order_status_id" ON "order" ("site_id","order_status_id","created_at");
74+
CREATE INDEX "order_customer_order_id" ON "order" ("customer_order_id","order_status_id","created_at");

install/sql/pgsql/schema/post/post.sql

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ CREATE TABLE post (
2626
CREATE INDEX "post_type_status_date" ON post ("type","status","sort_order","created_at","post_id");
2727
CREATE INDEX "post_parent" ON post ("parent");
2828
CREATE INDEX "post_author" ON post ("admin_id");
29+
CREATE INDEX "post_updated_at" ON post ("updated_at");

install/sql/pgsql/schema/user/user.sql

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CREATE TABLE "user" (
2121
"avatar" varchar(250) NOT NULL DEFAULT '',
2222
"bio" varchar(250) NOT NULL DEFAULT '',
2323
"token" varchar(32) NOT NULL DEFAULT '',
24+
"subscribe" smallint check ("status" >= 0) NOT NULL DEFAULT '0',
2425
"created_at" timestamp(0) NOT NULL DEFAULT now(),
2526
"updated_at" timestamp(0) NOT NULL DEFAULT now(),
2627
PRIMARY KEY ("user_id")

install/sql/sqlite/schema/post/post.sql

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ CREATE TABLE `post` (
2121
CREATE INDEX `post_type_status_date` ON `post` (`type`);
2222
CREATE INDEX `post_parent` ON `post` (`parent`);
2323
CREATE INDEX `post_author` ON `post` (`admin_id`);
24+
CREATE INDEX `post_updated_at` ON `post` (`updated_at`);

0 commit comments

Comments
 (0)