From a35ca0cd16a0395c9ab52d7c08c5f8208d94d1ac Mon Sep 17 00:00:00 2001 From: Tieptk Date: Sat, 20 Jan 2024 09:29:38 +0700 Subject: [PATCH] 20/1/2024 --- data/order/home.php | 1 + data/product/form.php | 172 +++ data/product/form_components/accessory.php | 1 + .../product/form_components/accessory_add.php | 1 + data/product/form_components/addon.php | 1 + data/product/form_components/basic.php | 1 + data/product/form_components/category.php | 1 + data/product/form_components/combo-set.php | 1 + data/product/form_components/compatible.php | 1 + data/product/form_components/component.php | 1 + .../product/form_components/component_add.php | 1 + data/product/form_components/configurable.php | 1 + data/product/form_components/description.php | 1 + data/product/form_components/image.php | 1 + data/product/form_components/instruction.php | 1 + data/product/form_components/relation.php | 1 + data/product/form_components/seo.php | 1 + data/product/form_components/similar.php | 1 + data/product/form_components/sitemanager.php | 1 + data/product/form_components/spec.php | 1 + data/product/form_components/spec_group.php | 1 + data/product/form_components/store.php | 1 + data/product/form_components/tag.php | 1 + data/product/form_components/variant.php | 1 + data/product/form_components/video.php | 1 + inc/common.php | 28 + template/order/home.html | 0 template/product/form.html | 1083 ++--------------- .../product/form_components/accessory.html | 101 ++ template/product/form_components/addon.html | 0 template/product/form_components/basic.html | 237 ++++ .../product/form_components/category.html | 41 + .../product/form_components/combo_set.html | 0 .../form_components/combo_set_select.html | 0 .../product/form_components/compatible.html | 0 .../product/form_components/component.html | 0 .../product/form_components/configurable.html | 0 .../form_components/customer_group.html | 0 .../product/form_components/description.html | 49 + template/product/form_components/image.html | 170 +++ .../product/form_components/instruction.html | 0 template/product/form_components/price.html | 0 .../product/form_components/relation.html | 0 template/product/form_components/seo.html | 63 + template/product/form_components/similar.html | 0 template/product/form_components/spec.html | 0 .../product/form_components/spec_group.html | 208 ++++ .../form_components/spec_multiple.html | 0 template/product/form_components/store.html | 0 template/product/form_components/tag.html | 0 template/product/form_components/variant.html | 130 ++ template/product/form_components/video.html | 0 template/theme.html | 11 +- 53 files changed, 1300 insertions(+), 1017 deletions(-) create mode 100644 data/order/home.php create mode 100644 data/product/form_components/accessory.php create mode 100644 data/product/form_components/accessory_add.php create mode 100644 data/product/form_components/addon.php create mode 100644 data/product/form_components/basic.php create mode 100644 data/product/form_components/category.php create mode 100644 data/product/form_components/combo-set.php create mode 100644 data/product/form_components/compatible.php create mode 100644 data/product/form_components/component.php create mode 100644 data/product/form_components/component_add.php create mode 100644 data/product/form_components/configurable.php create mode 100644 data/product/form_components/description.php create mode 100644 data/product/form_components/image.php create mode 100644 data/product/form_components/instruction.php create mode 100644 data/product/form_components/relation.php create mode 100644 data/product/form_components/seo.php create mode 100644 data/product/form_components/similar.php create mode 100644 data/product/form_components/sitemanager.php create mode 100644 data/product/form_components/spec.php create mode 100644 data/product/form_components/spec_group.php create mode 100644 data/product/form_components/store.php create mode 100644 data/product/form_components/tag.php create mode 100644 data/product/form_components/variant.php create mode 100644 data/product/form_components/video.php create mode 100644 template/order/home.html create mode 100644 template/product/form_components/accessory.html create mode 100644 template/product/form_components/addon.html create mode 100644 template/product/form_components/basic.html create mode 100644 template/product/form_components/category.html create mode 100644 template/product/form_components/combo_set.html create mode 100644 template/product/form_components/combo_set_select.html create mode 100644 template/product/form_components/compatible.html create mode 100644 template/product/form_components/component.html create mode 100644 template/product/form_components/configurable.html create mode 100644 template/product/form_components/customer_group.html create mode 100644 template/product/form_components/description.html create mode 100644 template/product/form_components/image.html create mode 100644 template/product/form_components/instruction.html create mode 100644 template/product/form_components/price.html create mode 100644 template/product/form_components/relation.html create mode 100644 template/product/form_components/seo.html create mode 100644 template/product/form_components/similar.html create mode 100644 template/product/form_components/spec.html create mode 100644 template/product/form_components/spec_group.html create mode 100644 template/product/form_components/spec_multiple.html create mode 100644 template/product/form_components/store.html create mode 100644 template/product/form_components/tag.html create mode 100644 template/product/form_components/variant.html create mode 100644 template/product/form_components/video.html diff --git a/data/order/home.php b/data/order/home.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/data/order/home.php @@ -0,0 +1 @@ + _get_product_info(), + "product_menu" => _get_product_menu(), + "view_part" => $view_part, +]; + +// helpers + +function _get_product_info() { + return [ + "id" => 12, + "title" => "Máy in mã vạch MH241", + ]; +} + +function _get_product_menu() { + $current_selected = getRequest('part', 'basic'); + $product_menu = array( + array( + 'id' => 'basic', + "name" => "Cơ bản", + ), + + array( + 'id' => 'store', + "name" => "Cửa hàng", + ), + + array( + 'id' => 'category', + "name" => "Danh mục", + ), + + array( + 'id' => 'seo', + "name" => "SEO", + ), + + array( + 'id' => 'description', + "name" => "Mô tả", + ), + + array( + 'id' => 'spec-group', + "name" => "Thông số kỹ thuật",//"Thông số", + ), + + /*"spec" => array( + "name" => "Thông số kỹ thuật nhập text", //"Bộ lọc thuộc tính", //"Thông số", + "must_have_id" => true, + "change_language" => true, + ),*/ + + /*"image-spec" => array( + "name" => "Ảnh thông số", + "must_have_id" => true, + "change_language" => true, + ),*/ + + array( + 'id' => 'instruction', + "name" => "Hướng dẫn sử dụng", + ), + + array( + 'id' => 'image', + "name" => "Ảnh", + ), + + array( + 'id' => 'variant', + "name" => "Cấu hình", + ), + + array( + 'id' => 'accessory', + "name" => "Phụ kiện", + ), + + array( + 'id' => 'addon', + "name" => "Dịch vụ/SP đi kèm", + ), + + array( + 'id' => 'video', + "name" => "Youtube", + ), + + /* "video-list" => array( + "name" => "Thư viện Youtube", + "must_have_id" => true, + "change_language" => false, + ),*/ + + /*"relate-article" => array( + "name" => "Nội dung liên quan", + "must_have_id" => true, + "change_language" => false, + ),*/ + + /*"web-link" => array( + "name" => "So sánh giá", + "must_have_id" => true, + "change_language" => false, + ),*/ + + array( + 'id' => 'tag', + "name" => "Tags", + ), + + array( + 'id' => 'relation', + "name" => "Nội dung liên quan", + ), + + array( + 'id' => 'customer-group', + "name" => "Giá theo nhóm khách hàng", + ), + + array( + 'id' => 'component', + "name" => "Thành phần", + ), + + array( + 'id' => 'configurable', + "name" => "Tùy chọn thành phần", + ), + + array( + 'id' => 'compatible', + "name" => "Sp tương thích", + ), + + array( + 'id' => 'similar', + "name" => "Sp tương tự", + ), + + array( + 'id' => 'combo-set', + "name" => "Combo Set", + ), + + ); + + return array_map(function ($item) use ($current_selected){ + $copy = $item; + $copy['is_current'] = $item['id'] == $current_selected ? 1 : 0; + + return $copy; + + }, $product_menu); +} diff --git a/data/product/form_components/accessory.php b/data/product/form_components/accessory.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/data/product/form_components/accessory.php @@ -0,0 +1 @@ += $min_value ) ? $request : $min_value; //if user tampers request parameter + return $request; +} + + +//Function to get the request value of a variable +function getRequest($var, $default=""){ + return $_REQUEST[$var] ?? $default; +} + diff --git a/template/order/home.html b/template/order/home.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form.html b/template/product/form.html index b1609ed..0bfc5e7 100644 --- a/template/product/form.html +++ b/template/product/form.html @@ -1,5 +1,4 @@ -
diff --git a/template/product/form_components/accessory.html b/template/product/form_components/accessory.html new file mode 100644 index 0000000..92d8aa1 --- /dev/null +++ b/template/product/form_components/accessory.html @@ -0,0 +1,101 @@ + + +
+ 1.Các loại phụ kiện của sản phẩm + + + + + + Chọn Sản phẩm phụ kiện + + + 2.Các danh mục + PC, Workstation + + + + + + + + + + + + + + + + + + + +
STTẢnhSản phẩmGiá hiện tạiQuản lý
1 + + + CPU Intel Xeon E5-2665 2.40 GHz / 20MB / 8 Cores 16 Threads / + Socket 2011 +
+ SKU: HN123567 + / + Số lượng: 1 +
+
+ 24.900.000 VND + +
+ + + + + + +
+
+
diff --git a/template/product/form_components/addon.html b/template/product/form_components/addon.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/basic.html b/template/product/form_components/basic.html new file mode 100644 index 0000000..4800322 --- /dev/null +++ b/template/product/form_components/basic.html @@ -0,0 +1,237 @@ + + +
+
+ 1. Thông tin cơ bản +
+ + +
+ + + + + +
+
+
+ + +
+ + + + + +
+
+
+ + +
+ + + + + +
+
+
+ + +
+ gram + + + + + +
+
+
+ + +
+ Quản lý thương hiệu +
+
+
+ + +
+
+ + +
+
+
+ 1. Thông tin cơ bản + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Giá bán lẻ +
+ + + / + +
+
+ (* Nếu dùng USD thì theo chuẩn quốc tế v.d. $134.05). + Tỷ giá: + 1 + + + + + + +
+
Thuế VAT + Giá bán +
+
+ + +
+
+ + +
+
+ + +
+
+
Giá nhập hàng +
+ + vnd (để tham khảo khi cần) +
+ +
Giá thị trường +
+ + vnd (để tham khảo khi cần) +
+ +
Số lượng kho hàng +
+ +
+ +
Khuyến mại riêng + +
Khuyến mại riêng + +
Tình trạng (Mới / Cũ) + +
Hiển thị +
+
+ + +
+
+ + +
+
+
+ +
+
diff --git a/template/product/form_components/category.html b/template/product/form_components/category.html new file mode 100644 index 0000000..054de7f --- /dev/null +++ b/template/product/form_components/category.html @@ -0,0 +1,41 @@ + + +
+ Hiện tại Sản phẩm đang được đặt trong các danh mục sau : + + +

