Ebay.com (co.uk, co.de, co.fr etc) Amazon.com (co.uk, co.de, co.fr etc) Aliexpress.com Etsy.com Focalprice.com Flipkart.com Banggood.com iOffer.com Walmart.com Sunsky-online.com Snapdeal.com Sportsdirect.com 6pm.com Buyincoins.com Tinydeal.com Superdeal.com Sammydress.com Souq.com Lelong.com.my Lazada.com Shopclues.com Gearbest.com ali-1688->data-feature-json stdClass Object ( [num_rows] => 1 [row] => Array ( [product_source_id] => 2 [source_id] => pdd98305814196 [product_id] => 79 [source_from] => pdd [collect_id] => pdd2103080436373210 ) [rows] => Array ( [0] => Array ( [product_source_id] => 2 [source_id] => pdd98305814196 [product_id] => 79 [source_from] => pdd [collect_id] => pdd2103080436373210 ) ) ) mysqli_result Object ( [current_field] => 0 [field_count] => 11 [lengths] => [num_rows] => 0 [type] => 0 ) https://mobile.yangkeduo.com/mall_quality_assurance.html?_t_timestamp=comm_share_landing&goods_id=56972644840&_oak_share_type=6&_oak_share_url=https%3A%2F%2Ft00img.yangkeduo.com%2Fgoods%2Fimages%2F2019-10-23%2F67509b0a-e274-403d-8c8e-424b90418999.jpg&refer_share_id=0b792476fa464bc6ab879dd994fecad0&refer_share_uid=5366106146&refer_share_channel=copy_link&refer_share_form=text https://mobile.yangkeduo.com/search_result.html?search_key=%E7%A7%8B%E5%AD%A3%E5%AE%BD%E6%9D%BE%E5%81%87%E4%B8%A4%E4%BB%B6%E9%95%BF%E8%A2%96%E8%BF%90%E5%8A%A8T%E6%81%A4%E7%94%B7%E5%A3%AB%E8%B7%91%E6%AD%A5%E7%AF%AE%E7%90%83%E8%AE%AD%E7%BB%83 store.listData.list[0].goodsID=101508669875 store.listData.list[0].goodsName="【畅销榜前30名】运动长袖男弹力连帽健身衣篮球跑步训练潮流T恤速干大码宽松上衣" store.listData.list[0].image_url="https://t00img.yangkeduo.com/goods/images/2020-04-15/57e60657-8730-4af4-96a9-4673d3cfd4f5.jpg" store.listData.list[0].price=39.9 {"en":{ "2276":{"name":"Color Classification","value":{"16563":"Khaki","16572":"Pink","16573":"purple","16574":"green","16575":"blue"}}, "2277":{"name":"size","value":{"16564":"S","16565":"M","16566":"L","16567":"XL","16568":"2XL","16569":"3XL","16570":"4XL","16571":"5XL"}}}, "cn":{ "2276":{"name":"颜色分类","value":{"16563":"卡其色","16572":"粉红色","16573":"紫色","16574":"绿色","16575":"蓝色"}}, "2277":{"name":"尺码","value":{"16564":"S","16565":"M","16566":"L","16567":"XL","16568":"2XL","16569":"3XL","16570":"4XL","16571":"5XL"}}}} {"price":{"129":6.41,"130":6.54,"131":6.47,"132":6.2,"133":6.63,"134":6.34,"135":6.27,"136":6.63,"137":6.7,"138":5.69,"139":5.01,"140":5,"141":4.98,"142":4.97,"143":4.74,"144":4.72,"145":6.2,"146":6.13,"147":6.05,"148":5.98,"149":5.91,"150":5.84,"151":6.24,"152":6.23,"153":6.17,"154":4.26,"155":4.29,"156":4.28,"157":4.31,"158":5.67,"159":5.66,"160":5.64,"161":5.63,"162":5.62,"163":5.6,"164":5.59,"165":5.57,"166":6.44,"167":6.46,"168":4.96,"169":1.49}, "weight":{"129":25,"130":25,"131":25,"132":25,"133":25,"134":25,"135":25,"136":25,"137":25,"138":25,"139":25,"140":25,"141":25,"142":25,"143":25,"144":25,"145":25,"146":25,"147":25,"148":25,"149":25,"150":25,"151":25,"152":25,"153":25,"154":25,"155":25,"156":25,"157":25,"158":25,"159":25,"160":25,"161":25,"162":25,"163":25,"164":25,"165":25,"166":25,"167":25,"168":25,"169":25}, "image":{"129":"catalog/cn/210315/pdd186714170184/020.jpg","130":"catalog/cn/210315/pdd186714170184/021.jpg","131":"catalog/cn/210315/pdd186714170184/022.jpg","132":"catalog/cn/210315/pdd186714170184/023.jpg","133":"catalog/cn/210315/pdd186714170184/024.jpg","134":"catalog/cn/210315/pdd186714170184/025.jpg","135":"catalog/cn/210315/pdd186714170184/026.jpg","136":"catalog/cn/210315/pdd186714170184/027.jpg","137":"catalog/cn/210315/pdd186714170184/028.jpg","138":"catalog/cn/210315/pdd186714170184/029.jpg","139":"catalog/cn/210315/pdd186714170184/011.jpg","140":"catalog/cn/210315/pdd186714170184/030.jpg","141":"catalog/cn/210315/pdd186714170184/031.jpg","142":"catalog/cn/210315/pdd186714170184/032.jpg","143":"catalog/cn/210315/pdd186714170184/033.jpg","144":"catalog/cn/210315/pdd186714170184/034.jpg","145":"catalog/cn/210315/pdd186714170184/035.jpg","146":"catalog/cn/210315/pdd186714170184/014.jpg","147":"catalog/cn/210315/pdd186714170184/036.jpg","148":"catalog/cn/210315/pdd186714170184/037.jpg","149":"catalog/cn/210315/pdd186714170184/016.jpg","150":"catalog/cn/210315/pdd186714170184/038.jpg","151":"catalog/cn/210315/pdd186714170184/018.jpg","152":"catalog/cn/210315/pdd186714170184/017.jpg","153":"catalog/cn/210315/pdd186714170184/039.jpg","154":"catalog/cn/210315/pdd186714170184/040.jpg","155":"catalog/cn/210315/pdd186714170184/041.jpg","156":"catalog/cn/210315/pdd186714170184/012.jpg","157":"catalog/cn/210315/pdd186714170184/042.jpg","158":"catalog/cn/210315/pdd186714170184/043.jpg","159":"catalog/cn/210315/pdd186714170184/044.jpg","160":"catalog/cn/210315/pdd186714170184/015.jpg","161":"catalog/cn/210315/pdd186714170184/045.jpg","162":"catalog/cn/210315/pdd186714170184/046.jpg","163":"catalog/cn/210315/pdd186714170184/047.jpg","164":"catalog/cn/210315/pdd186714170184/048.jpg","165":"catalog/cn/210315/pdd186714170184/049.jpg","166":"catalog/cn/210315/pdd186714170184/013.jpg","167":"catalog/cn/210315/pdd186714170184/050.jpg","168":"catalog/cn/210315/pdd186714170184/051.jpg","169":"catalog/cn/210315/pdd186714170184/052.jpg"}} https://pfs.pinduoduo.com/img_check/2020-10-28/4e06f69e7f929ee05c995d9fa3033953.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DjIS69PsPVEJbCrDK0tXMFsPKdJUTVoUY%26q-sign-time%3D1619014995%3B1619016795%26q-key-time%3D1619014995%3B1619016795%26q-header-list%3D%26 https://pfs.yangkeduo.com/img_check/2019-05-12/0aa6c01096fc56b0d6613d53c7a2982b.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DjIS69PsPVEJbCrDK0tXMFsPKdJUTVoUY%26q-sign-time%3D1619015049%3B1619016849%26q-key-time%3D1619015049%3B1619016849%26q-header-list%3D%26 \b Backspace (ascii code 08) \f Form feed (ascii code 0C) \n New line \r Carriage return \t Tab \" Double quote \\ Backslash character \u followed by four-hex-digits Cross Selling Bundle module consist of 4 types product : 1. Also bought (Customers who bought this also bought) When a user viewed any product at product page, it looks into the database and search if any other user has purchased other products along with the currently viewed product. If yes, it suggests those products to the customer. This type only work at product page. 2. Also viewed (Customers who viewed this also viewed) When a user viewed any product at product page it looks into the database and search if any other user has viewed other products along with the currently viewed product. If yes, it suggests those products to the customer. This type only work at product page. 3. Recently purchased This type will shows recently purchased products by customer. 4. Recently viewed This type will shows recently viewed products by customer. 0412 14:37 卡死 0412 14:49 reboot 0412 23:00 卡死 0412 23:10 reboot 0414 13:20 卡死 0414 13:25 reboot 488,507,508,509,511,512,684,685,689,705,1210,1212,1214,1221,1226,1228,1233,1237,1239,1241,1242,1257,1258,1277,1740 SELECT * FROM `oc_product_description` WHERE `description` = '' and `product_id` in (488,507,508,509,511,512,684,685,689,705,1210,1212,1214,1221,1226,1228,1233,1237,1239,1241,1242,1257,1258,1277,1740) ORDER BY `product_id` ASC insert into oc_ps select * from oc_ps0 where `product_id` in (488,507,508,509,511,512,684,685,689,705,1210,1212,1214,1221,1226,1228,1233,1237,1239,1241,1242,1257,1258,1277,1740) insert into oc_product_source select * from oc_ps 猜你喜歡 補rawdata SQL水平拆表 home-feature {"name":"home-feature","product_name":"","product":["108","1224","178","2383"],"limit":"4","width":"200","height":"200","status":"1"} You may also like / Also Bought / Products related to this item recently views recently Bought Also You may also like / Also Bought / Products related to this item recently views recently Bought Also Bought https://aidemo.youdao.com/ocrtransapi?imgUrl=https://img.wg-1.com/image/catalog/cn/210409/pdd2925798077/010.jpg&lang=en&angle=&company= https://aidemo.youdao.com/ocrtransapi?imgUrl=https://img.wg-1.com/image/catalog/cn/210409/pdd2925798077/010.jpg https://aidemo.youdao.com/ocrtransapi?imgUrl=https://img.wg-1.com/image/catalog/cn/210319/pdd5505480556/009.jpg WHERE DATEDIFF(CURDATE(), p.date_added)<10 // dv $this->load->language('common/common'); $data['slideshow_title'] = $this->language->get('cat_list_title'); print_r($data); SELECT *,length(tag) FROM oc_product_ext_tag WHERE REGEXP_LIKE(tag,(10001|10004|10003)) ORDER BY LENGTH(tag) DESC SELECT *,length(tag) FROM oc_product_ext_tag WHERE tag LIKE '%(10001|10004|10003)%' Array ( [name] => cat-list [banner_id] => 9 [width] => 10 [height] => 10 [status] => 1 ) 99653571566&page_from=23&pxq_secret_key=MIQAFTMQPUO7JPCTXECWZM22UB7JOG5FT4QIFBGWRBYJCSURC4LQ&share_uin=LPJVOOJNXIFCQAQDJ5V7HCYX3Y_GEXDA&refer_share_id=9e33dabfd3fe43fe9ab98b8101d639d3&refer_share_uid=7084942899180&refer_share_channel=copy_link&refer_share INSERT INTO oc_product_source SET source_id = 'pdd204792356377', source_from = 'pdd', source_url = '204792356377&page_from=401&pxq_secret_key=MIQAFTMQPUO7JPCTXECWZM22UDBDRBKL2CMPO3JUTTP3VOSR4CNA&share_uin=LPJVOOJNXIFCQAQDJ5V7HCYX3Y_GEXDA&refer_share_id=72df32fbe3f84604b30846eaa3ba1942&refer_share_uid=7084942899180&refer_share_channel=copy_link&refer_share_form=text', url_finder = 'sd', weight = '-0.1', date_url = NOW() INSERT INTO oc_product_source SET source_id = 'pdd204792356377', source_from = 'pdd', source_url = '204792356377&page_from=401&pxq_secret_key=MIQAFTMQPUO7JP', url_finder = 'sd', weight = '-0.1', date_url = NOW() find /home/httpd/www/html/dv -type f -print | wc -l find ./ -type f -print | wc -l for(var obj in window) { if(window.hasOwnProperty(obj) && typeof(obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length) console.log(obj); } for(let key in window){ console.log(key + '---' + JSON.parse(window[key])) } for(let key in window){ console.log(JSON.parse(window[key])) } cp /var/www/html-wg1/image/trans-cn/pdd17671260956-005.jpg /var/www/html-wg1/image/catalog/cn/210419/pdd17671260956/005.jpg ========================================================================================================================= 13135 -> catalog/cn/210407/pdd191405393077/026.jpg 14782 -> catalog/cn/210410/pdd201395477419/000.jpg 15053 -> catalog/cn/210408/pdd7379473835/063.jpg 15069 -> catalog/cn/210408/pdd112578305159/041.jpg /home/httpd/www/html-wg1/image/catalog/cn/210318/pdd99585638370/ https://img.pddpic.com/mms-material-img/2020-07-18/5b52eca1-2a69-4a9c-851a-e882b8252fe3.jpg.a.jpeg /home/httpd/www/html-wg1/image/catalog/cn/210406/pdd163464058680/045.jpg select * from oc_pd_0412 inner join oc_pd_0322 on oc_pd_0412.product_id=oc_pd_0322.product_id where oc_pd_0412.description='' :-0, -> :-0.1, UPDATE oc_product_ext SET option_ext=REPLACE (option_ext,':-0,',':-0.1,'); {"50005":10,"50002":5,"50001":5} {"50005":10,"50002":1,"50003":3,"50001":2} fetch("https://mobile.yangkeduo.com/proxy/api/api/oak/integration/render?pdduid=7084942899180", { LxMH ei = n("LxMH"), location.href var M = x.data, store.initDataObj.goods.goodsID goods.goods_id store.initDataObj.goods.goodsName goods.goods_name store.initDataObj.goods.goodsProperty[0].key store.initDataObj.goods.goodsProperty[0].values[0] goods.goods_property[0].key goods.goods_property[0].values[0] store.initDataObj.goods.minGroupPrice price.min_group_price (29.99 -> 2999) // main image [17] store.initDataObj.goods.topGallery[0].url goods.gallery[17].url -> goods.gallery[17].type=1 , goods.gallery[17].priority=0 // thumb image [18]~[26] store.initDataObj.goods.topGallery[1].url goods.gallery[18].url -> goods.gallery[18].type=1 , goods.gallery[18].priority=1~9 // desc image [0]~[16] store.initDataObj.goods.detailGallery[$i].url goods.gallery[16].url-> goods.gallery[16].type=2 , goods.gallery[16].priority=10 // option store.initDataObj.goods.skus[$i].defaultQuantity store.initDataObj.goods.skus[$i]['specs'][$j]['spec_key'] store.initDataObj.goods.skus[$i]['specs'][$j]['spec_value'] store.initDataObj.goods.skus[$i]['groupPrice'] store.initDataObj.goods.skus[$i]['thumbUrl'] sku[0].default_quantity sku[0].specs[0].spec_key sku[0].specs[0].spec_value sku[0].group_price (29.99 -> 2999) sku[0].thumb_url store.initDataObj.oakData.review.reviewInfoList[0].name store.initDataObj.oakData.review.reviewInfoList[0].comment review.review_data.review_info_list[1].name review.review_data.review_info_list[1].comment guideConfig: {waitTime: 20000, presentTime: 5000} ========================================================================================================================= PP 用 sc@dacomputing.com 付款, 密碼 18480ML5477ml 4465 4203 9172 3483 03/24 MEI L CHEN 998 https://www.braintreegateway.com/merchants/xjw6bxr567wt8x5c/home Cutiepet + ML5477ml GMAIL 和 FB 帳密, koofficetw@gmail.com ; kkman1234 ========================================================================================================================= dv.php -> 總入口 -> 上傳下載頁面 dv-1.php -> 匯入 -> 將拼多多商品頁采集到已保存在 ko 的 json 轉進 db 產生 product 等資料 + 根據 json 采集所有圖片保存在 ko 對應的商品目錄下 dv-1-1.php -> 采圖列表 -> 由 tp-1-1 調用後根據 db curl 未采集資料表產生 json 列表 + 接收 tp-1-1 上傳列表 json 後轉進 db 更新 curl 資料表 tp-1-1.php -> 采圖 curl-> 由 crx 調用後向 dv-1-1 下載采集圖片列表 json 開始采集並重命名圖片在台北 ko 後回傳列表給 dv-1-1 dv-2.php -> 翻譯 -> 將 wg-1 商品頁由 crx 采集並上傳的英文翻譯 json 轉進 db 更新商品中文名稱,說明,規格,評論等資料轉為英文 dv-2-1.php -> 翻譯列表 -> 根據 oc_product_description 英文說明未翻譯的商品產生列表 json 給 crx 使用 dv-2-2.php -> 單翻譯評論 -> 根據 oc_product_ext_setting 的 tmp-idx 指標讀取 oc_review 產生大量評論加作者網頁給 google 翻譯後手動上傳英文 dv-2-3.php -> 單保存翻譯評論 -> 將 dv-2-2 上傳的大量英文評論加作者 string 存入 oc_review dv-3.php -> 抓拼多多 -> 將 crx 分批上傳采集到拼多多商品頁的 json 保存在 ko 對應的商品目錄下 + 為所有需采集圖片去重產生 db curl 資料表 dv-4.php -> 找貨上傳 -> 將 editer 上傳的拼多多商品頁 url, 重量存入 db dv-4-1.php -> 抓拼多多列表 ->根據 oc_product_source 未采集的商品產生列表 json 給 crx 使用 dv-5.php -> x圖片編輯 -> 接收 editer 上傳的圖片編輯列表, 重量等存入 db 後返回該商品的圖片編輯資料列表 json 給 wg-1 商品頁 dv-6.php -> x下載分類包 -> 產生圖片加分類目錄的 zip 以供下載使用 dv-6-1.php -> x上傳分類包 -> 接收上傳圖片加分類目錄的 zip 解壓後根據圖片所在的分類目錄更新 oc_product_to_category 的資料 dv-6-2.php -> 上傳分類 csv -> 接收上傳分類目錄的 csv 後更新 oc_product_to_category 的資料 dv-7.php -> 可編緝重量圖頁 -> 根據產品編號產生50個商品的圖片+基本資料+選項等可編輯列表網頁 + 接收 post 上傳的非標,重量資料更新 oc_product_option_ext dv-7-1.php -> 連續產品圖頁 -> 根據產品編號產生50個商品的圖片+基本資料列表網頁 dv-7-2.php -> 可編緝tag頁 -> 根據tag條件產生所有符合商品的圖片+中英標題+tag等列表網頁 + 接收 post 上傳的tag設定更新 oc_product_ext_tag --- 20210320-0410 DV php 系列 ========================================================================================================================= 1.) joe /var/www/html/catalog/model/catalog/product.php //66.249.xxx.xxx -> 台湾省彰化市 谷歌云 -> customer_id=6 //新增保存來源 path, web_url //修改全部 product list module 產品 link 加 path 2.) joe /var/www/html/catalog/model/account/wishlist.php //新增欄位 oc_customer_wishlist -> cw_id, status (default: 1 enable) //改所有 DELETE -> UPDATE SET status=0 WHERE status=1 //改所有 SELECT -> 加 WHERE status=1 3.) joe /var/www/html/system/library/cart/cart.php //新增欄位 oc_cart -> status (default: 1 enable) //改所有 DELETE -> UPDATE SET status=0 WHERE status=1 //改所有 SELECT -> 加 WHERE status=1 --- 20210426 opencart-3.0.3.6 瀏覽, 搜索, 收藏, 購物車, 購買記錄 (depot 不處理) ========================================================================================================================= 修改 google 翻譯英文錯誤 斤->kg 1.) joe /var/www/html/catalog/controller/product/product.php //新增修改錯誤函數 convertjintolb 將中文錯誤提前轉換顯示為英文 $tmpstr=str_replace('公斤', ' Kg', $tmpstr); $tmpstr=str_replace('斤', ' lb', $tmpstr); 2.) joe /var/www/html/dv/dv-2-1.php //重新列表已翻譯錯誤英文的 oc_product_description 再次重新翻譯 -> name 70x + description 6x //重新列表已翻譯錯誤英文的 oc_product_ext 再次重新翻譯 -> option 1503x(斤) - 6x(公斤) --- 20210424 修改 google 翻譯英文錯誤 斤->kg ========================================================================================================================= --- 20210422 台北 oc ko 加掛 1T HDD 作 image ko ========================================================================================================================= 1.) 新增 oc_product_description_cn 2.) joe /var/www/html/catalog/model/catalog/product.php 3.) joe /var/www/html/system/library/cart/cart.php //修改判斷 $this->config->get('config_language_id') 選用對應 oc_product_description, oc_product_description_cn 4.) joe /var/www/html/catalog/model/catalog/review.php //修改刪除 LEFT JOIN oc_product_description 5.) joe /var/www/html/admin/model/catalog/product.php //新增同步刪除3個 dv table + 讀取不同語言的 oc_product_description 6.) joe /var/www/html/dv/dv-1.php, dv-2.php, dv-7.php, dv-7-1.php --- 20210421 opencart-3.0.3.6 SQL oc_product_description 語言分表 ========================================================================================================================= 圖片翻譯 $this->document->addScript('catalog/view/javascript/jquery/jquery.mobile-1.4.5.min.js -> 與 swiper 沖突點擊會報錯 -> jquery-2.1.1.min.js:2 Uncaught Error: cannot call methods on page prior to initialization; attempted to call method 'bindRemove' 1.) joe /var/www/html/catalog/view/theme/default/template/product/product.twig //新增2個 translate image 按鈕彈窗提示長按圖片 //新增長按圖片彈窗確認是否翻譯後 ajax 圖片 url 給 product/enquiry/trans -> 返回後更新翻譯完成的新 image url 2.) joe /var/www/html/catalog/controller/product/enquiry.php //新增 trans 函數調用函數 model_account_customer->addTransimage 寫入 SQL 加新增 getImage 函數 CURL 有道免費 API 直接翻譯圖片 //轉換 url -> cn img path -> cp back cn -> curl en img path -> cp cn img path https://img.wg-1.com/image/catalog/cn/210319/pdd5505480556/009.jpg -> /var/www/html-wg1/image/catalog/cn/210319/pdd5505480556/009.jpg -> copy /var/www/html-wg1/image/trans-cn/pdd5505480556-009.jpg -> youdao https://aidemo.youdao.com/ocrtransapi?imgUrl=https://img.wg-1.com/image/catalog/cn/210319/pdd5505480556/009.jpg -> curl /var/www/html-wg1/image/trans-en/pdd5505480556-009.jpg -> copy https://img.wg-1.com/image/catalog/cn/210319/pdd5505480556/009.jpg 3.) joe /var/www/html/catalog/model/account/customer.php //新增函數 addTransimage 寫入 oc_customer_ext_msg $this->db->query("INSERT INTO " . DB_PREFIX . "customer_ext_msg SET customer_id = '" . (int)$data['customer_id'] . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "',product_id = '" . (int)$data['product_id'] . "', enquiry = '" . $this->db->escape($data['trans_image']) . "', date_added = NOW()"); --- 20210421 opencart-3.0.3.6 圖片翻譯 ========================================================================================================================= 聯系賣家 1.) joe /var/www/html/catalog/view/theme/default/template/product/product.twig //新增重量下方 contact seller 連結點擊彈窗 ajax 產品選項給 product/enquiry/add 返回客戶姓名郵箱等聯系賣家表格加服務說明 //新增完成聯系賣家表格 ajax 上傳產品選項客戶姓名郵箱留言 2.) joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig //新增重量下方 contact seller 連結點擊彈窗 ajax 產品選項給 product/enquiry/add 返回客戶姓名郵箱等聯系賣家表格加服務說明 3.) copy /var/www/html/catalog/controller/account/return.php -> product/enquiry.php //復制參考 return 函數 add 收到 post 聯系賣家資料判斷是否完整返回錯誤信息 //上傳資料完整調用函數 model_account_customer->addEnquiry 寫入 SQL 4.) copy /var/www/html/catalog/view/theme/default/template/account/return_form.twig -> product/seller_form.twig //復制參考 return_form 格式顯示可選聯系賣家表格或服務說明 //初始化顯示返回的錯誤信息或成功信息 5.) oc_customer_ext_msg //新增客戶詢問表 oc_customer_ext_msg -> msg_id, customer_id, firstname, email, ip, product_id, option_list, enquiry, date_added 6.) joe /var/www/html/catalog/model/account/customer.php //新增函數 addEnquiry 寫入 oc_customer_ext_msg $this->db->query("INSERT INTO " . DB_PREFIX . "customer_ext_msg SET customer_id = '" . (int)$data['enquiry_customer_id'] . "', firstname = '" . $this->db->escape($data['firstname']) . "', email = '" . $this->db->escape($data['email']) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "',product_id = '" . (int)$data['enquiry_product_id'] . "', option_list = '" . $this->db->escape($data['enquiry_option_list']) . "', enquiry = '" . $this->db->escape($data['enquiry']) . "', date_added = NOW()"); --- 20210419 opencart-3.0.3.6 聯系賣家 ========================================================================================================================= 後台->Extension->Payment->Paypal_express->checkout->Disable In-Context Checkout->Yes(否則會彈窗要再點 Try-Again 才OK) --- 20210416 aws-sd opencart paypal express 彈窗登入失敗問題 ========================================================================================================================= --- 20210414-15 aws-sd opencart + oc_work 移至台北 oc ko ========================================================================================================================= oc_product_ext_tag -> product_id, tag_hobby, tag_function, date_added oc_product_ext_tag_index -> tag_id, tag_value, tag_type, tag_from, date_added oc_customer_ext -> customer_id, tag_category, tag_hobby, tag_function, date_added tag_category -> {"118":5,"95":3.....} tag_function -> {"10001":4,"10003":2.....} tag_hobby -> {"50001":3,"50003":1.....} 1.) joe /var/www/html/catalog/model/catalog/product.php //新增函數 getRelateProducts 1-1.) 先以最後瀏覽產品的完整 tag_function 查找有相同 tag_function 的產品 1-2.) 以 tag_function 第一個查找有該 tag_function 的產品 1-3.) 如果沒有 tag_function 改以同分類產品替代 //修改函數 getMayLikeProducts 1-4.) 加總客戶 tag_hobby*1 + tag_function*1 + tag_category*1 為分母 1-5.) 按 hobby->function->category 順序取該類 tag 逐一取 tag 值除以分母乘上 limit 的個數存入 array 後打亂 2.) joe /var/www/html/catalog/model/account/customer.php //新增新客戶 INSERT INTO oc_customer_ext 3.) joe /var/www/html/dv/dv-7-2.php //查找 tag_function LIKE %tag_value% 的產品, ' mash ' -> '#mash#' //tag_id -> tag_function: 10001-499999 , tag_hobby: 50001-999999 //oc_product_ext_tag 預設 2 個 deafult 10000, 50000 //oc_product_ext_tag_index 不同條件可共用 tag_id UPDATE oc_product_ext_tag pet LEFT JOIN oc_product_description pd ON pet.product_id=pd.product_id SET pet.tag_function=CONCAT(pet.tag_function,'10001,') WHERE pet.tag_function NOT LIKE '10001' AND name LIKE '% watch %'; UPDATE oc_product_ext_tag pet LEFT JOIN oc_product_description pd ON pet.product_id=pd.product_id SET pet.tag_hobby=CONCAT(pet.tag_hobby,'50001,') WHERE pet.tag_hobby NOT LIKE '50001' AND name LIKE '%Trump %'; UPDATE oc_product_ext_tag SET tag_function=REPLACE (tag_function,'10001,',''); UPDATE oc_product_ext_tag SET tag_hobby=REPLACE (tag_hobby,'50001,',''); --- 20210414 opencart-3.0.3.6 新增 product customer tag ========================================================================================================================= 1.) apt-get install sysstat joe /etc/default/sysstat -> ENABLED="true" joe /etc/cron.d/sysstat -> 5-55/1 * * * * root pidstat 10 1 >> /var/www/html/dv/pidstat.log //監測發現 kswapd0 占用大量 CPU 導致卡死 2.) joe /etc/sysctl.conf cat /proc/sys/vm/swappiness -> 60 //將系統 swap 頻率調低 60 -> 10 echo vm.swappiness=0 | sudo tee -a /etc/sysctl.conf -> vm.swappiness=10 reboot --- 20210411 aws-sd 解決系統不定時自動卡死問題 ========================================================================================================================= 1.) joe /var/www/html/dv/dv-1.php -> //$tmpimg.='https://img.wg-1.com/image/'; $tmpimg='https://img.wg-1.com/image/'.$tmpimg; 2.) img src=" catalog/cn/210408/pdd211319468970/010.jpg https://img.wg-1.com/image/ -> img src=" https://img.wg-1.com/image/ catalog/cn/210408/pdd211319468970/010.jpg UPDATE oc_product_description SET description=REPLACE (description,'.jpghttps://img.wg-1.com/image/','.jpg'); UPDATE oc_product_description SET description=REPLACE (description,'.pnghttps://img.wg-1.com/image/','.png'); UPDATE oc_product_description SET description=REPLACE (description,'img src=\"catalog/cn/', 'img src=\"https://img.wg-1.com/image/catalog/cn/'); 3.) 一次手工全部修改評論中 google 不翻譯的表情符號 608 個評論 UPDATE oc_review SET text=REPLACE (text,'[大爱]','[great love]'); UPDATE oc_review SET text=REPLACE (text,'[笑]','[smile]'); 4.) "weight":{"188028-188029":0,"188030-188029":0,"188031-188029":0,"188032-188029":0},"image":{" //一次修改 20210408 上傳 15820-16942 共 1085 筆產品重量 0 -> -0.1 (太複雜不估重) UPDATE oc_product SET weight=-0.1 WHERE product_id>=15820 AND product_id<=16942 AND weight=0 UPDATE oc_product_ext SET option_ext=REPLACE (option_ext,'\":0},\"image\":{\"','\":-0.1},\"image\":{\"') WHERE product_id>=15820 AND product_id<=16942 AND option_ext LIKE '%\":0},\"image\":{\"%' UPDATE oc_product_ext SET option_ext=REPLACE (option_ext,'\":0,\"','\":-0.1,\"') WHERE product_id>=15820 AND product_id<=16942 AND option_ext LIKE '%\":0,\"%' --- 20210409-10 opencart-3.0.3.6 修改產品說明圖片 url 前後對調 + 不估重 + 評論未翻譯表情符號 ========================================================================================================================= apt-get install tesseract-ocr -> tesseract-ocr is already the newest version (4.1.1-2build2). joe /usr/share/tesseract-ocr/4.00/tessdata chi_sim.traineddata -> chi_sim_vert.traineddata tesseract --list-langs tesseract 000.jpg 000 -l chi_sim --- 20210409 tesseract-OCR 失敗卡死系統 ========================================================================================================================= 0.) db->oc_order_status -> item_status >= 110 -> in_depot 100 -> Unpaid, 101 -> Will ship to Depot, 105 -> Shipped to Depot, 110 -> Arrived in Depot 1.) db->oc_depot_ext //新增 depot_ext 表記錄重量,照片 json ,更新時間, 照片路徑 image/depot/210407/27(depot_id)/ 名稱 20210407182831.jpg {"0":"image/depot/210407/27/20210407182920.jpg","1":"image/depot/210407/27/20210407182831.jpg","2":"image/depot/210407/27/20210406131811.jpg"} 2.) joe /var/www/html/system/library/cart/cart.php -> //函數 getDepotitems 新增讀取 depot_ext 表資料傳參重量,照片 json 給 controller $query3 = $this->db->query("SELECT * FROM " . DB_PREFIX . "depot_ext WHERE depot_id = '" . (int)$cart['depot_id'] . "'"); 3.) joe /var/www/html/catalog/controller/checkout/cart.php -> //新增直接傳參重量,照片 json 給 templat 'depot_image' => $depotitem['depot_image'], 4.) joe /var/www/html/catalog/view/theme/default/template/checkout/tabcart.twig -> //新增逐一 in_depot item 顯示 photo-icon 的 td + span {% if depotitem.in_depot %}{% endif %} //新增逐一 in_depot item 產生對應放置 popup 的 div {% for depotitem in depotitems %} {% if depotitem.depot_image %} {% endif %} {% endfor %} //新增逐一 photo-icon 綁定對應的 magnificPopup $('.thumbnails').each(function(){ ... $("#btn-" + $(this).attr('id')).click(function() { $("#" + $(this).attr('id').substr(4)).magnificPopup('open'); --- 20210407 opencart-3.0.3.6 新增 checkout depot 照片查看 ========================================================================================================================= 1.) JSON.stringify(a) //轉雙引號 " -> \" 不轉單引號,反斜,斜 2.) JSON.parse(s) //單反斜無效 反解單反斜加單號 \' 雙反斜加雙反斜,雙引號 \\\\ \\" 3.) json_decode($s,true) //單反斜,Tab錯誤 反解反斜加反斜,單,雙引號 \\ \' \" 4.) json_encode($a,JSON_UNESCAPED_UNICODE) //加 JSON_UNESCAPED_UNICODE 保留中文不轉 //轉斜,反斜,單,雙引號,Tab \/ // /' /" /t 反解反斜加反斜,單引號 \\ \' 不反解反斜加斜,雙引號 \/ \" 5.) $db->escape($s) //mysqli->connection->real_escape_string //轉反斜,單,雙引號 // /' /" 不轉斜,Tab 6.) joe /var/www/html/dv-1.php -> //第一次產生資料不用 json_encode 直接將 string 存入 db 前轉反斜,Tab 否則 json_decode 會錯誤 str_replace(["\\","\t"],["\\\\"," "],$s); 7.) joe /var/www/html/dv-2.php -> //翻譯後是 array 需逃脫中文,斜線轉義的 json_encode 才能更新 db ,因為 json_encode 轉義斜線, json_decode 不解斜線 json_encode($a,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); --- 20210404 SQL json 特殊字符處理轉義 ========================================================================================================================= 1.) joe /etc/mysql/mysql.conf.d/mysqld.cnf //修改 sort buffer -> sort_buffer_size = 256000000 //新增 slow log slow_query_log = 1 slow_query_log_file = /var/log/mysql/mysql-slow.log long_query_time = 2 log-queries-not-using-indexes // error log log_error = /var/log/mysql/error.log /var/log/mysql/mysql-slow.log /var/log/syslog -> 系統 //重啟 mysql systemctl restart mysql systemctl restart apache2 2.) DELETE oc_product_ext.* FROM oc_product_ext LEFT JOIN oc_product ON oc_product_ext.product_id=oc_product.product_id WHERE sku IS NULL //刪除左表必須加 左表.* 3.) mysqldump -u root -p oc_work > oc_work-20210406.sql + Frevres88! //資料在 /var/lib/mysql -> mysqldump 備份 db->oc_work 4.) mysql -u root -p oc_work < oc_work-20210406.sql + revres88 //將備份 sql 還原 --- 20210402 mysql 設置 ========================================================================================================================= 啟用新域名 www.willgetone.com 1.) cp html html-20210331-oc-wg1 //複制整個目錄 2.) 申請 www.willgetone.com SSL 證書上傳至相對位置 3.) /etc/apache2/www.willgetone.conf -> ServerName www.willgetone.com DocumentRoot /var/www/html //新增 apache2 虛擬主機設定文件 cp /etc/apache2/sites-available/cn.wg1.conf /etc/apache2/sites-available/www.willgetone.conf ln -s /etc/apache2/sites-available/www.willgetone.conf /etc/apache2/sites-enabled/www.willgetone.conf 4.) joe /etc/apache2/sites-available/www.willgetone.ssl.conf -> DocumentRoot /var/www/html ServerName www.willgetone.com SSLCertificateFile /etc/ssl/certs/www.willgetone.com.crt SSLCertificateKeyFile /etc/ssl/private/www.willgetone.com_key.key //新增 apache2 SSL 設定文件 cp /etc/apache2/sites-available/cn.wg1.ssl.conf /etc/apache2/sites-available/www.willgetone.com.crt ln -s /etc/apache2/sites-available/www.willgetone.ssl.conf /etc/apache2/sites-enabled/www.willgetone.ssl.conf apachectl configtest a2enmod ssl systemctl restart apache2 5.) joe /var/www/html/config.php //修改所有相關路徑 oc.wg-1.com -> www.willgetone.com HTTP_SERVER, HTTPS_SERVER 6.) joe /var/www/html/admin/config.php //修改所有相關路徑 oc.wg-1.com -> www.willgetone.com HTTP_SERVER, HTTPS_SERVER 7.) joe /var/www/html/catalog/model/localisation/language.php //新增判斷非 cn.wg-1.com 的訪問排除中文語言選項 if(substr($_SERVER['SERVER_NAME'],0,11)!='cn.wg-1.com'){ $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "language WHERE code<>'zh-cn' AND status = '1' ORDER BY sort_order, name"); 8.) joe /var/www/html/catalog/controller/common/header.php //判斷傳參是否來源為 cn.wg-1.com 的訪問 $data['cnurl'] = substr($_SERVER['SERVER_NAME'],0,2)=='cn'; 9.) joe /var/www/html/catalog/view/theme/default/template/common/header.twig (/var/www/storage/modification/catalog/view/theme/default/template/common/header.twig) 已全刪 modification upload module //修改 header 的電話為中文 editer 入口 {% if cnurl %}
  • {% endif %} --- 20210401 啟用新域名 www.willgetone.com ========================================================================================================================= 修改 product option 資料結構 1.) oc_product -> option_value -> //以 json 格式存放 product_option_id + 中英文名稱和 product_option_value_id + 中英文名稱 {"en":{ "2276":{"name":"Color Classification","value":{"16563":"Khaki","16572":"Pink","16573":"purple","16574":"green","16575":"blue"}}, "2277":{"name":"size","value":{"16564":"S","16565":"M","16566":"L","16567":"XL","16568":"2XL","16569":"3XL","16570":"4XL","16571":"5XL"}}}, "cn":{ "2276":{"name":"颜色分类","value":{"16563":"卡其色","16572":"粉红色","16573":"紫色","16574":"绿色","16575":"蓝色"}}, "2277":{"name":"尺码","value":{"16564":"S","16565":"M","16566":"L","16567":"XL","16568":"2XL","16569":"3XL","16570":"4XL","16571":"5XL"}}}} 2.) oc_product -> option_ext -> //以 json 格式存放所有選項組合的 product_option_value_id + 價格-rmb + 重量-g + 圖片 (product_id=1699) {"price":{"16563-16564":10.83,"16563-16565":10.83,"16563-16566":10.83,"16563-16567":10.83,"16563-16568":10.83,"16563-16569":10.83,"16563-16570":10.83,"16563-16571":10.83,"16572-16564":10.83,"16572-16565":10.83,"16572-16566":10.83,"16572-16567":10.83,"16572-16568":10.83,"16572-16569":10.83,"16572-16570":10.83,"16572-16571":10.83,"16573-16564":10.83,"16573-16565":10.83,"16573-16566":10.83,"16573-16567":10.83,"16573-16568":10.83,"16573-16569":10.83,"16573-16570":10.83,"16573-16571":10.83,"16574-16564":10.83,"16574-16565":10.83,"16574-16566":10.83,"16574-16567":10.83,"16574-16568":10.83,"16574-16569":10.83,"16574-16570":10.83,"16574-16571":10.83,"16575-16564":10.83,"16575-16565":10.83,"16575-16566":10.83,"16575-16567":10.83,"16575-16568":10.83,"16575-16569":10.83,"16575-16570":10.83,"16575-16571":10.83}, "weight":{"16563-16564":280,"16563-16565":280,"16563-16566":280,"16563-16567":280,"16563-16568":280,"16563-16569":280,"16563-16570":280,"16563-16571":280,"16572-16564":280,"16572-16565":280,"16572-16566":280,"16572-16567":280,"16572-16568":280,"16572-16569":280,"16572-16570":280,"16572-16571":280,"16573-16564":280,"16573-16565":280,"16573-16566":280,"16573-16567":280,"16573-16568":280,"16573-16569":280,"16573-16570":280,"16573-16571":280,"16574-16564":280,"16574-16565":280,"16574-16566":280,"16574-16567":280,"16574-16568":280,"16574-16569":280,"16574-16570":280,"16574-16571":280,"16575-16564":280,"16575-16565":280,"16575-16566":280,"16575-16567":280,"16575-16568":280,"16575-16569":280,"16575-16570":280,"16575-16571":280}, "image":{"16563-16564":"https://img.wg-1.com/image/catalog/cn/210322/pdd10895270608/012.jpg","16563-16565":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg","16563-16566":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg","16563-16567":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg","16563-16568":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg","16563-16569":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg","16563-16570":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg","16563-16571":"https://t00img.yangkeduo.com/goods/images/2019-06-01/83cabaee-81b4-43f2-a09a-012acc20b04b.jpg", "16572-16564":"https://img.wg-1.com/image/catalog/cn/210322/pdd10895270608/013.jpg","16572-16565":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16572-16566":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16572-16567":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16572-16568":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16572-16569":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16572-16570":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16572-16571":"https://t00img.yangkeduo.com/goods/images/2019-06-01/5427d6f4-b2fa-41fd-94a5-6d61f0541949.jpg","16573-16564":"https://img.wg-1.com/image/catalog/cn/210322/pdd10895270608/014.jpg","16573-16565":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg","16573-16566":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg","16573-16567":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg","16573-16568":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg","16573-16569":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg","16573-16570":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg","16573-16571":"https://t00img.yangkeduo.com/goods/images/2019-06-01/ea38e220-adcb-4feb-848e-bcfc26eee81a.jpg", "16574-16564":"https://img.wg-1.com/image/catalog/cn/210322/pdd10895270608/015.jpg","16574-16565":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16574-16566":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16574-16567":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16574-16568":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16574-16569":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16574-16570":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16574-16571":"https://t00img.yangkeduo.com/goods/images/2019-06-01/0ebab6e1-87e7-4556-9d92-f1f43724c64e.jpg","16575-16564":"https://img.wg-1.com/image/catalog/cn/210322/pdd10895270608/016.jpg","16575-16565":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg","16575-16566":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg","16575-16567":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg","16575-16568":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg","16575-16569":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg","16575-16570":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg","16575-16571":"https://t00img.yangkeduo.com/goods/images/2019-06-01/480fa453-0a5e-4d2d-a435-5409691f6968.jpg"}} 3.) joe /var/www/html/catalog/model/catalog/product.php //將產生 price, weight, image json 的程式從 getProduct 中移出單獨為一函數,以免拖垮其他不含 option 的調用 //新增函數 getProductExt($product_id) 讀取 oc_product_ext 的所有 option 相關資料傳參給原調用函數 getProductOptions 的 controller 使用 public function getProductExt($product_id) { //新增函數 getProductOptionsRequired($product_id) 讀取 oc_product_ext 的 product_option_id 傳參給原調用函數 getProductOptions 的 cart.php 檢查 required 使用 public function getProductOptionsRequired($product_id) { 4.) joe /var/www/html/catalog/controller/product/product.php -> //修改調用函數 getProductOptions -> getProductExt $product_info_ext = $this->model_catalog_product->getProductExt($product_id); ... //foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { foreach ($product_info_ext['product_option_data'] as $option) { 5.) joe /var/www/html/catalog/controller/checkout/cart.php -> //修改調用函數 getProductOptions -> getProductOptionsRequired //$product_options = $this->model_catalog_product->getProductOptions($this->request->post['product_id']); $product_options = $this->model_catalog_product->getProductOptionsRequired($this->request->post['product_id']); 6.) joe /var/www/html/dv/dv-1-2.php //新增全面轉換原 product_option, option_description, product_option_value, option_value_description, product_option_ext -> oc_product_ext 7.) oc_product_ext_setting {"product_option_id":10673,"product_option_value_id":62944} 8.) joe /var/www/html/dv/dv-1.php, dv-2.php //廢用原 option 多層連結結構改用 oc_product_ext 單純 option_value + option_ext json 結構 9.) /var/www/html/admin/model/catalog/product.php, /var/www/html/admin/controller/catalog/product.php //後台未改 option 相關功能不可用 /var/www/html/library/cart/cart.php -> getDepotitems --- 20210330 opencart-3.0.3.6 修改 product option 資料結構 ========================================================================================================================= 新增瀏覽記錄模塊 recentview 1.) cp /var/www/html/admin/controller/extension/module/onedollar.php -> recentview.php //複制後台 extension controller + 改 class name(必需要和php名相同) + 改所有變數 onedollar -> recentview $this->response->setOutput($this->load->view('extension/module/bestseller', $data)); //保留不修改共用 bestseller template 不用新增 template 2.) cp /var/www/html/admin/language/en-gb/extension/module/onedollar.php -> recentview.php //複制後台語言包 + 改所有常數 onedollar -> recentview(否則後台不會出現 recentview 的名稱) 3.) cp /var/www/html/catalog/controller/extension/module/onedollar.php -> recentview.php //複制前台 extension model + 改 class name(必需要和php名相同) + 改所有變數 onedollar -> recentview //保留不修改共用 product_list template 不用新增 template //修改為調用函數 getRecentViewProducts 取得產品 $results = $this->model_catalog_product->getRecentViewProducts($setting['limit']); 4.) Extensions->Extensions->Modules->recentview->install + Add New + enable //後台先安裝 extension -> 安裝後 db->oc_extension 自動產生 modules recentview -> 再 Add New + enable 5.) joe /var/www/html/catalog/model/catalog/product.php -> //新增函數讀取 oc_customer_view 資料並返回產品基本資料 public function getRecentViewProducts($limit, $page=1) { --- 20210401 opencart-3.0.3.6 新增瀏覽記錄模塊 recentview ========================================================================================================================= 新增 extension module onedollar 模塊 1.) cp /var/www/html/admin/controller/extension/module/bestseller.php -> onedollar.php //複制後台 extension controller + 改 class name(必需要和php名相同) + 改所有變數 bestseller -> onedollar $this->response->setOutput($this->load->view('extension/module/bestseller', $data)); //保留不修改共用 bestseller template 不用新增 template 2.) cp /var/www/html/admin/language/en-gb/extension/module/bestseller.php -> onedollar.php //複制後台語言包 + 改所有常數 bestseller -> onedollar(否則後台不會出現 onedollar 的名稱) 3.) cp /var/www/html/catalog/controlle/extension/module/bestseller.php -> onedollar.php //複制前台 extension model + 改 class name(必需要和php名相同) + 改所有變數 bestseller -> onedollar //修改為共用 product_list template 不用另外新增 template //新增函數修改原調用 banner list 為直接調用函數 getOneDollarProducts 取得產品 //$results = $this->model_design_banner->getBanner($setting['banner_id']); $results = $this->model_catalog_product->getOneDollarProducts($setting['limit']); 4.) cp /var/www/html/catalog/view/theme/default/template/extension/module/bestseller.twig -> product_list.twig //新增共用 product_list template 提供給原 bestseller, latest 和後續的首頁模塊共用 //修改 title 為共用 + See All + href

    {{ product_list_title }}{{ see_all_tag }}

    5.) Extensions->Extensions->Modules->onedollar->install + Add New + enable //後台先安裝 extension -> 安裝後 db->oc_extension 自動產生 modules onedollar -> 再 Add New + enable 6.) joe /var/www/html/catalog/model/catalog/product.php -> //新增函數讀取 oc_product 資料並返回產品基本資料 public function getOndollarProducts($limit, $page=1) { --- 20210329 opencart-3.0.3.6 首頁新增一元特區 ========================================================================================================================= oc_setting -> key -> config_logo -> value //直接放在 https://oc.wg-1.com/image/wg1-logo.jpg --- 20210329 opencart-3.0.3.6 商店 LOGO ========================================================================================================================= 1.) db->customer-view 2.) joe /var/www/html/catalog/model/catalog/product.php -> //新增寫入 customer-view public function updateViewed($product_id) { ... $customer_id=(isset($this->session->data['customer_id']) ? $this->session->data['customer_id'] : 0); $this->db->query("INSERT INTO " . DB_PREFIX . "customer_view SET customer_id = '" . (int)$customer_id . "', product_id = '" . (int)$product_id . "', date_added = NOW()"); --- 20210329 opencart-3.0.3.6 log customer view ========================================================================================================================= 新增中文站 cn.wg-1.com 1.) cp html html-cn //複制整個目錄不包括 image/catalog/cn/ 下的圖片 2.) joe /etc/apache2/cn.wg1.conf -> ServerName cn.wg-1.com DocumentRoot /var/www/html-cn //新增 apache2 虛擬主機設定文件 cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/cn.wg1.conf ln -s /etc/apache2/sites-available/cn.wg1.conf /etc/apache2/sites-enabled/cn.wg1.conf 3.) 申請 cn.wg-1.com SSL 證書上傳至相對位置 4.) joe /etc/apache2/sites-available/cn.wg1.ssl.conf -> DocumentRoot /var/www/html-cn ServerName cn.wg-1.com SSLCertificateFile /etc/ssl/certs/cn.wg-1.com.crt SSLCertificateKeyFile /etc/ssl/private/cn.wg-1.com_key.key //新增 apache2 SSL 設定文件 cp /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/cn.wg1.ssl.conf ln -s /etc/apache2/sites-available/cn.wg1.ssl.conf /etc/apache2/sites-enabled/cn.wg1.ssl.conf apachectl configtest a2enmod ssl systemctl restart apache2 5.) joe /var/www/html-cn/config.php //修改所有相關路徑 oc -> cn HTTP_SERVER, HTTPS_SERVER, DIR_APPLICATION, DIR_SYSTEM, DIR_IMAGE 6.) joe /var/www/html/catalog/model/localisation/language.php //新增判斷非 cn.wg-1.com 的訪問排除中文語言選項 if(substr($_SERVER['SERVER_NAME'],0,2)!='cn'){ $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "language WHERE code<>'zh-cn' AND status = '1' ORDER BY sort_order, name"); 7.) joe /var/www/html/catalog/controller/common/header.php //判斷傳參是否來源為 cn.wg-1.com 的訪問 $data['cnurl'] = substr($_SERVER['SERVER_NAME'],0,2)=='cn'; 8.) joe /var/www/html/catalog/view/theme/default/template/common/header.twig (/var/www/storage/modification/catalog/view/theme/default/template/common/header.twig)已全刪 upload module //修改 header 的電話為中文 editer 入口 {% if cnurl %}
  • {% endif %} --- 20210327 新增中文站 cn.wg-1.com ========================================================================================================================= 產品頁主圖改 slideshow 手機屏可滑 新增 extension module slidethumb 模塊 1.) cp /var/www/html/admin/controller/extension/module/slideshow.php -> slidethumb.php //複制後台 extension controller + 改 class name(必需要和php名相同) + 改所有變數 slideshow -> slidethumb $this->response->setOutput($this->load->view('extension/module/slideshow', $data)); //保留不修改共用 slideshow template 不用新增 template 2.) cp /var/www/html/admin/language/en-gb/extension/module/slideshow.php -> slidethumb.php //複制後台語言包 + 改所有常數 slideshow -> slidethumb(否則後台不會出現 slidethumb 的名稱) 3.) cp /var/www/html/catalog/controller/extension/module/slideshow.php -> slidethumb.php //複制前台 extension model + 改 class name(必需要和php名相同) + 改所有變數 slideshow -> slidethumb //修改原調用 banner list 為自行從 db 取得 main image + thumb list -> //$results = $this->model_design_banner->getBanner($setting['banner_id']); $tmpq = $this->db->query("SELECT * FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product_id . "'"); ... $tmpq = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "'"); 4.) cp /var/www/html/catalog/view/theme/default/template/extension/module/slideshow.twig -> slidethumb.twig //複制後台 extension template + 改所有變數 slideshow -> slidethumb //修改關閉小點+自動播放 pagination: false, autoplay: 0 5.) Extensions->Extensions->Modules->slidethumb->install + Add New + enable //後台先安裝 extension -> 安裝後 db->oc_extension 自動產生 modules slidethumb -> 再 Add New + enable 6.) Design->Layouts->Product->Content Top->Add Module->Slidethumb SlideThumb //後台修改產品頁增加 slidethumb module 在產品頁上半部 7.) joe /var/www/html/catalog/view/theme/default/template/product/product.twig //修改正常屏不出現 slidethumb, 手機屏隱藏主圖+縮略圖出現 slidethumb .swiper-viewport { display: none; } @media (max-width: 518px) { .thumbhide { display: none; } .swiper-viewport { display: block; } } //修改 slidethumb 的 magnificPopup 為 gallery 模式 $('.thumbnails,.swiper-viewport').magnificPopup({ 8.) joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig //刪除導入 content_top, content_bottom --- 20210326 opencart-3.0.3.6 產品頁主圖改 slideshow 手機屏可滑 ========================================================================================================================= 0.) img.wg-1.com 啟用 SSL 1.) joe tp-1-1.php //開始改 crx 直接調用采集圖片 2.) https://oc.wg-1.com/image/catalog/cn/pdd30655919420/210316014.jpg-> http://img.wg-1.com/image/catalog/cn/210316/pdd30655919420/014.jpg //將原 aws image 全部搬遷到 tp ko /home/httpd/www/html-wg1 (20210323) find /home/httpd/www/html-wg1/ -type f -print | wc -l -> 72906 du /home/httpd/www/html-wg1/ -sh -> 6.8G (20210410) find /home/httpd/www/html-wg1/image -type f -print | wc -l -> 586833 du /home/httpd/www/html-wg1/image -sh -> 58G find /home/httpd/www/html-wg1/image-20210406 -type f -print | wc -l -> 350616 du /home/httpd/www/html-wg1/image-20210406 -sh -> 35G (20210418) du /var/www/html-wg1/ -sh -> 109G find /var/www/html-wg1/image -type f -print | wc -l -> 746278 3.) oc_product, oc_image, oc_product_description, oc_product_option_ext //轉換原 db image path 相關的所有資料表的 image 格式 pdd+source-id/tmk(ymd)+000.jpg -> tmk(ymd)/pdd+source-id/000.jpg 4.) joe /var/www/html/config.php -> define('IMAGE_SERVER', 'https://img.wg-1.com/'); 5.) joe /var/www/html/admin/config.php -> define('IMAGE_SERVER', 'https://img.wg-1.com/'); 6.) jeo /var/www/html/catalog/model/tool/image.php -> //取消 resize 所有動作直接返回原圖 public function resize($filename, $width, $height) { return IMAGE_SERVER . 'image/' . $filename; 7.) joe /var/www/html/catalog/model/catalog/product.php -> //修改 config_ssl 為 IMAGE_SERVER $option_list_image.='"'.$tmpret['option_list'].'":"'.(substr($tmpret['image'],0,4)!="http" ? IMAGE_SERVER.'image/' : "").$tmpret['image'].'",'; 8.) joe /var/www/html/catalog/view/theme/default/template/product/category.twig (/var/www/storage/modification/catalog/view/theme/default/template/product/category.twig) //修改 thumb image css 大小符合外框 .img-responsive { width: 100%; height: 100%; } admin-1.) jeo /var/www/html/admin/model/tool/image.php -> //取消 resize 所有動作直接返回原圖 public function resize($filename, $width, $height) { return IMAGE_SERVER . 'image/' . $filename; admin-2.) jeo /var/www/html/admin/controller/catalog/product.php -> //取消判斷是否圖片存在一律取圖 //if (is_file(DIR_IMAGE . $result['image'])) { $image = $this->model_tool_image->resize($result['image'], 40, 40); --- 20210323 啟用台北 image KO ========================================================================================================================= ubuntu@ip-172-31-16-154:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/root 30G 9.3G 20G 32% / devtmpfs 486M 0 486M 0% /dev tmpfs 490M 0 490M 0% /dev/shm tmpfs 98M 832K 98M 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 490M 0 490M 0% /sys/fs/cgroup /dev/loop0 33M 33M 0 100% /snap/amazon-ssm-agent/2996 /dev/loop1 34M 34M 0 100% /snap/amazon-ssm-agent/3552 /dev/loop2 100M 100M 0 100% /snap/core/10859 /dev/loop4 56M 56M 0 100% /snap/core18/1944 /dev/loop5 56M 56M 0 100% /snap/core18/1988 /dev/loop6 70M 70M 0 100% /snap/lxd/19188 /dev/loop7 71M 71M 0 100% /snap/lxd/19647 /dev/loop8 100M 100M 0 100% /snap/core/10908 tmpfs 98M 0 98M 0% /run/user/1000 20210322 17:30 SSH 突然斷連不上 19:00 出現 login 但仍連不上 20210323 08:59 reboot ========================================================================================================================= oc_work -> 141 张表(dv 新增 oc_product_ext, oc_product_option_ext, oc_product_source, oc_product_source_image) 15.8 MB 1,424 oc_option 2,848 oc_option_description 12,420 oc_option_value 24,840 oc_option_value_description 1,397 oc_product 2,482 oc_product_description 1,372 oc_product_ext 9,885 oc_product_image 1,436 oc_product_option 21,245 oc_product_option_ext 12,449 oc_product_option_value 1,702 oc_product_source 1,286 oc_product_to_category 1,241 oc_product_to_store 1,869 oc_review 41,008 find /var/www/html/image/catalog/cn/ -type f -print | wc -l 1,406 find /var/www/html/image/catalog/cn/ -type d -print | wc -l 1,153 find /var/www/html/dv/ -type f -print | wc -l du -h --max-depth=1 現在目錄大小 df -h 全部大小 --- 20210322 opencart-3.0.3.6 資料數量統計 ========================================================================================================================= 1.) joe /var/www/html/catalog/controller/product/vategory.php -> //父目錄顯示所有子目錄產品 $filter_data = array( ... 'filter_sub_category' => true, 2.) joe /var/www/html/catalog/view/theme/default/template/common/menu.twig -> //導航欄顯示所有產品移到第一行