{"id":1368,"date":"2025-08-27T12:24:23","date_gmt":"2025-08-27T05:24:23","guid":{"rendered":"https:\/\/cuongnguyen.io.vn\/?p=1368"},"modified":"2025-08-27T12:24:23","modified_gmt":"2025-08-27T05:24:23","slug":"huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh","status":"publish","type":"post","link":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/2025\/08\/27\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh\/","title":{"rendered":"H\u01b0\u1edbng D\u1eabn Share File Google Drive Tr\u00ean Woocommerce Khi Thanh To\u00e1n Ho\u00e0n Th\u00e0nh"},"content":{"rendered":"<p><strong><em>C\u00e1c anh em \u0111ang b\u00e1n \u0111\u1ed3 digital tr\u00ean WooCommerce nh\u01b0 course h\u1ecdc, preset \u1ea3nh, template x\u1ecbn x\u00f2,\u2026! B\u1ea1n c\u00f3 \u0111ang \u201cch\u1eadt v\u1eadt\u201d v\u1edbi c\u1ea3nh ng\u1ed3i c\u1eb7m c\u1ee5i g\u1eedi file th\u1ee7 c\u00f4ng cho t\u1eebng kh\u00e1ch kh\u00f4ng?<\/em><\/strong><\/p>\n<p><strong><em>N\u1ebfu c\u00e2u tr\u1ea3 l\u1eddi l\u00e0 C\u00d3, th\u00ec b\u00e0i vi\u1ebft n\u00e0y ch\u00ednh l\u00e0 \u201cphao c\u1ee9u sinh\u201d d\u00e0nh cho b\u1ea1n. Tui s\u1ebd h\u01b0\u1edbng d\u1eabn t\u1eeb A-Z c\u00e1ch hack quy tr\u00ecnh n\u00e0y, \u0111\u1ec3 b\u1ea1n nh\u00e0n t\u00eanh m\u00e0 kh\u00e1ch h\u00e0ng v\u1eabn \u201cch\u1ed1t \u0111\u01a1n\u201d lia l\u1ecba v\u00ec s\u1ef1 chuy\u00ean nghi\u1ec7p. Let\u2019s go!<\/em><\/strong><\/p>\n<h2 class=\"wp-block-heading\">1. Share File Th\u1ee7 C\u00f4ng: T\u1ea1i Sao V\u1eeba M\u1ec7t V\u1eeba D\u1ec5 \u201cToang\u201d? \ud83e\udd14<\/h2>\n<p>\u1ee6a, g\u1eedi tay th\u00ec c\u00f3 sao \u0111\u00e2u? Tin tui \u0111i, khi shop b\u1ea1n b\u1eaft \u0111\u1ea7u c\u00f3 nhi\u1ec1u \u0111\u01a1n, \u0111\u00e2y l\u00e0 nh\u1eefng \u201cc\u01a1n \u00e1c m\u1ed9ng\u201d b\u1ea1n s\u1ebd g\u1eb7p ph\u1ea3i:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>T\u1ed1n S\u1ee9c, M\u1ea5t Time \ud83d\ude29:<\/strong>\u00a0Th\u1eed t\u01b0\u1edfng t\u01b0\u1ee3ng m\u1ed7i ng\u00e0y c\u00f3 ch\u1ee5c \u0111\u01a1n, b\u1ea1n ph\u1ea3i l\u1eb7p \u0111i l\u1eb7p l\u1ea1i vi\u1ec7c t\u00ecm file, copy link, g\u1eedi mail. Th\u1eddi gian \u0111\u00f3 \u0111\u1ec3 b\u1ea1n ngh\u0129 content m\u1edbi, marketing hay h\u01a1n kh\u00f4ng?<\/li>\n<li><strong>G\u1eedi Nh\u1ea7m File \u2013 \u201cToang\u201d C\u1ea3 Uy T\u00edn \ud83e\udd2f:<\/strong>\u00a0Gi\u1eefa m\u1ed9t \u201cr\u1eebng\u201d \u0111\u01a1n h\u00e0ng, g\u1eedi nh\u1ea7m file cho kh\u00e1ch l\u00e0 chuy\u1ec7n d\u1ec5 nh\u01b0 \u0103n k\u1eb9o. M\u1ed9t \u201cph\u1ed1t\u201d nh\u1ecf c\u00f3 th\u1ec3 khi\u1ebfn c\u00f4ng s\u1ee9c x\u00e2y d\u1ef1ng th\u01b0\u01a1ng hi\u1ec7u c\u1ee7a b\u1ea1n \u201cbay m\u00e0u\u201d.<\/li>\n<li><strong>Kh\u00e1ch T\u1ee5t Mood, M\u1ed9t \u0110i Kh\u00f4ng Tr\u1edf L\u1ea1i \ud83d\udcc9:<\/strong>\u00a0Th\u1eddi \u0111\u1ea1i n\u00e0y, ai c\u0169ng mu\u1ed1n \u201c\u0103n li\u1ec1n\u201d. Kh\u00e1ch \u0111\u00e3 tr\u1ea3 ti\u1ec1n m\u00e0 ph\u1ea3i ng\u1ed3i ch\u1edd b\u1ea1n online \u0111\u1ec3 g\u1eedi file th\u00ec h\u1ecd s\u1ebd t\u1ee5t mood, \u0111\u00e1nh gi\u00e1 1 sao v\u00e0 kh\u00f4ng bao gi\u1edd quay l\u1ea1i.<\/li>\n<\/ul>\n<p><strong>\u2728 C\u1ee9u tinh \u1edf \u0111\u00e2y:<\/strong>\u00a0T\u00edch h\u1ee3p h\u1ec7 th\u1ed1ng t\u1ef1 \u0111\u1ed9ng! Ch\u1ec9 c\u1ea7n kh\u00e1ch thanh to\u00e1n th\u00e0nh c\u00f4ng, \u201cp\u1eb1ng\u201d m\u1ed9t c\u00e1i, link file Google Drive s\u1ebd \u0111\u01b0\u1ee3c g\u1eedi th\u1eb3ng v\u00e0o email c\u1ee7a h\u1ecd. Nhanh \u2013 G\u1ecdn \u2013 Chu\u1ea9n X\u00e1c!<\/p>\n<h3 class=\"wp-block-heading\"><strong>V\u00ed d\u1ee5 th\u1ef1c t\u1ebf cho d\u1ec5 h\u00ecnh dung:<\/strong><\/h3>\n<p>T\u01b0\u1edfng t\u01b0\u1ee3ng b\u1ea1n c\u00f3 m\u1ed9t shop b\u00e1n Ebook.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Kh\u00f4ng auto:<\/strong>\u00a0Kh\u00e1ch mua s\u00e1ch l\u00fac n\u1eeda \u0111\u00eam. S\u00e1ng mai b\u1ea1n ng\u1ee7 d\u1eady m\u1edbi th\u1ea5y \u0111\u01a1n, loay hoay t\u00ecm file g\u1eedi \u0111i. Kh\u00e1ch \u0111\u00e3 ch\u1edd c\u1ea3 \u0111\u00eam, tr\u1ea3i nghi\u1ec7m c\u1ef1c t\u1ec7.<\/li>\n<li><strong>C\u00f3 auto:<\/strong>\u00a0Kh\u00e1ch mua s\u00e1ch l\u00fac 2 gi\u1edd s\u00e1ng. Ngay sau khi thanh to\u00e1n xong, email ch\u1ee9a link t\u1ea3i s\u00e1ch \u0111\u00e3 n\u1eb1m g\u1ecdn trong inbox c\u1ee7a h\u1ecd. Kh\u00e1ch vui, b\u1ea1n kh\u1ecfe, uy t\u00edn shop t\u0103ng v\u00f9n v\u1ee5t!<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">2. Auto Share File Google Drive x WooCommerce: Combo N\u00e0y \u201c\u0110\u1ec9nh Ch\u00f3p\u201d C\u1ee1 N\u00e0o?<\/h2>\n<p>Khi b\u1ea1n k\u1ebft h\u1ee3p hai \u201c\u00f4ng tr\u00f9m\u201d n\u00e0y, l\u1ee3i \u00edch nh\u1eadn l\u1ea1i l\u00e0 kh\u00f4ng \u0111\u00f9a \u0111\u01b0\u1ee3c \u0111\u00e2u:<\/p>\n<ul class=\"wp-block-list\">\n<li>\u2705\u00a0<strong>Nh\u00e0n T\u00eanh:<\/strong>\u00a0H\u1ec7 th\u1ed1ng t\u1ef1 lo h\u1ebft. B\u1ea1n c\u1ee9 ung dung \u0111i ng\u1ee7, \u0111i ch\u01a1i, \u0111\u01a1n h\u00e0ng v\u1eabn \u0111\u01b0\u1ee3c x\u1eed l\u00fd \u00eam ru.<\/li>\n<li>\u2705\u00a0<strong>Chu\u1ea9n \u0110\u00e9t 100%:<\/strong>\u00a0M\u00e1y m\u00f3c th\u00ec kh\u00f4ng bao gi\u1edd nh\u1ea7m. Kh\u00e1ch mua s\u1ea3n ph\u1ea9m A ch\u1eafc ch\u1eafn s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c file A, kh\u00f4ng c\u00f3 chuy\u1ec7n \u201cr\u00e2u \u00f4ng n\u1ecd c\u1eafm c\u1eb1m b\u00e0 kia\u201d.<\/li>\n<li>\u2705\u00a0<strong>Kh\u00e1ch Iu H\u1ebft N\u1ea5c:<\/strong>\u00a0Nh\u1eadn h\u00e0ng ngay l\u1eadp t\u1ee9c l\u00e0 tr\u1ea3i nghi\u1ec7m \u201cwow\u201d khi\u1ebfn kh\u00e1ch h\u00e0ng c\u1ef1c k\u1ef3 h\u00e0i l\u00f2ng, d\u1ec5 d\u00e0ng ch\u1ed1t \u0111\u01a1n l\u1ea1i l\u1ea7n sau.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">3. H\u01b0\u1edbng D\u1eabn Set Up Auto Share File T\u1eeb A-Z cho Ng\u01b0\u1eddi M\u1edbi<\/h2>\n<p>Nghe th\u00ec \u201ch\u1ea7m h\u1ed1\u201d v\u1eady th\u00f4i ch\u1ee9 l\u00e0m d\u1ec5 l\u1eafm. C\u1ee9 l\u00e0m theo c\u00e1c b\u01b0\u1edbc n\u00e0y l\u00e0 \u0111\u01b0\u1ee3c:<\/p>\n<h3 class=\"wp-block-heading\"><strong>B\u01b0\u1edbc 1: G\u1eafn Link Google Drive V\u00e0o S\u1ea3n Ph\u1ea9m<\/strong><\/h3>\n<p>\u0110\u1ea7u ti\u00ean, b\u1ea1n v\u00e0o trang qu\u1ea3n tr\u1ecb WooCommerce:<\/p>\n<ol class=\"wp-block-list\" start=\"1\">\n<li>M\u1edf\u00a0<code>S\u1ea3n ph\u1ea9m<\/code>\u00a0-&gt; ch\u1ecdn s\u1ea3n ph\u1ea9m b\u1ea1n mu\u1ed1n b\u00e1n.<\/li>\n<li>T\u00ecm m\u1ed9t ch\u1ed7 nh\u01b0 \u201cM\u00f4 t\u1ea3 ng\u1eafn\u201d ho\u1eb7c d\u00f9ng plugin t\u1ea1o m\u1ed9t \u201cTr\u01b0\u1eddng t\u00f9y ch\u1ec9nh\u201d (custom field).<\/li>\n<li>D\u00e1n URL c\u1ee7a file Google Drive t\u01b0\u01a1ng \u1ee9ng v\u00e0o \u0111\u00f3.<\/li>\n<\/ol>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>\ud83e\udd2b L\u01b0u \u00fd c\u1ef1c m\u1ea1nh:<\/strong>\u00a0Link Google Drive ph\u1ea3i \u0111\u01b0\u1ee3c set quy\u1ec1n\u00a0<strong>\u201cB\u1ea5t k\u1ef3 ai c\u00f3 \u0111\u01b0\u1eddng li\u00ean k\u1ebft\u201d (Anyone with the link)<\/strong>. N\u1ebfu kh\u00f4ng, h\u1ec7 th\u1ed1ng s\u1ebd kh\u00f4ng t\u1ef1 \u0111\u1ed9ng share \u0111\u01b0\u1ee3c v\u00e0 b\u1ea1n l\u1ea1i ph\u1ea3i c\u1ea5p quy\u1ec1n th\u1ee7 c\u00f4ng \u0111\u00f3!<\/p><\/blockquote>\n<h3 class=\"wp-block-heading\"><strong>B\u01b0\u1edbc 2: Flow C\u1ee7a \u201cTh\u01b0\u1ee3ng \u0110\u1ebf\u201d (Kh\u00e1ch H\u00e0ng)<\/strong><\/h3>\n<p>Ph\u1ea7n n\u00e0y th\u00ec WooCommerce lo h\u1ebft, b\u1ea1n kh\u00f4ng c\u1ea7n can thi\u1ec7p:<\/p>\n<ul class=\"wp-block-list\">\n<li>Kh\u00e1ch l\u01b0\u1edbt shop, b\u1ecf s\u1ea3n ph\u1ea9m v\u00e0o gi\u1ecf h\u00e0ng.<\/li>\n<li>\u0110i\u1ec1n th\u00f4ng tin, \u0111\u1eb7c bi\u1ec7t l\u00e0\u00a0<strong>email<\/strong>\u00a0\u0111\u1ec3 nh\u1eadn file.<\/li>\n<li>\u201cTING TING\u201d, thanh to\u00e1n th\u00e0nh c\u00f4ng!<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\"><strong>B\u01b0\u1edbc 3: H\u1ec7 Th\u1ed1ng T\u1ef1 \u201cRa Tay\u201d Khi \u0110\u01a1n Ho\u00e0n T\u1ea5t<\/strong><\/h3>\n<p>\u0110\u00e2y l\u00e0 kho\u1ea3nh kh\u1eafc k\u1ef3 di\u1ec7u nh\u1ea5t. Ngay khi tr\u1ea1ng th\u00e1i \u0111\u01a1n h\u00e0ng trong WooCommerce chuy\u1ec3n th\u00e0nh\u00a0<strong>\u201cHo\u00e0n th\u00e0nh\u201d (Completed)<\/strong>, h\u1ec7 th\u1ed1ng s\u1ebd:<\/p>\n<ul class=\"wp-block-list\">\n<li>T\u1ef1 \u0111\u1ed9ng g\u1eedi m\u1ed9t email \u0111\u1ebfn kh\u00e1ch h\u00e0ng.<\/li>\n<li>Trong email \u0111\u00f3 c\u00f3 ch\u1ee9a link Google Drive b\u1ea1n \u0111\u00e3 c\u00e0i \u1edf B\u01b0\u1edbc 1.<\/li>\n<li>Quy\u1ec1n truy c\u1eadp file ch\u1ec9 l\u00e0\u00a0<strong>\u201cNg\u01b0\u1eddi xem\u201d (Viewer)<\/strong>, kh\u00e1ch ch\u1ec9 c\u00f3 th\u1ec3 xem v\u00e0 t\u1ea3i xu\u1ed1ng, kh\u00f4ng th\u1ec3 ch\u1ec9nh s\u1eeda l\u00e0m h\u1ecfng file g\u1ed1c c\u1ee7a b\u1ea1n.<\/li>\n<\/ul>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>\u26a0\ufe0f C\u1ea3nh b\u00e1o:<\/strong>\u00a0N\u1ebfu quy tr\u00ecnh thanh to\u00e1n c\u1ee7a b\u1ea1n kh\u00f4ng t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n tr\u1ea1ng th\u00e1i \u0111\u01a1n h\u00e0ng sang \u201cHo\u00e0n th\u00e0nh\u201d, h\u1ec7 th\u1ed1ng s\u1ebd kh\u00f4ng g\u1eedi file. H\u00e3y ch\u1eafc ch\u1eafn c\u1ed5ng thanh to\u00e1n c\u1ee7a b\u1ea1n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u00fang nh\u00e9!<\/p><\/blockquote>\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-1337\" src=\"http:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/08\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh.png\" sizes=\"(max-width: 645px) 100vw, 645px\" srcset=\"http:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/08\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh.png 645w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-189x300.png 189w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-768x1220.png 768w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-967x1536.png 967w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-1289x2048.png 1289w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-scaled.png 1612w\" alt=\"\" width=\"645\" height=\"1024\" \/><\/figure>\n<h2 class=\"wp-block-heading\">4. C\u00e0i Plugin \u201cCh\u00e2n \u00c1i\u201d &amp; C\u1ea5u H\u00ecnh<\/h2>\n<p>\u0110\u1ec3 l\u00e0m \u0111\u01b0\u1ee3c nh\u1eefng \u0111i\u1ec1u tr\u00ean, b\u1ea1n c\u1ea7n m\u1ed9t \u201ctr\u1ee3 th\u1ee7\u201d. \u0110\u00f3 l\u00e0 c\u00e1c plugin.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>C\u00e0i \u0111\u1eb7t plugin:<\/strong>\u00a0V\u00e0o\u00a0<code>Plugins<\/code>\u00a0-&gt;\u00a0<code>Add New<\/code>, t\u00ecm c\u00e1c plugin v\u1edbi t\u1eeb kh\u00f3a nh\u01b0\u00a0<code>WooCommerce Google Drive Product Share<\/code>\u00a0ho\u1eb7c\u00a0<code>File Manager for WooCommerce<\/code>.<\/li>\n<li><strong>C\u1ea5u h\u00ecnh:<\/strong>\u00a0Sau khi c\u00e0i, b\u1ea1n ch\u1ec9 c\u1ea7n l\u00e0m theo h\u01b0\u1edbng d\u1eabn c\u1ee7a plugin \u0111\u00f3, th\u01b0\u1eddng l\u00e0 k\u1ebft n\u1ed1i v\u1edbi t\u00e0i kho\u1ea3n Google Drive c\u1ee7a b\u1ea1n v\u00e0 thi\u1ebft l\u1eadp v\u00e0i t\u00f9y ch\u1ecdn \u0111\u01a1n gi\u1ea3n.<\/li>\n<li><strong>C\u00e0i \u0111\u1eb7t trigger:<\/strong>\u00a0Quan tr\u1ecdng nh\u1ea5t l\u00e0 v\u00e0o ph\u1ea7n c\u00e0i \u0111\u1eb7t c\u1ee7a plugin v\u00e0 ch\u1ecdn ch\u1ec9 chia s\u1ebb file khi \u0111\u01a1n h\u00e0ng \u1edf tr\u1ea1ng th\u00e1i\u00a0<strong>\u201cHo\u00e0n th\u00e0nh\u201d<\/strong>.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">5. Pro-tips: Nh\u1eefng L\u01b0u \u00dd \u201cX\u01b0\u01a1ng M\u00e1u\u201d \u0110\u1ec3 Tr\u00e1nh \u201cPh\u1ed1t\u201d \ud83d\udee1\ufe0f<\/h2>\n<p>\u0110\u1ec3 quy tr\u00ecnh ch\u1ea1y m\u01b0\u1ee3t m\u00e0 v\u00e0 pro, h\u00e3y b\u1ecf t\u00fai m\u1ea5y b\u00ed k\u00edp n\u00e0y:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Ph\u00e2n Quy\u1ec1n Th\u00f4ng Minh:<\/strong>\u00a0Lu\u00f4n lu\u00f4n nh\u1edb ch\u1ec9 c\u1ea5p quy\u1ec1n\u00a0<strong>Xem v\u00e0 T\u1ea3i xu\u1ed1ng<\/strong>. \u0110\u1eebng bao gi\u1edd c\u1ea5p quy\u1ec1n \u201cCh\u1ec9nh s\u1eeda\u201d (Editor), tr\u1eeb khi b\u1ea1n mu\u1ed1n file c\u1ee7a m\u00ecnh m\u1ed9t ng\u00e0y \u0111\u1eb9p tr\u1eddi \u201ckh\u00f4ng c\u00e1nh m\u00e0 bay\u201d.<\/li>\n<li><strong>Double-Check Link Tr\u01b0\u1edbc Khi \u201cL\u00ean S\u00f3ng\u201d:<\/strong>\u00a0Tr\u01b0\u1edbc khi \u0111\u0103ng b\u00e1n s\u1ea3n ph\u1ea9m, h\u00e3y t\u1ef1 copy link \u0111\u00f3 v\u00e0 m\u1edf b\u1eb1ng m\u1ed9t tr\u00ecnh duy\u1ec7t \u1ea9n danh xem c\u00f3 v\u00e0o \u0111\u01b0\u1ee3c kh\u00f4ng. C\u1ea9n th\u1eadn kh\u00f4ng bao gi\u1edd th\u1eeba!<\/li>\n<li><strong>Update File? Nh\u1edb Update Link Ngay!:<\/strong>\u00a0N\u1ebfu b\u1ea1n c\u00f3 c\u1eadp nh\u1eadt phi\u00ean b\u1ea3n m\u1edbi cho t\u00e0i li\u1ec7u, ph\u1ea7n m\u1ec1m,\u2026 h\u00e3y c\u1eadp nh\u1eadt l\u1ea1i ngay file tr\u00ean Google Drive v\u00e0 \u0111\u1ea3m b\u1ea3o link trong s\u1ea3n ph\u1ea9m WooCommerce v\u1eabn \u0111\u00fang. Tr\u00e1nh \u0111\u1ec3 kh\u00e1ch h\u00e0ng t\u1ea3i ph\u1ea3i phi\u00ean b\u1ea3n c\u0169 r\u00edch.<\/li>\n<\/ul>\n<p>\u0110\u00f3, \u201ceasy game\u201d ch\u01b0a? Vi\u1ec7c t\u1ef1 \u0111\u1ed9ng h\u00f3a n\u00e0y kh\u00f4ng ch\u1ec9 gi\u00fap b\u1ea1n ti\u1ebft ki\u1ec7m h\u00e0ng t\u1ea5n th\u1eddi gian m\u00e0 c\u00f2n n\u00e2ng t\u1ea7m s\u1ef1 chuy\u00ean nghi\u1ec7p cho shop c\u1ee7a b\u1ea1n. Tri\u1ec3n ngay th\u00f4i!<\/p>\n<p>Code ch\u1ee9c n\u0103ng t\u1ef1 \u0111\u1ed9ng chia s\u1ebb file Google Drive t\u1edbi email kh\u00e1ch h\u00e0ng sau khi thanh to\u00e1n qua WooCommerce<\/p>\n<p>Ph\u1ea7n d\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u00e3 code chi ti\u1ebft c\u00f9ng v\u1edbi gi\u1ea3i th\u00edch t\u1eebng b\u01b0\u1edbc gi\u00fap b\u1ea1n thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng chia s\u1ebb file Google Drive t\u1ef1 \u0111\u1ed9ng khi kh\u00e1ch h\u00e0ng thanh to\u00e1n th\u00e0nh c\u00f4ng tr\u00ean WooCommerce.<\/p>\n<h3 class=\"wp-block-heading\">1. Th\u00eam CSS \u1ea9n l\u1edbp\u00a0<code>message-container<\/code><\/h3>\n<p>H\u00e0m\u00a0<code>custom_hide_message_container_css()<\/code>\u00a0s\u1ebd th\u00eam m\u1ed9t \u0111o\u1ea1n CSS \u0111\u1ec3 \u1ea9n l\u1edbp\u00a0<code>message-container<\/code>, gi\u00fap lo\u1ea1i b\u1ecf b\u1ea5t k\u1ef3 th\u00f4ng b\u00e1o kh\u00f4ng c\u1ea7n thi\u1ebft n\u00e0o tr\u00ean giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng.<\/p>\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-hl-loaded cbp-ff-loaded\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\">\n<pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><\/pre>\n<pre class=\"shiki nord\" tabindex=\"0\"><code><span class=\"line\">add_action('wp_head', 'custom_hide_message_container_css');<\/span>\n\n<span class=\"line\">function custom_hide_message_container_css() {<\/span>\n<span class=\"line\">    echo \"&lt;style&gt;<\/span>\n<span class=\"line\">        .message-container { display: none; }<\/span>\n<span class=\"line\">    &lt;\/style&gt;\";<\/span>\n<span class=\"line\">}<\/span><\/code><\/pre>\n<\/div>\n<h3 class=\"wp-block-heading\">2. Th\u00eam tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh \u0111\u1ec3 nh\u1eadp li\u00ean k\u1ebft Google Drive cho t\u1eebng s\u1ea3n ph\u1ea9m<\/h3>\n<p>Ph\u1ea7n n\u00e0y s\u1eed d\u1ee5ng h\u00e0m\u00a0<code>add_drive_links_custom_field()<\/code>\u00a0\u0111\u1ec3 th\u00eam tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh v\u00e0o trang qu\u1ea3n l\u00fd s\u1ea3n ph\u1ea9m, cho ph\u00e9p admin nh\u1eadp c\u00e1c li\u00ean k\u1ebft Google Drive t\u01b0\u01a1ng \u1ee9ng v\u1edbi t\u1eebng s\u1ea3n ph\u1ea9m.<\/p>\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-hl-loaded cbp-ff-loaded\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\">\n<pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><\/pre>\n<pre class=\"shiki nord\" tabindex=\"0\"><code><span class=\"line\">add_action('woocommerce_product_options_general_product_data', 'add_drive_links_custom_field');<\/span>\n\n<span class=\"line\">function add_drive_links_custom_field() {<\/span>\n<span class=\"line\">    woocommerce_wp_textarea_input(array(<\/span>\n<span class=\"line\">        'id' =&gt; '_drive_links',<\/span>\n<span class=\"line\">        'label' =&gt; 'Google Drive Links',<\/span>\n<span class=\"line\">        'description' =&gt; 'Nh\u1eadp c\u00e1c li\u00ean k\u1ebft Google Drive (m\u1ed7i li\u00ean k\u1ebft tr\u00ean m\u1ed9t d\u00f2ng)',<\/span>\n<span class=\"line\">        'desc_tip' =&gt; 'true',<\/span>\n<span class=\"line\">        'placeholder' =&gt; 'https:\/\/drive.google.com\/...',<\/span>\n<span class=\"line\">    ));<\/span>\n<span class=\"line\">}<\/span><\/code><\/pre>\n<\/div>\n<h3 class=\"wp-block-heading\">3. L\u01b0u tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh khi l\u01b0u s\u1ea3n ph\u1ea9m<\/h3>\n<p>H\u00e0m\u00a0<code>save_drive_links_custom_field()<\/code>\u00a0gi\u00fap l\u01b0u c\u00e1c li\u00ean k\u1ebft Google Drive v\u00e0o meta d\u1eef li\u1ec7u c\u1ee7a t\u1eebng s\u1ea3n ph\u1ea9m. \u0110i\u1ec1u n\u00e0y \u0111\u1ea3m b\u1ea3o r\u1eb1ng m\u1ed7i s\u1ea3n ph\u1ea9m s\u1ebd c\u00f3 li\u00ean k\u1ebft Google Drive t\u01b0\u01a1ng \u1ee9ng, s\u1eb5n s\u00e0ng \u0111\u1ec3 g\u1eedi \u0111\u1ebfn kh\u00e1ch h\u00e0ng sau khi ho\u00e0n t\u1ea5t thanh to\u00e1n.<\/p>\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-hl-loaded cbp-ff-loaded\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\">\n<pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><\/pre>\n<pre class=\"shiki nord\" tabindex=\"0\"><code><span class=\"line\">add_action('woocommerce_process_product_meta', 'save_drive_links_custom_field');<\/span>\n\n<span class=\"line\">function save_drive_links_custom_field($post_id) {<\/span>\n<span class=\"line\">    $drive_links = isset($_POST['_drive_links']) ? sanitize_textarea_field($_POST['_drive_links']) : '';<\/span>\n<span class=\"line\">    update_post_meta($post_id, '_drive_links', $drive_links);<\/span>\n<span class=\"line\">}<\/span><\/code><\/pre>\n<\/div>\n<h3 class=\"wp-block-heading\">4. G\u1eedi email x\u00e1c nh\u1eadn \u0111\u01a1n h\u00e0ng v\u1edbi li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 gi\u1ea3m gi\u00e1<\/h3>\n<p>H\u00e0m\u00a0<code>send_drive_links_on_order_complete()<\/code>\u00a0s\u1ebd \u0111\u01b0\u1ee3c k\u00edch ho\u1ea1t khi \u0111\u01a1n h\u00e0ng chuy\u1ec3n sang tr\u1ea1ng th\u00e1i \u201cHo\u00e0n th\u00e0nh\u201d. H\u1ec7 th\u1ed1ng s\u1ebd ki\u1ec3m tra t\u1eebng s\u1ea3n ph\u1ea9m trong \u0111\u01a1n h\u00e0ng, t\u1ea1o m\u00e3 gi\u1ea3m gi\u00e1 d\u00e0nh ri\u00eang cho kh\u00e1ch h\u00e0ng, sau \u0111\u00f3 g\u1eedi email th\u00f4ng b\u00e1o v\u1edbi li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 QR.<\/p>\n<ul class=\"wp-block-list\">\n<li>M\u00e3 gi\u1ea3m gi\u00e1 c\u00e1 nh\u00e2n h\u00f3a: M\u00e3 gi\u1ea3m gi\u00e1 \u0111\u01b0\u1ee3c t\u1ea1o t\u1ef1 \u0111\u1ed9ng d\u00e0nh cho kh\u00e1ch h\u00e0ng v\u1edbi th\u1eddi h\u1ea1n c\u1ee5 th\u1ec3, nh\u1eb1m khuy\u1ebfn kh\u00edch kh\u00e1ch h\u00e0ng quay l\u1ea1i mua h\u00e0ng.<\/li>\n<li>Thi\u1ebft k\u1ebf email chuy\u00ean nghi\u1ec7p: Email ch\u1ee9a th\u00f4ng tin s\u1ea3n ph\u1ea9m, li\u00ean k\u1ebft Google Drive, m\u00e3 QR, v\u00e0 c\u00e1c li\u00ean k\u1ebft t\u1edbi trang ch\u00ednh s\u00e1ch c\u1ee7a trang web \u0111\u1ec3 kh\u00e1ch h\u00e0ng c\u00f3 th\u1ec3 t\u00ecm hi\u1ec3u th\u00eam.<\/li>\n<\/ul>\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-hl-loaded cbp-ff-loaded\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\">\n<pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><\/pre>\n<pre class=\"shiki nord\" tabindex=\"0\"><code><span class=\"line\">add_action('woocommerce_order_status_completed', 'send_drive_links_on_order_complete', 10, 1);<\/span>\n\n<span class=\"line\">function send_drive_links_on_order_complete($order_id) {<\/span>\n<span class=\"line\">    \/\/ Code th\u1ef1c hi\u1ec7n g\u1eedi email v\u1edbi th\u00f4ng tin s\u1ea3n ph\u1ea9m v\u00e0 m\u00e3 gi\u1ea3m gi\u00e1, \u0111\u01b0\u1ee3c \u0111\u1ecbnh d\u1ea1ng chi ti\u1ebft \u1edf ph\u1ea7n tr\u00ean<\/span>\n<span class=\"line\">}<\/span><\/code><\/pre>\n<\/div>\n<h3 class=\"wp-block-heading\">5. Hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng tr\u00ean trang \u201cT\u00e0i kho\u1ea3n c\u1ee7a t\u00f4i\u201d<\/h3>\n<p>H\u00e0m\u00a0<code>display_custom_drive_links_in_downloads()<\/code>\u00a0hi\u1ec3n th\u1ecb c\u00e1c li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 QR cho t\u1eebng s\u1ea3n ph\u1ea9m \u0111\u00e3 mua tr\u00ean trang T\u00e0i kho\u1ea3n c\u1ee7a t\u00f4i &gt; T\u1ea3i xu\u1ed1ng. \u0110i\u1ec1u n\u00e0y gi\u00fap kh\u00e1ch h\u00e0ng d\u1ec5 d\u00e0ng truy c\u1eadp c\u00e1c file \u0111\u00e3 mua v\u00e0 t\u1ea3i xu\u1ed1ng b\u1ea5t c\u1ee9 khi n\u00e0o h\u1ecd mu\u1ed1n.<\/p>\n<ul class=\"wp-block-list\">\n<li>CSS t\u1ed1i \u01b0u h\u00f3a giao di\u1ec7n: CSS \u0111\u01b0\u1ee3c th\u00eam v\u00e0o \u0111\u1ec3 t\u1ea1o m\u1ed9t b\u1ea3ng t\u1ea3i xu\u1ed1ng \u0111\u1eb9p m\u1eaft, d\u1ec5 s\u1eed d\u1ee5ng v\u1edbi c\u00e1c n\u00fat t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 QR cho t\u1eebng s\u1ea3n ph\u1ea9m.<\/li>\n<li>T\u1ed1i \u01b0u h\u00f3a tr\u1ea3i nghi\u1ec7m ng\u01b0\u1eddi d\u00f9ng: M\u00e3 QR gi\u00fap kh\u00e1ch h\u00e0ng t\u1ea3i xu\u1ed1ng nhanh ch\u00f3ng t\u1eeb thi\u1ebft b\u1ecb di \u0111\u1ed9ng.<\/li>\n<\/ul>\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-hl-loaded cbp-ff-loaded\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\">\n<pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><\/pre>\n<pre class=\"shiki nord\" tabindex=\"0\"><code><span class=\"line\">add_action('woocommerce_account_downloads_endpoint', 'display_custom_drive_links_in_downloads');<\/span>\n\n<span class=\"line\">function display_custom_drive_links_in_downloads() {<\/span>\n<span class=\"line\">    \/\/ Code hi\u1ec3n th\u1ecb danh s\u00e1ch s\u1ea3n ph\u1ea9m v\u1edbi c\u00e1c li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 QR<\/span>\n<span class=\"line\">}<\/span><\/code><\/pre>\n<\/div>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-1338\" src=\"http:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/08\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh.jpg\" sizes=\"(max-width: 1024px) 100vw, 1024px\" srcset=\"http:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/08\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh.jpg 1024w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-300x158.jpg 300w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-768x404.jpg 768w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-1536x808.jpg 1536w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce.jpg 1697w\" alt=\"\" width=\"1024\" height=\"539\" \/><\/figure>\n<h3 class=\"wp-block-heading\">6. Hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng tr\u00ean trang C\u1ea3m \u01a1n sau khi thanh to\u00e1n th\u00e0nh c\u00f4ng<\/h3>\n<p>H\u00e0m\u00a0<code>display_drive_links_on_thank_you_page()<\/code>\u00a0s\u1ebd ki\u1ec3m tra tr\u1ea1ng th\u00e1i \u0111\u01a1n h\u00e0ng v\u00e0 hi\u1ec3n th\u1ecb c\u00e1c li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng tr\u00ean trang c\u1ea3m \u01a1n sau khi thanh to\u00e1n th\u00e0nh c\u00f4ng.<\/p>\n<ul class=\"wp-block-list\">\n<li>Th\u00f4ng b\u00e1o tr\u1ea1ng th\u00e1i \u0111\u01a1n h\u00e0ng: N\u1ebfu \u0111\u01a1n h\u00e0ng ch\u01b0a \u0111\u01b0\u1ee3c ho\u00e0n t\u1ea5t, kh\u00e1ch h\u00e0ng s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c th\u00f4ng b\u00e1o y\u00eau c\u1ea7u thanh to\u00e1n \u0111\u1ec3 t\u1ea3i xu\u1ed1ng.<\/li>\n<li>B\u1ea3ng t\u1ea3i xu\u1ed1ng chi ti\u1ebft: B\u1ea3ng hi\u1ec3n th\u1ecb s\u1ea3n ph\u1ea9m, li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng, m\u00e3 QR, v\u00e0 \u1ea3nh s\u1ea3n ph\u1ea9m gi\u00fap kh\u00e1ch h\u00e0ng t\u1ea3i xu\u1ed1ng m\u1ed9t c\u00e1ch ti\u1ec7n l\u1ee3i.<\/li>\n<\/ul>\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-hl-loaded cbp-ff-loaded\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\">\n<pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><\/pre>\n<pre class=\"shiki nord\" tabindex=\"0\"><code><span class=\"line\">add_action('woocommerce_thankyou', 'display_drive_links_on_thank_you_page', 10, 1);<\/span>\n\n<span class=\"line\">function display_drive_links_on_thank_you_page($order_id) {<\/span>\n<span class=\"line\">    \/\/ Code ki\u1ec3m tra v\u00e0 hi\u1ec3n th\u1ecb c\u00e1c li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng<\/span>\n<span class=\"line\">}<\/span><\/code><\/pre>\n<\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" class=\"wp-image-1339\" src=\"http:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/08\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh-1.jpg\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" srcset=\"http:\/\/cuongnguyen.bat.io.vn\/wp-content\/uploads\/2025\/08\/huong-dan-share-file-google-drive-tren-woocommerce-khi-thanh-toan-hoan-thanh-1.jpg 822w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-2-300x211.jpg 300w, https:\/\/hnitmedia.com\/wp-content\/uploads\/2025\/07\/tu-dong-chia-se-file-google-drive-woocommerce-2-768x539.jpg 768w\" alt=\"\" width=\"822\" height=\"577\" \/><\/figure>\n<h2 class=\"wp-block-heading\">K\u1ebft Lu\u1eadn<\/h2>\n<p>T\u1ef1 \u0111\u1ed9ng chia s\u1ebb file Google Drive v\u1edbi kh\u00e1ch h\u00e0ng sau khi thanh to\u00e1n qua WooCommerce l\u00e0 m\u1ed9t gi\u1ea3i ph\u00e1p hi\u1ec7u qu\u1ea3 \u0111\u1ec3 ti\u1ebft ki\u1ec7m th\u1eddi gian, t\u0103ng tr\u1ea3i nghi\u1ec7m ng\u01b0\u1eddi d\u00f9ng v\u00e0 gi\u1ea3m thi\u1ec3u sai s\u00f3t. V\u1edbi c\u00e1c b\u01b0\u1edbc h\u01b0\u1edbng d\u1eabn chi ti\u1ebft tr\u00ean, b\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng c\u00e0i \u0111\u1eb7t v\u00e0 t\u00edch h\u1ee3p quy tr\u00ecnh n\u00e0y v\u00e0o h\u1ec7 th\u1ed1ng b\u00e1n h\u00e0ng c\u1ee7a m\u00ecnh.<\/p>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Khuy\u1ebfn ngh\u1ecb<\/strong>: H\u00e3y ki\u1ec3m tra l\u1ea1i to\u00e0n b\u1ed9 quy tr\u00ecnh tr\u01b0\u1edbc khi tri\u1ec3n khai \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o r\u1eb1ng m\u1ecdi th\u1ee9 ho\u1ea1t \u0111\u1ed9ng \u1ed5n \u0111\u1ecbnh, t\u1eeb qu\u00e1 tr\u00ecnh thanh to\u00e1n \u0111\u1ebfn vi\u1ec7c chia s\u1ebb file Google Drive t\u1ef1 \u0111\u1ed9ng. \u0110i\u1ec1u n\u00e0y gi\u00fap b\u1ea1n cung c\u1ea5p d\u1ecbch v\u1ee5 chuy\u00ean nghi\u1ec7p v\u00e0 \u0111\u00e1p \u1ee9ng t\u1ed1i \u0111a nhu c\u1ea7u c\u1ee7a kh\u00e1ch h\u00e0ng.<\/p><\/blockquote>\n<p>D\u01b0\u1edbi \u0111\u00e2y l\u00e0 code\u00a0<strong>t\u1ef1 \u0111\u1ed9ng chia s\u1ebb file Google Drive<\/strong>\u00a0ho\u00e0n ch\u1ec9nh \u0111\u1ec3 th\u1ef1c hi\u1ec7n ch\u1ee9c n\u0103ng tr\u00ean nh\u00e9, c\u00e1c b\u1ea1n ch\u1ec9 c\u1ea7n coppy t\u1ea5t c\u1ea3 b\u1ecf v\u00e0o funtion.php l\u00e0 c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n ch\u1ee9c n\u0103ng n\u00e0y r\u1ed3i, c\u1ef1c k\u1ef3 \u0111\u1eb9p v\u00e0 x\u1ecbn lu\u00f4n nh\u00e9.<\/p>\n<blockquote><p>\/\/ Th\u00eam CSS v\u00e0o ph\u1ea7n \u0111\u1ea7u c\u1ee7a trang \u0111\u1ec3 \u1ea9n l\u1edbp message-container<br \/>\nadd_action(&#8216;wp_head&#8217;, &#8216;custom_hide_message_container_css&#8217;);<\/p>\n<p>function custom_hide_message_container_css() {<br \/>\necho &#8220;&lt;style&gt;<\/p>\n<p>&lt;\/style&gt;&#8221;;<br \/>\n}<\/p>\n<p>\/\/ Th\u00eam tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh Google Drive Links trong trang s\u1ea3n ph\u1ea9m<br \/>\nadd_action(&#8216;woocommerce_product_options_general_product_data&#8217;, &#8216;add_drive_links_custom_field&#8217;);<\/p>\n<p>function add_drive_links_custom_field() {<br \/>\nwoocommerce_wp_textarea_input(array(<br \/>\n&#8216;id&#8217; =&gt; &#8216;_drive_links&#8217;,<br \/>\n&#8216;label&#8217; =&gt; &#8216;Google Drive Links&#8217;,<br \/>\n&#8216;description&#8217; =&gt; &#8216;Nh\u1eadp c\u00e1c li\u00ean k\u1ebft Google Drive (m\u1ed7i li\u00ean k\u1ebft tr\u00ean m\u1ed9t d\u00f2ng)&#8217;,<br \/>\n&#8216;desc_tip&#8217; =&gt; &#8216;true&#8217;,<br \/>\n&#8216;placeholder&#8217; =&gt; &#8216;https:\/\/drive.google.com\/&#8230;&#8217;,<br \/>\n));<br \/>\n}<\/p>\n<p>\/\/ L\u01b0u tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh khi l\u01b0u s\u1ea3n ph\u1ea9m<br \/>\nadd_action(&#8216;woocommerce_process_product_meta&#8217;, &#8216;save_drive_links_custom_field&#8217;);<\/p>\n<p>function save_drive_links_custom_field($post_id) {<br \/>\n$drive_links = isset($_POST[&#8216;_drive_links&#8217;]) ? sanitize_textarea_field($_POST[&#8216;_drive_links&#8217;]) : &#8221;;<br \/>\nupdate_post_meta($post_id, &#8216;_drive_links&#8217;, $drive_links);<br \/>\n}<\/p>\n<p>\/\/ G\u1eedi email HTML cao c\u1ea5p v\u1edbi m\u00e3 gi\u1ea3m gi\u00e1, li\u00ean k\u1ebft qu\u1ea3n l\u00fd \u0111\u01a1n h\u00e0ng v\u00e0 th\u00f4ng tin ch\u00ednh s\u00e1ch sau khi \u0111\u01a1n h\u00e0ng ho\u00e0n t\u1ea5t<br \/>\nadd_action(&#8216;woocommerce_order_status_completed&#8217;, &#8216;send_drive_links_on_order_complete&#8217;, 10, 1);<\/p>\n<p>function send_drive_links_on_order_complete($order_id) {<br \/>\n$order = wc_get_order($order_id);<br \/>\n$has_drive_links = false;<\/p>\n<p>\/\/ Ki\u1ec3m tra xem c\u00f3 s\u1ea3n ph\u1ea9m n\u00e0o trong \u0111\u01a1n h\u00e0ng c\u00f3 li\u00ean k\u1ebft Google Drive kh\u00f4ng<br \/>\nforeach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<\/p>\n<p>if (!empty($drive_links)) {<br \/>\n$has_drive_links = true;<br \/>\nbreak;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ N\u1ebfu kh\u00f4ng c\u00f3 s\u1ea3n ph\u1ea9m n\u00e0o c\u00f3 li\u00ean k\u1ebft Drive, tho\u00e1t kh\u1ecfi h\u00e0m<br \/>\nif (!$has_drive_links) {<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ D\u1eef li\u1ec7u email v\u00e0 m\u00e3 gi\u1ea3m gi\u00e1<br \/>\n$email = $order-&gt;get_billing_email();<br \/>\n$username = $order-&gt;get_billing_first_name() . &#8216; &#8216; . $order-&gt;get_billing_last_name();<br \/>\n$site_name = get_bloginfo(&#8216;name&#8217;);<br \/>\n$site_url = site_url();<br \/>\n$logo_url = &#8216;https:\/\/muathemewpgiare.com\/wp-content\/uploads\/2024\/09\/logo-muathemewp-gia-re-com-chotheme-1.png&#8217;;<br \/>\n$social_links = array(<br \/>\n&#8216;facebook&#8217; =&gt; &#8216;https:\/\/www.facebook.com\/profile.php?id=100069151343004&#8217;,<br \/>\n);<\/p>\n<p>\/\/ T\u1ea1o m\u00e3 gi\u1ea3m gi\u00e1 ri\u00eang cho kh\u00e1ch h\u00e0ng sau khi mua h\u00e0ng<br \/>\n$coupon_code = &#8216;VIPCUSTOMER_&#8217; . $order_id;<br \/>\n$discount_amount = 20;<br \/>\n$expiry_date = date(&#8216;Y-m-d&#8217;, strtotime(&#8216;+30 days&#8217;));<br \/>\n$coupon = array(<br \/>\n&#8216;post_title&#8217; =&gt; $coupon_code,<br \/>\n&#8216;post_content&#8217; =&gt; &#8216;M\u00e3 gi\u1ea3m gi\u00e1 ch\u1ec9 d\u00e0nh cho kh\u00e1ch h\u00e0ng \u0111\u00e3 mua h\u00e0ng.&#8217;,<br \/>\n&#8216;post_status&#8217; =&gt; &#8216;publish&#8217;,<br \/>\n&#8216;post_author&#8217; =&gt; 1,<br \/>\n&#8216;post_type&#8217; =&gt; &#8216;shop_coupon&#8217;<br \/>\n);<br \/>\n$new_coupon_id = wp_insert_post($coupon);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;discount_type&#8217;, &#8216;percent&#8217;);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;coupon_amount&#8217;, $discount_amount);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;individual_use&#8217;, &#8216;yes&#8217;);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;usage_limit&#8217;, 1);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;date_expires&#8217;, strtotime($expiry_date));<br \/>\nupdate_post_meta($new_coupon_id, &#8216;customer_email&#8217;, $email);<\/p>\n<p>\/\/ Kh\u1edfi t\u1ea1o n\u1ed9i dung email v\u1edbi thi\u1ebft k\u1ebf chuy\u00ean nghi\u1ec7p<br \/>\n$subject = &#8220;\ud83c\udf89 C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 mua h\u00e0ng t\u1ea1i {$site_name}! \ud83c\udf89&#8221;;<br \/>\n$order_qr_code = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150&#215;150&amp;data=&#8221; . urlencode($order-&gt;get_view_order_url());<br \/>\n$message = &#8221;<br \/>\n&lt;html&gt;<br \/>\n&lt;body style=&#8217;font-family: Arial, sans-serif; color: #333; background-color: #f4f4f4; padding: 20px;&#8217;&gt;<br \/>\n&lt;div style=&#8217;max-width: 650px; margin: auto; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);&#8217;&gt;<\/p>\n<p>&lt;!&#8211; Header &#8211;&gt;<br \/>\n&lt;div style=&#8217;background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); color: #ffffff; padding: 20px; text-align: center;&#8217;&gt;<br \/>\n&lt;a href='{$site_url}&#8217;&gt;&lt;img src='{$logo_url}&#8217; alt='{$site_name} Logo&#8217; style=&#8217;max-width: 150px;&#8217;&gt;&lt;\/a&gt;<br \/>\n&lt;h1 style=&#8217;margin: 0; font-size: 24px;&#8217;&gt;\ud83c\udf8a C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 mua h\u00e0ng! \ud83c\udf8a&lt;\/h1&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; Th\u00f4ng tin kh\u00e1ch h\u00e0ng &#8211;&gt;<br \/>\n&lt;div style=&#8217;padding: 20px;&#8217;&gt;<br \/>\n&lt;p style=&#8217;font-size: 16px;&#8217;&gt;Xin ch\u00e0o &lt;strong&gt;{$username}&lt;\/strong&gt;,&lt;\/p&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i r\u1ea5t vui khi \u0111\u01b0\u1ee3c ph\u1ee5c v\u1ee5 b\u1ea1n t\u1ea1i &lt;strong&gt;{$site_name}&lt;\/strong&gt;. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00e1c th\u00f4ng tin v\u1ec1 \u0111\u01a1n h\u00e0ng c\u1ee7a b\u1ea1n:&lt;\/p&gt;<\/p>\n<p>&lt;!&#8211; Th\u00f4ng tin \u0111\u01a1n h\u00e0ng &#8211;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Th\u00f4ng tin \u0111\u01a1n h\u00e0ng&lt;\/h3&gt;<br \/>\n&lt;p&gt;&lt;strong&gt;M\u00e3 \u0111\u01a1n h\u00e0ng:&lt;\/strong&gt; #{$order-&gt;get_order_number()}&lt;br&gt;<br \/>\n&lt;strong&gt;Ng\u00e0y mua:&lt;\/strong&gt; {$order-&gt;get_date_created()-&gt;format(&#8216;d\/m\/Y&#8217;)}&lt;br&gt;<br \/>\n&lt;strong&gt;T\u1ed5ng c\u1ed9ng:&lt;\/strong&gt; &#8221; . wc_price($order-&gt;get_total()) . &#8220;&lt;\/p&gt;<br \/>\n&lt;p&gt;&lt;img src='{$order_qr_code}&#8217; alt=&#8217;QR Code Order&#8217; style=&#8217;width: 100px; height: 100px; border: 1px solid #ddd; margin-top: 10px;&#8217;\/&gt;&lt;\/p&gt;<\/p>\n<p>&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;S\u1ea3n ph\u1ea9m \u0111\u00e3 mua&lt;\/h3&gt;<br \/>\n&lt;table style=&#8217;width: 100%; border-collapse: collapse; margin-top: 20px;&#8217;&gt;<br \/>\n&lt;thead&gt;<br \/>\n&lt;tr style=&#8217;background-color: #1e3c72; color: #ffffff;&#8217;&gt;<br \/>\n&lt;th style=&#8217;padding: 10px; border: 1px solid #ddd;&#8217;&gt;S\u1ea3n ph\u1ea9m&lt;\/th&gt;<br \/>\n&lt;th style=&#8217;padding: 10px; border: 1px solid #ddd;&#8217;&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng&lt;\/th&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/thead&gt;<br \/>\n&lt;tbody&gt;&#8221;;<\/p>\n<p>foreach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$product = wc_get_product($product_id);<br \/>\n$product_name = $product-&gt;get_name();<br \/>\n$product_url = get_permalink($product_id);<br \/>\n$product_image_url = wp_get_attachment_url($product-&gt;get_image_id());<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<\/p>\n<p>if (!empty($drive_links)) {<br \/>\n$message .= &#8221;<br \/>\n&lt;tr style=&#8217;background-color: #f9f9f9;&#8217;&gt;<br \/>\n&lt;td style=&#8217;padding: 10px; border: 1px solid #ddd;&#8217;&gt;<br \/>\n&lt;a href='{$product_url}&#8217; style=&#8217;text-decoration: none; color: #1e3c72; font-weight: bold;&#8217;&gt;<br \/>\n&lt;img src='{$product_image_url}&#8217; alt='{$product_name}&#8217; style=&#8217;width: 60px; border-radius: 5px; vertical-align: middle; margin-right: 10px;&#8217; \/&gt;<br \/>\n{$product_name}<br \/>\n&lt;\/a&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td style=&#8217;padding: 10px; border: 1px solid #ddd; text-align: center;&#8217;&gt;&#8221;;<\/p>\n<p>$links = explode(&#8220;\\n&#8221;, $drive_links);<br \/>\nforeach ($links as $link) {<br \/>\n$qr_code_url = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150&#215;150&amp;data=&#8221; . urlencode(trim($link));<br \/>\n$message .= &#8221;<br \/>\n&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217; style=&#8217;display: inline-block; background-color: #1e3c72; color: #fff; padding: 8px 12px; border-radius: 5px;&#8217;&gt;T\u1ea3i xu\u1ed1ng&lt;\/a&gt;&lt;br&gt;<br \/>\n&lt;img src='{$qr_code_url}&#8217; alt=&#8217;QR Code&#8217; style=&#8217;width: 80px; margin-top: 10px;&#8217; \/&gt;&lt;br&gt;&#8221;;<br \/>\n}<br \/>\n$message .= &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n}<br \/>\n}<\/p>\n<p>$message .= &#8221;<br \/>\n&lt;\/tbody&gt;<br \/>\n&lt;\/table&gt;<\/p>\n<p>&lt;!&#8211; M\u00e3 gi\u1ea3m gi\u00e1 &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;M\u00e3 gi\u1ea3m gi\u00e1 \u0111\u1eb7c bi\u1ec7t cho l\u1ea7n mua ti\u1ebfp theo!&lt;\/h3&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i t\u1eb7ng b\u1ea1n m\u00e3 gi\u1ea3m gi\u00e1 &lt;strong&gt;{$coupon_code}&lt;\/strong&gt; \u0111\u1ec3 s\u1eed d\u1ee5ng cho l\u1ea7n mua ti\u1ebfp theo (gi\u1ea3m 20%). M\u00e3 n\u00e0y c\u00f3 gi\u00e1 tr\u1ecb \u0111\u1ebfn ng\u00e0y &#8221; . date(&#8216;d\/m\/Y&#8217;, strtotime($expiry_date)) . &#8220;.&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;!&#8211; Ch\u00ednh s\u00e1ch v\u00e0 h\u01b0\u1edbng d\u1eabn &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Ch\u00ednh s\u00e1ch v\u00e0 h\u01b0\u1edbng d\u1eabn&lt;\/h3&gt;<br \/>\n&lt;p&gt;<br \/>\n&lt;a href='{$site_url}\/chinh-sach-hoan-tra-don-hang\/&#8217; style=&#8217;color: #1e3c72; text-decoration: none;&#8217;&gt;Ch\u00ednh s\u00e1ch ho\u00e0n ti\u1ec1n&lt;\/a&gt; |<br \/>\n&lt;a href='{$site_url}\/cac-cau-hoi-thuong-gap\/&#8217; style=&#8217;color: #1e3c72; text-decoration: none;&#8217;&gt;C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p&lt;\/a&gt; |<br \/>\n&lt;a href='{$site_url}\/gui-yeu-cau-ho-tro-ho-tro\/&#8217; style=&#8217;color: #1e3c72; text-decoration: none;&#8217;&gt;G\u1eedi y\u00eau c\u1ea7u h\u1ed7 tr\u1ee3&lt;\/a&gt;<br \/>\n&lt;\/p&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i khuy\u1ebfn kh\u00edch b\u1ea1n \u0111\u1ecdc k\u1ef9 c\u00e1c ch\u00ednh s\u00e1ch \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o quy\u1ec1n l\u1ee3i v\u00e0 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 s\u1ea3n ph\u1ea9m c\u1ee7a m\u00ecnh.&lt;\/p&gt;<\/p>\n<p>&lt;!&#8211; H\u00ecnh \u1ea3nh thumbnail video h\u01b0\u1edbng d\u1eabn &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px; text-align: center;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Video h\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t&lt;\/h3&gt;<br \/>\n&lt;a href=&#8217;https:\/\/www.youtube.com\/watch?v=yU3IYeSiBx4&#8242; target=&#8217;_blank&#8217; style=&#8217;text-decoration: none;&#8217;&gt;<br \/>\n&lt;img src=&#8217;https:\/\/muathemewpgiare.com\/wp-content\/uploads\/2024\/10\/theme-wordpress-ban-hang-muathemewpgiare.jpg&#8217;<br \/>\nalt=&#8217;Video h\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t&#8217;<br \/>\nstyle=&#8217;max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&#8217;&gt;<br \/>\n&lt;\/a&gt;<br \/>\n&lt;p style=&#8217;margin-top: 10px; color: #777;&#8217;&gt;Nh\u1ea5n v\u00e0o h\u00ecnh \u0111\u1ec3 xem video h\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; M\u1eddi \u0111\u00e1nh gi\u00e1 s\u1ea3n ph\u1ea9m &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Chia s\u1ebb tr\u1ea3i nghi\u1ec7m c\u1ee7a b\u1ea1n&lt;\/h3&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i r\u1ea5t mong nh\u1eadn \u0111\u01b0\u1ee3c ph\u1ea3n h\u1ed3i t\u1eeb b\u1ea1n. H\u00e3y \u0111\u1ec3 l\u1ea1i \u0111\u00e1nh gi\u00e1 cho s\u1ea3n ph\u1ea9m c\u1ee7a m\u00ecnh \u0111\u1ec3 gi\u00fap c\u00e1c kh\u00e1ch h\u00e0ng kh\u00e1c c\u00f3 l\u1ef1a ch\u1ecdn t\u1ed1t h\u01a1n!&lt;\/p&gt;<br \/>\n&lt;a href='{$site_url}\/reviews&#8217; target=&#8217;_blank&#8217; style=&#8217;display: inline-block; padding: 10px 20px; background-color: #1e3c72; color: #fff; border-radius: 5px; text-decoration: none; font-weight: bold;&#8217;&gt;\u0110\u00e1nh gi\u00e1 s\u1ea3n ph\u1ea9m&lt;\/a&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; Ch\u1ee9ng nh\u1eadn b\u1ea3n quy\u1ec1n &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px; text-align: center;&#8217;&gt;<br \/>\n&lt;p style=&#8217;font-size: 14px; color: #888;&#8217;&gt;\u00a9 &#8221; . date(&#8220;Y&#8221;) . &#8221; {$site_name}. B\u1ea1n \u0111ang s\u1eed d\u1ee5ng s\u1ea3n ph\u1ea9m, d\u1ecbch v\u1ee5 t\u1ea1i ch\u00fang t\u00f4i. VUi l\u00f2ng s\u1eed d\u1ee5ng \u0111\u00fang m\u1ee5c \u0111\u00edch, kh\u00f4ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng n\u00f3 v\u00e0o m\u1ee5c \u0111\u00edch tr\u00e1i ph\u00e1p lu\u1eadt, n\u1ebfu kh\u00f4ng b\u1ea1n s\u1ebd t\u1ef1 ch\u1ecbu ho\u00e0n to\u00e0n tr\u00e1ch nhi\u1ec7m, s\u1ebd b\u1ecb x\u1eed l\u00fd theo quy \u0111\u1ecbnh c\u1ee7a ph\u00e1p lu\u1eadt.&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; K\u1ebft n\u1ed1i m\u1ea1ng x\u00e3 h\u1ed9i&#8211;&gt;<br \/>\n&lt;div style=&#8217;text-align: center; margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h4&gt;Theo d\u00f5i ch\u00fang t\u00f4i tr\u00ean m\u1ea1ng x\u00e3 h\u1ed9i&lt;\/h4&gt;&#8221;;<br \/>\nforeach ($social_links as $platform =&gt; $link) {<br \/>\n$icon_url = ($platform === &#8216;facebook&#8217;) ? &#8216;https:\/\/img.icons8.com\/color\/48\/000000\/facebook.png&#8217; : &#8221;;<br \/>\n$message .= &#8220;&lt;a href='{$link}&#8217; target=&#8217;_blank&#8217; style=&#8217;margin: 0 5px;&#8217;&gt;<br \/>\n&lt;img src='{$icon_url}&#8217; alt='{$platform}&#8217; style=&#8217;width: 30px; height: 30px; border-radius: 50%;&#8217; \/&gt;<br \/>\n&lt;\/a&gt;&#8221;;<br \/>\n}<\/p>\n<p>$message .= &#8221;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;p style=&#8217;margin-top: 20px; text-align: center; color: #777;&#8217;&gt;\u00a9 &#8221; . date(&#8220;Y&#8221;) . &#8221; &lt;a href='{$site_url}&#8217; style=&#8217;color: #1e3c72;&#8217;&gt;{$site_name}&lt;\/a&gt;. All rights reserved.&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;&#8221;;<\/p>\n<p>\/\/ Header cho email HTML<br \/>\n$headers = array(&#8216;Content-Type: text\/html; charset=UTF-8&#8217;);<br \/>\nwp_mail($email, $subject, $message, $headers);<br \/>\n}<\/p>\n<p>\/\/ Hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u1edbi giao di\u1ec7n chuy\u00ean nghi\u1ec7p v\u00e0 m\u00e3 QR trong t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng<br \/>\nadd_action(&#8216;woocommerce_account_downloads_endpoint&#8217;, &#8216;display_custom_drive_links_in_downloads&#8217;);<\/p>\n<p>function display_custom_drive_links_in_downloads() {<br \/>\n$user_id = get_current_user_id();<br \/>\n$orders = wc_get_orders(array(<br \/>\n&#8216;customer&#8217; =&gt; $user_id,<br \/>\n&#8216;status&#8217; =&gt; &#8216;completed&#8217;,<br \/>\n&#8216;limit&#8217; =&gt; -1,<br \/>\n));<\/p>\n<p>\/\/ Th\u00eam CSS cho giao di\u1ec7n t\u1ea3i xu\u1ed1ng cao c\u1ea5p<br \/>\necho &#8220;&lt;style&gt;<br \/>\n.download-section {<br \/>\nmargin-top: 30px;<br \/>\npadding: 30px;<br \/>\nborder-radius: 15px;<br \/>\nbackground-color: #ffffff;<br \/>\nbox-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);<br \/>\nfont-family: &#8216;Arial&#8217;, sans-serif;<br \/>\ncolor: #333;<br \/>\n}<br \/>\n.download-section h2 {<br \/>\nfont-size: 2em;<br \/>\ncolor: #333;<br \/>\ntext-align: center;<br \/>\nmargin-bottom: 25px;<br \/>\nfont-weight: 600;<br \/>\n}<br \/>\n.download-table {<br \/>\nwidth: 100%;<br \/>\nborder-collapse: collapse;<br \/>\nmargin-top: 20px;<br \/>\nborder-radius: 15px;<br \/>\noverflow: hidden;<br \/>\n}<br \/>\n.download-table th {<br \/>\nfont-size: 1em;<br \/>\ntext-align: center;<br \/>\ncolor: #ffffff;<br \/>\npadding: 15px;<br \/>\nbackground: linear-gradient(45deg, #ff7e5f, #feb47b);<br \/>\nfont-weight: bold;<br \/>\n}<br \/>\n.download-table td {<br \/>\npadding: 20px;<br \/>\nfont-size: 1em;<br \/>\ntext-align: center;<br \/>\nbackground-color: #f8f9fa;<br \/>\nborder-bottom: 1px solid #eee;<br \/>\nborder-radius: 10px;<br \/>\nposition: relative;<br \/>\n}<br \/>\n.thumbnail-img {<br \/>\nwidth: 90px;<br \/>\nheight: 90px;<br \/>\nborder-radius: 10px;<br \/>\nbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);<br \/>\n}<br \/>\n.product-name a {<br \/>\ncolor: #333;<br \/>\nfont-weight: 600;<br \/>\nfont-size: 1.1em;<br \/>\ntext-decoration: none;<br \/>\ntransition: color 0.3s;<br \/>\n}<br \/>\n.product-name a:hover {<br \/>\ncolor: #ff7e5f;<br \/>\n}<br \/>\n.download-link {<br \/>\ndisplay: inline-block;<br \/>\nbackground-color: #ff7e5f;<br \/>\ncolor: #ffffff;<br \/>\npadding: 10px 25px;<br \/>\nmargin: 5px 0;<br \/>\nborder-radius: 25px;<br \/>\nfont-weight: bold;<br \/>\ntext-decoration: none;<br \/>\nbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);<br \/>\ntransition: background-color 0.3s, transform 0.3s;<br \/>\n}<br \/>\n.download-link:hover {<br \/>\nbackground-color: #e06752;<br \/>\ntransform: translateY(-2px);<br \/>\n}<br \/>\n.qr-code-container {<br \/>\ndisplay: flex;<br \/>\nflex-direction: column;<br \/>\nalign-items: center;<br \/>\njustify-content: center;<br \/>\n}<br \/>\n.qr-code-container img {<br \/>\nwidth: 70px;<br \/>\nheight: 70px;<br \/>\nmargin-top: 10px;<br \/>\nborder-radius: 8px;<br \/>\ntransition: transform 0.3s ease;<br \/>\n}<br \/>\n.qr-code-container img:hover {<br \/>\ntransform: scale(1.05);<br \/>\n}<br \/>\n.no-downloads {<br \/>\nfont-size: 1.3em;<br \/>\ncolor: #777;<br \/>\nmargin-top: 30px;<br \/>\ntext-align: center;<br \/>\n}<br \/>\n&lt;\/style&gt;&#8221;;<\/p>\n<p>\/\/ Ki\u1ec3m tra v\u00e0 hi\u1ec3n th\u1ecb c\u00e1c \u0111\u01a1n h\u00e0ng c\u00f3 s\u1ea3n ph\u1ea9m t\u1ea3i xu\u1ed1ng<br \/>\nif (!empty($orders)) {<br \/>\necho &#8220;&lt;div class=&#8217;download-section&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;h2&gt;\ud83d\udce5 T\u1ea3i xu\u1ed1ng s\u1ea3n ph\u1ea9m c\u1ee7a b\u1ea1n \ud83d\udce5&lt;\/h2&gt;&#8221;;<br \/>\necho &#8220;&lt;table class=&#8217;download-table&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;H\u00ecnh \u1ea3nh&lt;\/th&gt;&lt;th&gt;S\u1ea3n ph\u1ea9m&lt;\/th&gt;&lt;th&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;th&gt;M\u00e3 QR t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;\/tr&gt;&lt;\/thead&gt;&lt;tbody&gt;&#8221;;<\/p>\n<p>foreach ($orders as $order) {<br \/>\nforeach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$product = wc_get_product($product_id);<br \/>\n$product_name = $item-&gt;get_name();<br \/>\n$product_url = get_permalink($product_id);<br \/>\n$thumbnail_url = wp_get_attachment_image_url($product-&gt;get_image_id(), &#8216;thumbnail&#8217;);<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<\/p>\n<p>if (!empty($drive_links)) {<br \/>\necho &#8220;&lt;tr&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&lt;img src='&#8221; . esc_url($thumbnail_url) . &#8220;&#8216; alt=&#8217;Thumbnail&#8217; class=&#8217;thumbnail-img&#8217; \/&gt;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td class=&#8217;product-name&#8217;&gt;&lt;a href='&#8221; . esc_url($product_url) . &#8220;&#8216;&gt;{$product_name}&lt;\/a&gt;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&#8221;;<\/p>\n<p>$links = explode(&#8220;\\n&#8221;, $drive_links);<br \/>\nforeach ($links as $link) {<br \/>\necho &#8220;&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217; class=&#8217;download-link&#8217;&gt;T\u1ea3i xu\u1ed1ng&lt;\/a&gt;&lt;br&gt;&#8221;;<br \/>\n}<\/p>\n<p>echo &#8220;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td class=&#8217;qr-code-container&#8217;&gt;&#8221;;<\/p>\n<p>foreach ($links as $link) {<br \/>\n$qr_code_url = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150&#215;150&amp;data=&#8221; . urlencode(trim($link));<br \/>\necho &#8220;&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217;&gt;<br \/>\n&lt;img src='{$qr_code_url}&#8217; alt=&#8217;QR Code Download&#8217; \/&gt;<br \/>\n&lt;\/a&gt;&lt;br&gt;&#8221;;<br \/>\n}<\/p>\n<p>echo &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\necho &#8220;&lt;\/tbody&gt;&lt;\/table&gt;&#8221;;<br \/>\necho &#8220;&lt;\/div&gt;&#8221;;<br \/>\n} else {<br \/>\necho &#8220;&lt;p class=&#8217;no-downloads&#8217;&gt;B\u1ea1n ch\u01b0a c\u00f3 s\u1ea3n ph\u1ea9m n\u00e0o \u0111\u1ec3 t\u1ea3i xu\u1ed1ng.&lt;\/p&gt;&#8221;;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ Hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng trong trang c\u1ea3m \u01a1n sau khi thanh to\u00e1n n\u1ebfu \u0111\u01a1n h\u00e0ng \u0111\u00e3 ho\u00e0n t\u1ea5t ho\u1eb7c \u0111ang x\u1eed l\u00fd<br \/>\nadd_action(&#8216;woocommerce_thankyou&#8217;, &#8216;display_drive_links_on_thank_you_page&#8217;, 10, 1);<\/p>\n<p>function display_drive_links_on_thank_you_page($order_id) {<br \/>\nif (!$order_id) return;<br \/>\n$order = wc_get_order($order_id);<\/p>\n<p>\/\/ Th\u00eam CSS \u0111\u1ec3 c\u1ea3i thi\u1ec7n tr\u1ea3i nghi\u1ec7m giao di\u1ec7n<br \/>\necho &#8220;&lt;style&gt;<br \/>\n.download-container {<br \/>\ntext-align: center;<br \/>\nmargin-top: 20px;<br \/>\npadding: 20px;<br \/>\nborder: 1px solid #ddd;<br \/>\nborder-radius: 10px;<br \/>\nbackground-color: #fafafa;<br \/>\nbox-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);<br \/>\n}<br \/>\n.download-table {<br \/>\nwidth: 100%;<br \/>\nborder-collapse: collapse;<br \/>\nmargin-top: 20px;<br \/>\n}<br \/>\n.download-table th {<br \/>\nbackground-color: #4CAF50;<br \/>\ncolor: white;<br \/>\npadding: 15px;<br \/>\nfont-size: 16px;<br \/>\ntext-align: left;<br \/>\n}<br \/>\n.download-table td {<br \/>\npadding: 12px;<br \/>\ntext-align: center;<br \/>\nborder-bottom: 1px solid #ddd;<br \/>\n}<br \/>\n.download-table .thumbnail-img {<br \/>\nwidth: 70px;<br \/>\nheight: 70px;<br \/>\nobject-fit: contain;<br \/>\nbackground-color: #f0f0f0;<br \/>\nborder-radius: 5px;<br \/>\n}<br \/>\n.download-link, .review-link {<br \/>\ndisplay: inline-block;<br \/>\nbackground-color: #0073aa;<br \/>\ncolor: white;<br \/>\npadding: 8px 15px;<br \/>\nmargin: 5px 0;<br \/>\nborder-radius: 5px;<br \/>\ntext-decoration: none;<br \/>\nfont-weight: bold;<br \/>\ntransition: background-color 0.3s;<br \/>\n}<br \/>\n.download-link:hover, .review-link:hover {<br \/>\nbackground-color: #005082;<br \/>\n}<br \/>\n.qr-code {<br \/>\nwidth: 70px;<br \/>\nheight: 70px;<br \/>\nmargin-top: 10px;<br \/>\n}<br \/>\n.download-notice {<br \/>\nbackground-color: #f8d7da;<br \/>\ncolor: #721c24;<br \/>\npadding: 15px;<br \/>\nborder: 1px solid #f5c6cb;<br \/>\nborder-radius: 5px;<br \/>\nmargin: 20px 0;<br \/>\nfont-size: 16px;<br \/>\n}<br \/>\n.product-instructions {<br \/>\nfont-size: 14px;<br \/>\ncolor: #555;<br \/>\nmargin-top: 10px;<br \/>\nfont-style: italic;<br \/>\n}<br \/>\n&lt;\/style&gt;&#8221;;<\/p>\n<p>\/\/ Ki\u1ec3m tra tr\u1ea1ng th\u00e1i \u0111\u01a1n h\u00e0ng v\u00e0 th\u00f4ng b\u00e1o n\u1ebfu ch\u01b0a ho\u00e0n t\u1ea5t<br \/>\nif ($order-&gt;get_status() != &#8216;completed&#8217; &amp;&amp; $order-&gt;get_status() != &#8216;processing&#8217;) {<br \/>\necho &#8220;&lt;div class=&#8217;download-notice&#8217;&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng s\u1ebd kh\u1ea3 d\u1ee5ng sau khi thanh to\u00e1n ho\u00e0n t\u1ea5t. H\u00e3y thanh to\u00e1n \u0111\u1ec3 c\u00f3 th\u1ec3 t\u1ea3i xu\u1ed1ng.&lt;\/div&gt;&#8221;;<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ Th\u00f4ng b\u00e1o v\u00e0 h\u01b0\u1edbng d\u1eabn<br \/>\necho &#8220;&lt;div class=&#8217;download-container&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;h2&gt;\ud83c\udf89 C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 mua h\u00e0ng! \ud83c\udf89&lt;\/h2&gt;&#8221;;<br \/>\necho &#8220;&lt;p class=&#8217;product-instructions&#8217;&gt;B\u1ea1n c\u00f3 th\u1ec3 t\u1ea3i xu\u1ed1ng c\u00e1c s\u1ea3n ph\u1ea9m c\u1ee7a m\u00ecnh qua c\u00e1c li\u00ean k\u1ebft v\u00e0 m\u00e3 QR d\u01b0\u1edbi \u0111\u00e2y.&lt;\/p&gt;&#8221;;<\/p>\n<p>\/\/ T\u1ea1o b\u1ea3ng hi\u1ec3n th\u1ecb s\u1ea3n ph\u1ea9m, li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 QR<br \/>\necho &#8220;&lt;table class=&#8217;download-table&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;S\u1ea3n ph\u1ea9m&lt;\/th&gt;&lt;th&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;th&gt;M\u00e3 QR t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;\/tr&gt;&lt;\/thead&gt;&lt;tbody&gt;&#8221;;<\/p>\n<p>foreach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$product = wc_get_product($product_id);<br \/>\n$product_name = $item-&gt;get_name();<br \/>\n$product_url = get_permalink($product_id);<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<br \/>\n$thumbnail_url = wp_get_attachment_url($product-&gt;get_image_id());<\/p>\n<p>\/\/ Ki\u1ec3m tra v\u00e0 hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng<br \/>\nif (!empty($drive_links)) {<br \/>\necho &#8220;&lt;tr&gt;&#8221;;<br \/>\necho &#8220;&lt;td style=&#8217;text-align: left;&#8217;&gt;<br \/>\n&lt;img src='&#8221; . esc_url($thumbnail_url) . &#8220;&#8216; alt=&#8217;Thumbnail&#8217; class=&#8217;thumbnail-img&#8217; \/&gt;<br \/>\n&lt;a href='&#8221; . esc_url($product_url) . &#8220;&#8216; style=&#8217;text-decoration: none; color: #333; font-weight: bold;&#8217;&gt;{$product_name}&lt;\/a&gt;<br \/>\n&lt;p class=&#8217;product-instructions&#8217;&gt;Video h\u01b0\u1edbng d\u1eabn &amp; T\u00e0i li\u1ec7u \u0111i k\u00e8m \u0111\u01b0\u1ee3c g\u1eedi qua gmail c\u1ee7a b\u1ea1n&lt;\/p&gt;<br \/>\n&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&#8221;;<\/p>\n<p>$links = explode(&#8220;\\n&#8221;, $drive_links);<br \/>\nforeach ($links as $link) {<br \/>\necho &#8220;&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217; class=&#8217;download-link&#8217;&gt;<br \/>\n&lt;img src=&#8217;https:\/\/img.icons8.com\/material-rounded\/24\/ffffff\/download&#8211;v1.png&#8217; alt=&#8217;Download&#8217; class=&#8217;download-table-icon&#8217; \/&gt; T\u1ea3i xu\u1ed1ng<br \/>\n&lt;\/a&gt;&lt;br&gt;&#8221;;<br \/>\n}<br \/>\necho &#8220;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&#8221;;<\/p>\n<p>\/\/ T\u1ea1o m\u00e3 QR cho t\u1eebng li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng<br \/>\nforeach ($links as $link) {<br \/>\n$qr_code_url = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=70&#215;70&amp;data=&#8221; . urlencode(trim($link));<br \/>\necho &#8220;&lt;img src='{$qr_code_url}&#8217; alt=&#8217;QR Code Download&#8217; class=&#8217;qr-code&#8217; \/&gt;&lt;br&gt;&#8221;;<br \/>\n}<br \/>\necho &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n}<br \/>\n}<br \/>\necho &#8220;&lt;\/tbody&gt;&lt;\/table&gt;&#8221;;<\/p>\n<p>\/\/ Th\u00eam ph\u1ea7n khuy\u1ebfn kh\u00edch \u0111\u00e1nh gi\u00e1 v\u00e0 li\u00ean h\u1ec7 h\u1ed7 tr\u1ee3<br \/>\necho &#8220;&lt;a href='{$product_url}#reviews&#8217; class=&#8217;review-prompt&#8217;&gt;\u2b50 \u0110\u1ec3 l\u1ea1i \u0111\u00e1nh gi\u00e1 cho s\u1ea3n ph\u1ea9m c\u1ee7a b\u1ea1n \u2b50&lt;\/a&gt;&#8221;;<br \/>\necho &#8220;&lt;a href=&#8217;\/lien-he\/&#8217; class=&#8217;support-link&#8217;&gt;&lt;br&gt;B\u1ea1n c\u1ea7n h\u1ed7 tr\u1ee3? Li\u00ean h\u1ec7 ch\u00fang t\u00f4i t\u1ea1i \u0111\u00e2y&lt;\/a&gt;&#8221;;<\/p>\n<p>echo &#8220;&lt;\/div&gt;&#8221;;<br \/>\n}<br \/>\n\/\/ Th\u00eam CSS v\u00e0o ph\u1ea7n \u0111\u1ea7u c\u1ee7a trang \u0111\u1ec3 \u1ea9n l\u1edbp message-container<br \/>\nadd_action(&#8216;wp_head&#8217;, &#8216;custom_hide_message_container_css&#8217;);<\/p>\n<p>function custom_hide_message_container_css() {<br \/>\necho &#8220;&lt;style&gt;<\/p>\n<p>&lt;\/style&gt;&#8221;;<br \/>\n}<\/p>\n<p>\/\/ Th\u00eam tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh Google Drive Links trong trang s\u1ea3n ph\u1ea9m<br \/>\nadd_action(&#8216;woocommerce_product_options_general_product_data&#8217;, &#8216;add_drive_links_custom_field&#8217;);<\/p>\n<p>function add_drive_links_custom_field() {<br \/>\nwoocommerce_wp_textarea_input(array(<br \/>\n&#8216;id&#8217; =&gt; &#8216;_drive_links&#8217;,<br \/>\n&#8216;label&#8217; =&gt; &#8216;Google Drive Links&#8217;,<br \/>\n&#8216;description&#8217; =&gt; &#8216;Nh\u1eadp c\u00e1c li\u00ean k\u1ebft Google Drive (m\u1ed7i li\u00ean k\u1ebft tr\u00ean m\u1ed9t d\u00f2ng)&#8217;,<br \/>\n&#8216;desc_tip&#8217; =&gt; &#8216;true&#8217;,<br \/>\n&#8216;placeholder&#8217; =&gt; &#8216;https:\/\/drive.google.com\/&#8230;&#8217;,<br \/>\n));<br \/>\n}<\/p>\n<p>\/\/ L\u01b0u tr\u01b0\u1eddng t\u00f9y ch\u1ec9nh khi l\u01b0u s\u1ea3n ph\u1ea9m<br \/>\nadd_action(&#8216;woocommerce_process_product_meta&#8217;, &#8216;save_drive_links_custom_field&#8217;);<\/p>\n<p>function save_drive_links_custom_field($post_id) {<br \/>\n$drive_links = isset($_POST[&#8216;_drive_links&#8217;]) ? sanitize_textarea_field($_POST[&#8216;_drive_links&#8217;]) : &#8221;;<br \/>\nupdate_post_meta($post_id, &#8216;_drive_links&#8217;, $drive_links);<br \/>\n}<\/p>\n<p>\/\/ G\u1eedi email HTML cao c\u1ea5p v\u1edbi m\u00e3 gi\u1ea3m gi\u00e1, li\u00ean k\u1ebft qu\u1ea3n l\u00fd \u0111\u01a1n h\u00e0ng v\u00e0 th\u00f4ng tin ch\u00ednh s\u00e1ch sau khi \u0111\u01a1n h\u00e0ng ho\u00e0n t\u1ea5t<br \/>\nadd_action(&#8216;woocommerce_order_status_completed&#8217;, &#8216;send_drive_links_on_order_complete&#8217;, 10, 1);<\/p>\n<p>function send_drive_links_on_order_complete($order_id) {<br \/>\n$order = wc_get_order($order_id);<br \/>\n$has_drive_links = false;<\/p>\n<p>\/\/ Ki\u1ec3m tra xem c\u00f3 s\u1ea3n ph\u1ea9m n\u00e0o trong \u0111\u01a1n h\u00e0ng c\u00f3 li\u00ean k\u1ebft Google Drive kh\u00f4ng<br \/>\nforeach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<\/p>\n<p>if (!empty($drive_links)) {<br \/>\n$has_drive_links = true;<br \/>\nbreak;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ N\u1ebfu kh\u00f4ng c\u00f3 s\u1ea3n ph\u1ea9m n\u00e0o c\u00f3 li\u00ean k\u1ebft Drive, tho\u00e1t kh\u1ecfi h\u00e0m<br \/>\nif (!$has_drive_links) {<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ D\u1eef li\u1ec7u email v\u00e0 m\u00e3 gi\u1ea3m gi\u00e1<br \/>\n$email = $order-&gt;get_billing_email();<br \/>\n$username = $order-&gt;get_billing_first_name() . &#8216; &#8216; . $order-&gt;get_billing_last_name();<br \/>\n$site_name = get_bloginfo(&#8216;name&#8217;);<br \/>\n$site_url = site_url();<br \/>\n$logo_url = &#8216;https:\/\/muathemewpgiare.com\/wp-content\/uploads\/2024\/09\/logo-muathemewp-gia-re-com-chotheme-1.png&#8217;;<br \/>\n$social_links = array(<br \/>\n&#8216;facebook&#8217; =&gt; &#8216;https:\/\/www.facebook.com\/profile.php?id=100069151343004&#8217;,<br \/>\n);<\/p>\n<p>\/\/ T\u1ea1o m\u00e3 gi\u1ea3m gi\u00e1 ri\u00eang cho kh\u00e1ch h\u00e0ng sau khi mua h\u00e0ng<br \/>\n$coupon_code = &#8216;VIPCUSTOMER_&#8217; . $order_id;<br \/>\n$discount_amount = 20;<br \/>\n$expiry_date = date(&#8216;Y-m-d&#8217;, strtotime(&#8216;+30 days&#8217;));<br \/>\n$coupon = array(<br \/>\n&#8216;post_title&#8217; =&gt; $coupon_code,<br \/>\n&#8216;post_content&#8217; =&gt; &#8216;M\u00e3 gi\u1ea3m gi\u00e1 ch\u1ec9 d\u00e0nh cho kh\u00e1ch h\u00e0ng \u0111\u00e3 mua h\u00e0ng.&#8217;,<br \/>\n&#8216;post_status&#8217; =&gt; &#8216;publish&#8217;,<br \/>\n&#8216;post_author&#8217; =&gt; 1,<br \/>\n&#8216;post_type&#8217; =&gt; &#8216;shop_coupon&#8217;<br \/>\n);<br \/>\n$new_coupon_id = wp_insert_post($coupon);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;discount_type&#8217;, &#8216;percent&#8217;);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;coupon_amount&#8217;, $discount_amount);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;individual_use&#8217;, &#8216;yes&#8217;);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;usage_limit&#8217;, 1);<br \/>\nupdate_post_meta($new_coupon_id, &#8216;date_expires&#8217;, strtotime($expiry_date));<br \/>\nupdate_post_meta($new_coupon_id, &#8216;customer_email&#8217;, $email);<\/p>\n<p>\/\/ Kh\u1edfi t\u1ea1o n\u1ed9i dung email v\u1edbi thi\u1ebft k\u1ebf chuy\u00ean nghi\u1ec7p<br \/>\n$subject = &#8220;\ud83c\udf89 C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 mua h\u00e0ng t\u1ea1i {$site_name}! \ud83c\udf89&#8221;;<br \/>\n$order_qr_code = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150&#215;150&amp;data=&#8221; . urlencode($order-&gt;get_view_order_url());<br \/>\n$message = &#8221;<br \/>\n&lt;html&gt;<br \/>\n&lt;body style=&#8217;font-family: Arial, sans-serif; color: #333; background-color: #f4f4f4; padding: 20px;&#8217;&gt;<br \/>\n&lt;div style=&#8217;max-width: 650px; margin: auto; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);&#8217;&gt;<\/p>\n<p>&lt;!&#8211; Header &#8211;&gt;<br \/>\n&lt;div style=&#8217;background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); color: #ffffff; padding: 20px; text-align: center;&#8217;&gt;<br \/>\n&lt;a href='{$site_url}&#8217;&gt;&lt;img src='{$logo_url}&#8217; alt='{$site_name} Logo&#8217; style=&#8217;max-width: 150px;&#8217;&gt;&lt;\/a&gt;<br \/>\n&lt;h1 style=&#8217;margin: 0; font-size: 24px;&#8217;&gt;\ud83c\udf8a C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 mua h\u00e0ng! \ud83c\udf8a&lt;\/h1&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; Th\u00f4ng tin kh\u00e1ch h\u00e0ng &#8211;&gt;<br \/>\n&lt;div style=&#8217;padding: 20px;&#8217;&gt;<br \/>\n&lt;p style=&#8217;font-size: 16px;&#8217;&gt;Xin ch\u00e0o &lt;strong&gt;{$username}&lt;\/strong&gt;,&lt;\/p&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i r\u1ea5t vui khi \u0111\u01b0\u1ee3c ph\u1ee5c v\u1ee5 b\u1ea1n t\u1ea1i &lt;strong&gt;{$site_name}&lt;\/strong&gt;. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00e1c th\u00f4ng tin v\u1ec1 \u0111\u01a1n h\u00e0ng c\u1ee7a b\u1ea1n:&lt;\/p&gt;<\/p>\n<p>&lt;!&#8211; Th\u00f4ng tin \u0111\u01a1n h\u00e0ng &#8211;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Th\u00f4ng tin \u0111\u01a1n h\u00e0ng&lt;\/h3&gt;<br \/>\n&lt;p&gt;&lt;strong&gt;M\u00e3 \u0111\u01a1n h\u00e0ng:&lt;\/strong&gt; #{$order-&gt;get_order_number()}&lt;br&gt;<br \/>\n&lt;strong&gt;Ng\u00e0y mua:&lt;\/strong&gt; {$order-&gt;get_date_created()-&gt;format(&#8216;d\/m\/Y&#8217;)}&lt;br&gt;<br \/>\n&lt;strong&gt;T\u1ed5ng c\u1ed9ng:&lt;\/strong&gt; &#8221; . wc_price($order-&gt;get_total()) . &#8220;&lt;\/p&gt;<br \/>\n&lt;p&gt;&lt;img src='{$order_qr_code}&#8217; alt=&#8217;QR Code Order&#8217; style=&#8217;width: 100px; height: 100px; border: 1px solid #ddd; margin-top: 10px;&#8217;\/&gt;&lt;\/p&gt;<\/p>\n<p>&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;S\u1ea3n ph\u1ea9m \u0111\u00e3 mua&lt;\/h3&gt;<br \/>\n&lt;table style=&#8217;width: 100%; border-collapse: collapse; margin-top: 20px;&#8217;&gt;<br \/>\n&lt;thead&gt;<br \/>\n&lt;tr style=&#8217;background-color: #1e3c72; color: #ffffff;&#8217;&gt;<br \/>\n&lt;th style=&#8217;padding: 10px; border: 1px solid #ddd;&#8217;&gt;S\u1ea3n ph\u1ea9m&lt;\/th&gt;<br \/>\n&lt;th style=&#8217;padding: 10px; border: 1px solid #ddd;&#8217;&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng&lt;\/th&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/thead&gt;<br \/>\n&lt;tbody&gt;&#8221;;<\/p>\n<p>foreach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$product = wc_get_product($product_id);<br \/>\n$product_name = $product-&gt;get_name();<br \/>\n$product_url = get_permalink($product_id);<br \/>\n$product_image_url = wp_get_attachment_url($product-&gt;get_image_id());<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<\/p>\n<p>if (!empty($drive_links)) {<br \/>\n$message .= &#8221;<br \/>\n&lt;tr style=&#8217;background-color: #f9f9f9;&#8217;&gt;<br \/>\n&lt;td style=&#8217;padding: 10px; border: 1px solid #ddd;&#8217;&gt;<br \/>\n&lt;a href='{$product_url}&#8217; style=&#8217;text-decoration: none; color: #1e3c72; font-weight: bold;&#8217;&gt;<br \/>\n&lt;img src='{$product_image_url}&#8217; alt='{$product_name}&#8217; style=&#8217;width: 60px; border-radius: 5px; vertical-align: middle; margin-right: 10px;&#8217; \/&gt;<br \/>\n{$product_name}<br \/>\n&lt;\/a&gt;<br \/>\n&lt;\/td&gt;<br \/>\n&lt;td style=&#8217;padding: 10px; border: 1px solid #ddd; text-align: center;&#8217;&gt;&#8221;;<\/p>\n<p>$links = explode(&#8220;\\n&#8221;, $drive_links);<br \/>\nforeach ($links as $link) {<br \/>\n$qr_code_url = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150&#215;150&amp;data=&#8221; . urlencode(trim($link));<br \/>\n$message .= &#8221;<br \/>\n&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217; style=&#8217;display: inline-block; background-color: #1e3c72; color: #fff; padding: 8px 12px; border-radius: 5px;&#8217;&gt;T\u1ea3i xu\u1ed1ng&lt;\/a&gt;&lt;br&gt;<br \/>\n&lt;img src='{$qr_code_url}&#8217; alt=&#8217;QR Code&#8217; style=&#8217;width: 80px; margin-top: 10px;&#8217; \/&gt;&lt;br&gt;&#8221;;<br \/>\n}<br \/>\n$message .= &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n}<br \/>\n}<\/p>\n<p>$message .= &#8221;<br \/>\n&lt;\/tbody&gt;<br \/>\n&lt;\/table&gt;<\/p>\n<p>&lt;!&#8211; M\u00e3 gi\u1ea3m gi\u00e1 &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;M\u00e3 gi\u1ea3m gi\u00e1 \u0111\u1eb7c bi\u1ec7t cho l\u1ea7n mua ti\u1ebfp theo!&lt;\/h3&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i t\u1eb7ng b\u1ea1n m\u00e3 gi\u1ea3m gi\u00e1 &lt;strong&gt;{$coupon_code}&lt;\/strong&gt; \u0111\u1ec3 s\u1eed d\u1ee5ng cho l\u1ea7n mua ti\u1ebfp theo (gi\u1ea3m 20%). M\u00e3 n\u00e0y c\u00f3 gi\u00e1 tr\u1ecb \u0111\u1ebfn ng\u00e0y &#8221; . date(&#8216;d\/m\/Y&#8217;, strtotime($expiry_date)) . &#8220;.&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;!&#8211; Ch\u00ednh s\u00e1ch v\u00e0 h\u01b0\u1edbng d\u1eabn &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Ch\u00ednh s\u00e1ch v\u00e0 h\u01b0\u1edbng d\u1eabn&lt;\/h3&gt;<br \/>\n&lt;p&gt;<br \/>\n&lt;a href='{$site_url}\/chinh-sach-hoan-tra-don-hang\/&#8217; style=&#8217;color: #1e3c72; text-decoration: none;&#8217;&gt;Ch\u00ednh s\u00e1ch ho\u00e0n ti\u1ec1n&lt;\/a&gt; |<br \/>\n&lt;a href='{$site_url}\/cac-cau-hoi-thuong-gap\/&#8217; style=&#8217;color: #1e3c72; text-decoration: none;&#8217;&gt;C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p&lt;\/a&gt; |<br \/>\n&lt;a href='{$site_url}\/gui-yeu-cau-ho-tro-ho-tro\/&#8217; style=&#8217;color: #1e3c72; text-decoration: none;&#8217;&gt;G\u1eedi y\u00eau c\u1ea7u h\u1ed7 tr\u1ee3&lt;\/a&gt;<br \/>\n&lt;\/p&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i khuy\u1ebfn kh\u00edch b\u1ea1n \u0111\u1ecdc k\u1ef9 c\u00e1c ch\u00ednh s\u00e1ch \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o quy\u1ec1n l\u1ee3i v\u00e0 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 s\u1ea3n ph\u1ea9m c\u1ee7a m\u00ecnh.&lt;\/p&gt;<\/p>\n<p>&lt;!&#8211; H\u00ecnh \u1ea3nh thumbnail video h\u01b0\u1edbng d\u1eabn &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px; text-align: center;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Video h\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t&lt;\/h3&gt;<br \/>\n&lt;a href=&#8217;https:\/\/www.youtube.com\/watch?v=yU3IYeSiBx4&#8242; target=&#8217;_blank&#8217; style=&#8217;text-decoration: none;&#8217;&gt;<br \/>\n&lt;img src=&#8217;https:\/\/muathemewpgiare.com\/wp-content\/uploads\/2024\/10\/theme-wordpress-ban-hang-muathemewpgiare.jpg&#8217;<br \/>\nalt=&#8217;Video h\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t&#8217;<br \/>\nstyle=&#8217;max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);&#8217;&gt;<br \/>\n&lt;\/a&gt;<br \/>\n&lt;p style=&#8217;margin-top: 10px; color: #777;&#8217;&gt;Nh\u1ea5n v\u00e0o h\u00ecnh \u0111\u1ec3 xem video h\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; M\u1eddi \u0111\u00e1nh gi\u00e1 s\u1ea3n ph\u1ea9m &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h3 style=&#8217;color: #1e3c72;&#8217;&gt;Chia s\u1ebb tr\u1ea3i nghi\u1ec7m c\u1ee7a b\u1ea1n&lt;\/h3&gt;<br \/>\n&lt;p&gt;Ch\u00fang t\u00f4i r\u1ea5t mong nh\u1eadn \u0111\u01b0\u1ee3c ph\u1ea3n h\u1ed3i t\u1eeb b\u1ea1n. H\u00e3y \u0111\u1ec3 l\u1ea1i \u0111\u00e1nh gi\u00e1 cho s\u1ea3n ph\u1ea9m c\u1ee7a m\u00ecnh \u0111\u1ec3 gi\u00fap c\u00e1c kh\u00e1ch h\u00e0ng kh\u00e1c c\u00f3 l\u1ef1a ch\u1ecdn t\u1ed1t h\u01a1n!&lt;\/p&gt;<br \/>\n&lt;a href='{$site_url}\/reviews&#8217; target=&#8217;_blank&#8217; style=&#8217;display: inline-block; padding: 10px 20px; background-color: #1e3c72; color: #fff; border-radius: 5px; text-decoration: none; font-weight: bold;&#8217;&gt;\u0110\u00e1nh gi\u00e1 s\u1ea3n ph\u1ea9m&lt;\/a&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; Ch\u1ee9ng nh\u1eadn b\u1ea3n quy\u1ec1n &#8211;&gt;<br \/>\n&lt;div style=&#8217;margin-top: 20px; text-align: center;&#8217;&gt;<br \/>\n&lt;p style=&#8217;font-size: 14px; color: #888;&#8217;&gt;\u00a9 &#8221; . date(&#8220;Y&#8221;) . &#8221; {$site_name}. B\u1ea1n \u0111ang s\u1eed d\u1ee5ng s\u1ea3n ph\u1ea9m, d\u1ecbch v\u1ee5 t\u1ea1i ch\u00fang t\u00f4i. VUi l\u00f2ng s\u1eed d\u1ee5ng \u0111\u00fang m\u1ee5c \u0111\u00edch, kh\u00f4ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng n\u00f3 v\u00e0o m\u1ee5c \u0111\u00edch tr\u00e1i ph\u00e1p lu\u1eadt, n\u1ebfu kh\u00f4ng b\u1ea1n s\u1ebd t\u1ef1 ch\u1ecbu ho\u00e0n to\u00e0n tr\u00e1ch nhi\u1ec7m, s\u1ebd b\u1ecb x\u1eed l\u00fd theo quy \u0111\u1ecbnh c\u1ee7a ph\u00e1p lu\u1eadt.&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;!&#8211; K\u1ebft n\u1ed1i m\u1ea1ng x\u00e3 h\u1ed9i&#8211;&gt;<br \/>\n&lt;div style=&#8217;text-align: center; margin-top: 20px;&#8217;&gt;<br \/>\n&lt;h4&gt;Theo d\u00f5i ch\u00fang t\u00f4i tr\u00ean m\u1ea1ng x\u00e3 h\u1ed9i&lt;\/h4&gt;&#8221;;<br \/>\nforeach ($social_links as $platform =&gt; $link) {<br \/>\n$icon_url = ($platform === &#8216;facebook&#8217;) ? &#8216;https:\/\/img.icons8.com\/color\/48\/000000\/facebook.png&#8217; : &#8221;;<br \/>\n$message .= &#8220;&lt;a href='{$link}&#8217; target=&#8217;_blank&#8217; style=&#8217;margin: 0 5px;&#8217;&gt;<br \/>\n&lt;img src='{$icon_url}&#8217; alt='{$platform}&#8217; style=&#8217;width: 30px; height: 30px; border-radius: 50%;&#8217; \/&gt;<br \/>\n&lt;\/a&gt;&#8221;;<br \/>\n}<\/p>\n<p>$message .= &#8221;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;p style=&#8217;margin-top: 20px; text-align: center; color: #777;&#8217;&gt;\u00a9 &#8221; . date(&#8220;Y&#8221;) . &#8221; &lt;a href='{$site_url}&#8217; style=&#8217;color: #1e3c72;&#8217;&gt;{$site_name}&lt;\/a&gt;. All rights reserved.&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;&#8221;;<\/p>\n<p>\/\/ Header cho email HTML<br \/>\n$headers = array(&#8216;Content-Type: text\/html; charset=UTF-8&#8217;);<br \/>\nwp_mail($email, $subject, $message, $headers);<br \/>\n}<\/p>\n<p>\/\/ Hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u1edbi giao di\u1ec7n chuy\u00ean nghi\u1ec7p v\u00e0 m\u00e3 QR trong t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng<br \/>\nadd_action(&#8216;woocommerce_account_downloads_endpoint&#8217;, &#8216;display_custom_drive_links_in_downloads&#8217;);<\/p>\n<p>function display_custom_drive_links_in_downloads() {<br \/>\n$user_id = get_current_user_id();<br \/>\n$orders = wc_get_orders(array(<br \/>\n&#8216;customer&#8217; =&gt; $user_id,<br \/>\n&#8216;status&#8217; =&gt; &#8216;completed&#8217;,<br \/>\n&#8216;limit&#8217; =&gt; -1,<br \/>\n));<\/p>\n<p>\/\/ Th\u00eam CSS cho giao di\u1ec7n t\u1ea3i xu\u1ed1ng cao c\u1ea5p<br \/>\necho &#8220;&lt;style&gt;<br \/>\n.download-section {<br \/>\nmargin-top: 30px;<br \/>\npadding: 30px;<br \/>\nborder-radius: 15px;<br \/>\nbackground-color: #ffffff;<br \/>\nbox-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);<br \/>\nfont-family: &#8216;Arial&#8217;, sans-serif;<br \/>\ncolor: #333;<br \/>\n}<br \/>\n.download-section h2 {<br \/>\nfont-size: 2em;<br \/>\ncolor: #333;<br \/>\ntext-align: center;<br \/>\nmargin-bottom: 25px;<br \/>\nfont-weight: 600;<br \/>\n}<br \/>\n.download-table {<br \/>\nwidth: 100%;<br \/>\nborder-collapse: collapse;<br \/>\nmargin-top: 20px;<br \/>\nborder-radius: 15px;<br \/>\noverflow: hidden;<br \/>\n}<br \/>\n.download-table th {<br \/>\nfont-size: 1em;<br \/>\ntext-align: center;<br \/>\ncolor: #ffffff;<br \/>\npadding: 15px;<br \/>\nbackground: linear-gradient(45deg, #ff7e5f, #feb47b);<br \/>\nfont-weight: bold;<br \/>\n}<br \/>\n.download-table td {<br \/>\npadding: 20px;<br \/>\nfont-size: 1em;<br \/>\ntext-align: center;<br \/>\nbackground-color: #f8f9fa;<br \/>\nborder-bottom: 1px solid #eee;<br \/>\nborder-radius: 10px;<br \/>\nposition: relative;<br \/>\n}<br \/>\n.thumbnail-img {<br \/>\nwidth: 90px;<br \/>\nheight: 90px;<br \/>\nborder-radius: 10px;<br \/>\nbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);<br \/>\n}<br \/>\n.product-name a {<br \/>\ncolor: #333;<br \/>\nfont-weight: 600;<br \/>\nfont-size: 1.1em;<br \/>\ntext-decoration: none;<br \/>\ntransition: color 0.3s;<br \/>\n}<br \/>\n.product-name a:hover {<br \/>\ncolor: #ff7e5f;<br \/>\n}<br \/>\n.download-link {<br \/>\ndisplay: inline-block;<br \/>\nbackground-color: #ff7e5f;<br \/>\ncolor: #ffffff;<br \/>\npadding: 10px 25px;<br \/>\nmargin: 5px 0;<br \/>\nborder-radius: 25px;<br \/>\nfont-weight: bold;<br \/>\ntext-decoration: none;<br \/>\nbox-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);<br \/>\ntransition: background-color 0.3s, transform 0.3s;<br \/>\n}<br \/>\n.download-link:hover {<br \/>\nbackground-color: #e06752;<br \/>\ntransform: translateY(-2px);<br \/>\n}<br \/>\n.qr-code-container {<br \/>\ndisplay: flex;<br \/>\nflex-direction: column;<br \/>\nalign-items: center;<br \/>\njustify-content: center;<br \/>\n}<br \/>\n.qr-code-container img {<br \/>\nwidth: 70px;<br \/>\nheight: 70px;<br \/>\nmargin-top: 10px;<br \/>\nborder-radius: 8px;<br \/>\ntransition: transform 0.3s ease;<br \/>\n}<br \/>\n.qr-code-container img:hover {<br \/>\ntransform: scale(1.05);<br \/>\n}<br \/>\n.no-downloads {<br \/>\nfont-size: 1.3em;<br \/>\ncolor: #777;<br \/>\nmargin-top: 30px;<br \/>\ntext-align: center;<br \/>\n}<br \/>\n&lt;\/style&gt;&#8221;;<\/p>\n<p>\/\/ Ki\u1ec3m tra v\u00e0 hi\u1ec3n th\u1ecb c\u00e1c \u0111\u01a1n h\u00e0ng c\u00f3 s\u1ea3n ph\u1ea9m t\u1ea3i xu\u1ed1ng<br \/>\nif (!empty($orders)) {<br \/>\necho &#8220;&lt;div class=&#8217;download-section&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;h2&gt;\ud83d\udce5 T\u1ea3i xu\u1ed1ng s\u1ea3n ph\u1ea9m c\u1ee7a b\u1ea1n \ud83d\udce5&lt;\/h2&gt;&#8221;;<br \/>\necho &#8220;&lt;table class=&#8217;download-table&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;H\u00ecnh \u1ea3nh&lt;\/th&gt;&lt;th&gt;S\u1ea3n ph\u1ea9m&lt;\/th&gt;&lt;th&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;th&gt;M\u00e3 QR t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;\/tr&gt;&lt;\/thead&gt;&lt;tbody&gt;&#8221;;<\/p>\n<p>foreach ($orders as $order) {<br \/>\nforeach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$product = wc_get_product($product_id);<br \/>\n$product_name = $item-&gt;get_name();<br \/>\n$product_url = get_permalink($product_id);<br \/>\n$thumbnail_url = wp_get_attachment_image_url($product-&gt;get_image_id(), &#8216;thumbnail&#8217;);<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<\/p>\n<p>if (!empty($drive_links)) {<br \/>\necho &#8220;&lt;tr&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&lt;img src='&#8221; . esc_url($thumbnail_url) . &#8220;&#8216; alt=&#8217;Thumbnail&#8217; class=&#8217;thumbnail-img&#8217; \/&gt;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td class=&#8217;product-name&#8217;&gt;&lt;a href='&#8221; . esc_url($product_url) . &#8220;&#8216;&gt;{$product_name}&lt;\/a&gt;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&#8221;;<\/p>\n<p>$links = explode(&#8220;\\n&#8221;, $drive_links);<br \/>\nforeach ($links as $link) {<br \/>\necho &#8220;&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217; class=&#8217;download-link&#8217;&gt;T\u1ea3i xu\u1ed1ng&lt;\/a&gt;&lt;br&gt;&#8221;;<br \/>\n}<\/p>\n<p>echo &#8220;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td class=&#8217;qr-code-container&#8217;&gt;&#8221;;<\/p>\n<p>foreach ($links as $link) {<br \/>\n$qr_code_url = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150&#215;150&amp;data=&#8221; . urlencode(trim($link));<br \/>\necho &#8220;&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217;&gt;<br \/>\n&lt;img src='{$qr_code_url}&#8217; alt=&#8217;QR Code Download&#8217; \/&gt;<br \/>\n&lt;\/a&gt;&lt;br&gt;&#8221;;<br \/>\n}<\/p>\n<p>echo &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\necho &#8220;&lt;\/tbody&gt;&lt;\/table&gt;&#8221;;<br \/>\necho &#8220;&lt;\/div&gt;&#8221;;<br \/>\n} else {<br \/>\necho &#8220;&lt;p class=&#8217;no-downloads&#8217;&gt;B\u1ea1n ch\u01b0a c\u00f3 s\u1ea3n ph\u1ea9m n\u00e0o \u0111\u1ec3 t\u1ea3i xu\u1ed1ng.&lt;\/p&gt;&#8221;;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ Hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng trong trang c\u1ea3m \u01a1n sau khi thanh to\u00e1n n\u1ebfu \u0111\u01a1n h\u00e0ng \u0111\u00e3 ho\u00e0n t\u1ea5t ho\u1eb7c \u0111ang x\u1eed l\u00fd<br \/>\nadd_action(&#8216;woocommerce_thankyou&#8217;, &#8216;display_drive_links_on_thank_you_page&#8217;, 10, 1);<\/p>\n<p>function display_drive_links_on_thank_you_page($order_id) {<br \/>\nif (!$order_id) return;<br \/>\n$order = wc_get_order($order_id);<\/p>\n<p>\/\/ Th\u00eam CSS \u0111\u1ec3 c\u1ea3i thi\u1ec7n tr\u1ea3i nghi\u1ec7m giao di\u1ec7n<br \/>\necho &#8220;&lt;style&gt;<br \/>\n.download-container {<br \/>\ntext-align: center;<br \/>\nmargin-top: 20px;<br \/>\npadding: 20px;<br \/>\nborder: 1px solid #ddd;<br \/>\nborder-radius: 10px;<br \/>\nbackground-color: #fafafa;<br \/>\nbox-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);<br \/>\n}<br \/>\n.download-table {<br \/>\nwidth: 100%;<br \/>\nborder-collapse: collapse;<br \/>\nmargin-top: 20px;<br \/>\n}<br \/>\n.download-table th {<br \/>\nbackground-color: #4CAF50;<br \/>\ncolor: white;<br \/>\npadding: 15px;<br \/>\nfont-size: 16px;<br \/>\ntext-align: left;<br \/>\n}<br \/>\n.download-table td {<br \/>\npadding: 12px;<br \/>\ntext-align: center;<br \/>\nborder-bottom: 1px solid #ddd;<br \/>\n}<br \/>\n.download-table .thumbnail-img {<br \/>\nwidth: 70px;<br \/>\nheight: 70px;<br \/>\nobject-fit: contain;<br \/>\nbackground-color: #f0f0f0;<br \/>\nborder-radius: 5px;<br \/>\n}<br \/>\n.download-link, .review-link {<br \/>\ndisplay: inline-block;<br \/>\nbackground-color: #0073aa;<br \/>\ncolor: white;<br \/>\npadding: 8px 15px;<br \/>\nmargin: 5px 0;<br \/>\nborder-radius: 5px;<br \/>\ntext-decoration: none;<br \/>\nfont-weight: bold;<br \/>\ntransition: background-color 0.3s;<br \/>\n}<br \/>\n.download-link:hover, .review-link:hover {<br \/>\nbackground-color: #005082;<br \/>\n}<br \/>\n.qr-code {<br \/>\nwidth: 70px;<br \/>\nheight: 70px;<br \/>\nmargin-top: 10px;<br \/>\n}<br \/>\n.download-notice {<br \/>\nbackground-color: #f8d7da;<br \/>\ncolor: #721c24;<br \/>\npadding: 15px;<br \/>\nborder: 1px solid #f5c6cb;<br \/>\nborder-radius: 5px;<br \/>\nmargin: 20px 0;<br \/>\nfont-size: 16px;<br \/>\n}<br \/>\n.product-instructions {<br \/>\nfont-size: 14px;<br \/>\ncolor: #555;<br \/>\nmargin-top: 10px;<br \/>\nfont-style: italic;<br \/>\n}<br \/>\n&lt;\/style&gt;&#8221;;<\/p>\n<p>\/\/ Ki\u1ec3m tra tr\u1ea1ng th\u00e1i \u0111\u01a1n h\u00e0ng v\u00e0 th\u00f4ng b\u00e1o n\u1ebfu ch\u01b0a ho\u00e0n t\u1ea5t<br \/>\nif ($order-&gt;get_status() != &#8216;completed&#8217; &amp;&amp; $order-&gt;get_status() != &#8216;processing&#8217;) {<br \/>\necho &#8220;&lt;div class=&#8217;download-notice&#8217;&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng s\u1ebd kh\u1ea3 d\u1ee5ng sau khi thanh to\u00e1n ho\u00e0n t\u1ea5t. H\u00e3y thanh to\u00e1n \u0111\u1ec3 c\u00f3 th\u1ec3 t\u1ea3i xu\u1ed1ng.&lt;\/div&gt;&#8221;;<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ Th\u00f4ng b\u00e1o v\u00e0 h\u01b0\u1edbng d\u1eabn<br \/>\necho &#8220;&lt;div class=&#8217;download-container&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;h2&gt;\ud83c\udf89 C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 mua h\u00e0ng! \ud83c\udf89&lt;\/h2&gt;&#8221;;<br \/>\necho &#8220;&lt;p class=&#8217;product-instructions&#8217;&gt;B\u1ea1n c\u00f3 th\u1ec3 t\u1ea3i xu\u1ed1ng c\u00e1c s\u1ea3n ph\u1ea9m c\u1ee7a m\u00ecnh qua c\u00e1c li\u00ean k\u1ebft v\u00e0 m\u00e3 QR d\u01b0\u1edbi \u0111\u00e2y.&lt;\/p&gt;&#8221;;<\/p>\n<p>\/\/ T\u1ea1o b\u1ea3ng hi\u1ec3n th\u1ecb s\u1ea3n ph\u1ea9m, li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng v\u00e0 m\u00e3 QR<br \/>\necho &#8220;&lt;table class=&#8217;download-table&#8217;&gt;&#8221;;<br \/>\necho &#8220;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;S\u1ea3n ph\u1ea9m&lt;\/th&gt;&lt;th&gt;Li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;th&gt;M\u00e3 QR t\u1ea3i xu\u1ed1ng&lt;\/th&gt;&lt;\/tr&gt;&lt;\/thead&gt;&lt;tbody&gt;&#8221;;<\/p>\n<p>foreach ($order-&gt;get_items() as $item) {<br \/>\n$product_id = $item-&gt;get_product_id();<br \/>\n$product = wc_get_product($product_id);<br \/>\n$product_name = $item-&gt;get_name();<br \/>\n$product_url = get_permalink($product_id);<br \/>\n$drive_links = get_post_meta($product_id, &#8216;_drive_links&#8217;, true);<br \/>\n$thumbnail_url = wp_get_attachment_url($product-&gt;get_image_id());<\/p>\n<p>\/\/ Ki\u1ec3m tra v\u00e0 hi\u1ec3n th\u1ecb li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng<br \/>\nif (!empty($drive_links)) {<br \/>\necho &#8220;&lt;tr&gt;&#8221;;<br \/>\necho &#8220;&lt;td style=&#8217;text-align: left;&#8217;&gt;<br \/>\n&lt;img src='&#8221; . esc_url($thumbnail_url) . &#8220;&#8216; alt=&#8217;Thumbnail&#8217; class=&#8217;thumbnail-img&#8217; \/&gt;<br \/>\n&lt;a href='&#8221; . esc_url($product_url) . &#8220;&#8216; style=&#8217;text-decoration: none; color: #333; font-weight: bold;&#8217;&gt;{$product_name}&lt;\/a&gt;<br \/>\n&lt;p class=&#8217;product-instructions&#8217;&gt;Video h\u01b0\u1edbng d\u1eabn &amp; T\u00e0i li\u1ec7u \u0111i k\u00e8m \u0111\u01b0\u1ee3c g\u1eedi qua gmail c\u1ee7a b\u1ea1n&lt;\/p&gt;<br \/>\n&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&#8221;;<\/p>\n<p>$links = explode(&#8220;\\n&#8221;, $drive_links);<br \/>\nforeach ($links as $link) {<br \/>\necho &#8220;&lt;a href='&#8221; . esc_url(trim($link)) . &#8220;&#8216; target=&#8217;_blank&#8217; class=&#8217;download-link&#8217;&gt;<br \/>\n&lt;img src=&#8217;https:\/\/img.icons8.com\/material-rounded\/24\/ffffff\/download&#8211;v1.png&#8217; alt=&#8217;Download&#8217; class=&#8217;download-table-icon&#8217; \/&gt; T\u1ea3i xu\u1ed1ng<br \/>\n&lt;\/a&gt;&lt;br&gt;&#8221;;<br \/>\n}<br \/>\necho &#8220;&lt;\/td&gt;&#8221;;<br \/>\necho &#8220;&lt;td&gt;&#8221;;<\/p>\n<p>\/\/ T\u1ea1o m\u00e3 QR cho t\u1eebng li\u00ean k\u1ebft t\u1ea3i xu\u1ed1ng<br \/>\nforeach ($links as $link) {<br \/>\n$qr_code_url = &#8220;https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=70&#215;70&amp;data=&#8221; . urlencode(trim($link));<br \/>\necho &#8220;&lt;img src='{$qr_code_url}&#8217; alt=&#8217;QR Code Download&#8217; class=&#8217;qr-code&#8217; \/&gt;&lt;br&gt;&#8221;;<br \/>\n}<br \/>\necho &#8220;&lt;\/td&gt;&lt;\/tr&gt;&#8221;;<br \/>\n}<br \/>\n}<br \/>\necho &#8220;&lt;\/tbody&gt;&lt;\/table&gt;&#8221;;<\/p>\n<p>\/\/ Th\u00eam ph\u1ea7n khuy\u1ebfn kh\u00edch \u0111\u00e1nh gi\u00e1 v\u00e0 li\u00ean h\u1ec7 h\u1ed7 tr\u1ee3<br \/>\necho &#8220;&lt;a href='{$product_url}#reviews&#8217; class=&#8217;review-prompt&#8217;&gt;\u2b50 \u0110\u1ec3 l\u1ea1i \u0111\u00e1nh gi\u00e1 cho s\u1ea3n ph\u1ea9m c\u1ee7a b\u1ea1n \u2b50&lt;\/a&gt;&#8221;;<br \/>\necho &#8220;&lt;a href=&#8217;\/lien-he\/&#8217; class=&#8217;support-link&#8217;&gt;&lt;br&gt;B\u1ea1n c\u1ea7n h\u1ed7 tr\u1ee3? Li\u00ean h\u1ec7 ch\u00fang t\u00f4i t\u1ea1i \u0111\u00e2y&lt;\/a&gt;&#8221;;<\/p>\n<p>echo &#8220;&lt;\/div&gt;&#8221;;<br \/>\n}<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>C\u00e1c anh em \u0111ang b\u00e1n \u0111\u1ed3 digital tr\u00ean WooCommerce nh\u01b0 course h\u1ecdc, preset \u1ea3nh, template x\u1ecbn x\u00f2,\u2026! B\u1ea1n c\u00f3 \u0111ang \u201cch\u1eadt v\u1eadt\u201d v\u1edbi c\u1ea3nh ng\u1ed3i c\u1eb7m c\u1ee5i g\u1eedi file th\u1ee7 c\u00f4ng cho t\u1eebng kh\u00e1ch kh\u00f4ng? N\u1ebfu c\u00e2u tr\u1ea3 l\u1eddi l\u00e0 C\u00d3, th\u00ec b\u00e0i vi\u1ebft n\u00e0y ch\u00ednh l\u00e0 \u201cphao c\u1ee9u sinh\u201d d\u00e0nh cho b\u1ea1n. Tui s\u1ebd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1369,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,11],"tags":[],"class_list":["post-1368","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chia-se","category-thiet-ke-website"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/posts\/1368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/comments?post=1368"}],"version-history":[{"count":0,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/posts\/1368\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/media\/1369"}],"wp:attachment":[{"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/media?parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/categories?post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cuongnguyen.bat.io.vn\/index.php\/wp-json\/wp\/v2\/tags?post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}