+ Bạn có thể chọn thêm danh mục khác cho Sản phẩm hoặc chỉnh lại. +

+
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+
diff --git a/template/product/form_components/combo_set.html b/template/product/form_components/combo_set.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/combo_set_select.html b/template/product/form_components/combo_set_select.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/compatible.html b/template/product/form_components/compatible.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/component.html b/template/product/form_components/component.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/configurable.html b/template/product/form_components/configurable.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/customer_group.html b/template/product/form_components/customer_group.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/description.html b/template/product/form_components/description.html new file mode 100644 index 0000000..998b5ef --- /dev/null +++ b/template/product/form_components/description.html @@ -0,0 +1,49 @@ + + +
+
+ THƯ VIỆN ẢNH + Chưa có thư viện ảnh cho phần miêu tả +
+ + + +
diff --git a/template/product/form_components/image.html b/template/product/form_components/image.html new file mode 100644 index 0000000..0261a2c --- /dev/null +++ b/template/product/form_components/image.html @@ -0,0 +1,170 @@ + + + +
+
+
+ Ảnh chính + +

(Hình sản phẩm)

+ + + + + + + + +
+
+

STT

+ +
+
+

ALT

+ +
+
+
+
+ Ảnh chính + +

(Hình sản phẩm)

+ + + + + + + + +
+
+

