File size: 2,053 Bytes
a94ad2f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # Cách thêm script tags vào index.html
## Bước 1: Tìm vị trí cần thêm
Trong file `index.html`, tìm dòng:
```html
<script src="quote-ui.js?v=8"></script>
```
## Bước 2: Thêm các dòng sau NGAY SAU dòng trên
```html
<script src="vai-complete-quote.js?v=1"></script>
<script src="export-functions.js?v=1"></script>
```
## Bước 3: Kiểm tra
Sau khi thêm, file `index.html` sẽ có các script tags này ở gần cuối (trước `</body>`):
```html
<script src="url-added-live-loader.js?v=1019"></script>
<script src="order-store.js?v=19"></script>
<script src="quote-ui.js?v=8"></script>
<script src="vai-complete-quote.js?v=1"></script>
<script src="export-functions.js?v=1"></script>
<script src="qr-payment.js?v=25"></script>
...
```
## Bước 4: Rebuild Space
1. Vào https://huggingface.co/spaces/bep40/V.AISTUDIO/settings
2. Nhấn nút "Rebuild" hoặc "Factory rebuild"
3. Đợi khoảng 2-3 phút để Space khởi động lại
## Bước 5: Kiểm tra tính năng
1. Mở Space: https://bep40-v-aistudio.static.hf.space
2. Thêm sản phẩm vào giỏ hàng
3. Mở giỏ hàng (icon giỏ hàng trên header)
4. Nhấn "Báo giá"
5. Nhập mã `V.AISTUDIO` vào ô "Mã truy cập"
6. Kiểm tra các nút:
- ✅ "Lưu" (saveOrder) - luôn hiện
- ✅ "Đơn hàng" (openOrderPage) - hiện sau khi nhập mã
- ✅ "Excel Giao" (exportDeliveryExcel) - hiện sau khi nhập mã
- ✅ "PDF Giao" (exportDeliveryPDF) - hiện sau khi nhập mã
## Lưu ý quan trọng
- File `index.html` hiện tại ~177KB, quá lớn để chỉnh sửa qua AI tools
- Cần chỉnh sửa thủ công qua giao diện Hugging Face hoặc dùng Git
- Các file JS đã được tải lên và sẵn sàng: `vai-complete-quote.js`, `export-functions.js`
## Cách thêm nhanh qua Git
```bash
git clone https://huggingface.co/spaces/bep40/V.AISTUDIO
cd V.AISTUDIO
# Sửa file index.html, thêm 2 dòng script sau quote-ui.js
git add index.html
git commit -m "Add quote system scripts"
git push
```
|