STT

+ +
+
+

ALT

+ +
+
+
+
+ Ảnh chính + +

(Hình sản phẩm)

+ + + + + + + + +
+
+

STT

+ +
+
+

ALT

+ +
+
+
+
+
+ Thêm ảnh cho sản phẩm +

Bạn có thể: Chọn ảnh có sẵn trong kho ảnh, hoặc upload ảnh từ máy tính:

+ +

Chú ý: Bạn có thể chọn nhiều ảnh cùng 1 + lúc: + Chấp nhận các file ảnh: jpg,gif

+
+ +
+ Chú ý: +
    +
  • - Ảnh Sản phẩm kích thước lớn sẽ được tự động co lại thành các ảnh + nhỏ hơn cho những vị trí liên quan. Tùy giao + diện website của bạn mà kích thước ảnh Sản phẩm khác nhau. Click vào đây để + quy định kích thước ảnh Sản phẩm.
  • +
  • + - Chỉ dùng file ảnh đuôi .jpg và .gif. +
  • +
  • + - Cập nhật hình ảnh cho Sản phẩm ở nhiều góc cạnh, màu sắc để người dùng xem + rõ nhất. Nên cập nhật ảnh có kích thước lớn + và độ phân giải cao. +
  • +
+
+
diff --git a/template/product/form_components/instruction.html b/template/product/form_components/instruction.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/price.html b/template/product/form_components/price.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/relation.html b/template/product/form_components/relation.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/seo.html b/template/product/form_components/seo.html new file mode 100644 index 0000000..5a44c06 --- /dev/null +++ b/template/product/form_components/seo.html @@ -0,0 +1,63 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Link truy cập tại website + + https://demopc8.hurasoft.com/may-in-ma-vach-mh241 +
Tên index + +
Thay đổi link trung cập khi thay đổi tên index ? +
+ + + Có thay đổi (Tích chọn nếu bạn muốn hệ thống thay đổi link truy cập. + Cảnh báo: sẽ ảnh hưởng tới kết quả SEO) + +
+ +
Url canonical + + * để trống sẽ dùng link mặc định của hệ thống +
Meta Title + + * 0 ký tự , 0 từ +
Meta Description(nên tối đa 160 ký tự) + + 0 ký tự , 0 từ (Khuyến nghị: 160 ký tự) +
+ +
diff --git a/template/product/form_components/similar.html b/template/product/form_components/similar.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/spec.html b/template/product/form_components/spec.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/spec_group.html b/template/product/form_components/spec_group.html new file mode 100644 index 0000000..3ba4360 --- /dev/null +++ b/template/product/form_components/spec_group.html @@ -0,0 +1,208 @@ + + +
+ + + + + + + + + + + + + + + + + +
+ Màu sắc 5 +

mau_sac_5

+ Dùng tạo lựa chọn SP +
+
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+
+ Bổ sung giá trị: +

mỗi giá trị 1 dòng

+ + + + + + +
+ +
+ Màu sắc 5 +

mau_sac_5

+ Dùng tạo lựa chọn SP +
+
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+
+ Bổ sung giá trị: +

mỗi giá trị 1 dòng

+ + + + + + +
+ +
+ Màu sắc 5 +

mau_sac_5

+ Dùng tạo lựa chọn SP +
+
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+
+ Bổ sung giá trị: +

mỗi giá trị 1 dòng

+ + + + + + +
+ +
+ Màu sắc 5 +

mau_sac_5

+ Dùng tạo lựa chọn SP +
+
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+ + Màn hình máy tính +
+
+
+ Bổ sung giá trị: +

mỗi giá trị 1 dòng

+ + + + + + +
+ +
+ +
diff --git a/template/product/form_components/spec_multiple.html b/template/product/form_components/spec_multiple.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/store.html b/template/product/form_components/store.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/tag.html b/template/product/form_components/tag.html new file mode 100644 index 0000000..e69de29 diff --git a/template/product/form_components/variant.html b/template/product/form_components/variant.html new file mode 100644 index 0000000..eb09ecc --- /dev/null +++ b/template/product/form_components/variant.html @@ -0,0 +1,130 @@ + + +
+ Chủng loại của sản phẩm + + + + + + + Sửa thuộc tính + + +

* Chú ý: Giá bán của sản phẩm sẽ là giá của + chủng loại + được chọn. Nếu giá chủng + loại=0 thì sẽ mặc định dùng giá sản + phẩm. Cài đặt giá chung cho sản phẩm ở Tab "Cơ bản"

+
+

Cài nhanh cho tất cả chủng loại:

+
+

Giá bán:

+ +
+
+

Số lượng:

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ẢnhMã khoTênGiá bánSLLinh ngoài +
+ + Hiển thị +
+
Quản lý
+ + + + + + + + + + + + + + + + + + STT + + + + + + + + + + +
+ + + + Thêm chủng loại + + +
diff --git a/template/product/form_components/video.html b/template/product/form_components/video.html new file mode 100644 index 0000000..e69de29 diff --git a/template/theme.html b/template/theme.html index 615615a..f6dca95 100644 --- a/template/theme.html +++ b/template/theme.html @@ -27,7 +27,6 @@ -
{{ global | show_var }}
- -