Ebay.com (co.uk, co.de, co.fr etc)
Amazon.com (co.uk, co.de, co.fr etc)
Walmart.com
Etsy.com
Aliexpress.com
Flipkart.com
Sunsky-online.com->3C
Focalprice.com->快倒了
banggood.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
newchic.com
Storenvy.com
iOffer.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
UPDATE oc_product_ext SET option_value=REPLACE (option_value,'colour','color');
UPDATE oc_order_option SET name=REPLACE (name,'..','');
=========================================================================================================================
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,
guideConfig: {waitTime: 20000, presentTime: 5000}
AUTODESK ID 551248400 密碼 frevres0907
114.34.53.65:3366 帳: dv4ml 密: frevres0907 你原本的
114.34.53.65:16124 帳: cn124 密: 124!cn 另一台遠桌
Hey friends! I would like to send you a Banggood new user gift package. I have found a lot of items with low cost and high quality in Banggood, I believe you can also enjoy shopping here. Come on! Join us to get your gifts!
https://banggood.app.link/Xl5wSjzGLhb
Hey friends! I would like to send you a Banggood new user gift package. I have found a lot of items with low cost and high quality in Banggood, I believe you can also enjoy shopping here. Come on! Join us to get your gifts!
magento2->customer_entity->email->363x(entity_id=9146~9604, created_at>2021-03-11~20210801)
=========================================================================================================================
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 -> 接收上傳depot照片資料 -> 接收 admin 上傳 depot item 狀態, 重量, 照片 url
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
dv-7-3.php -> 重建tag -> 清空 oc_product_ext_tag 後根據 oc_product_ext_tag_index 逐一產生 tag
(20210514) RMB rate 6 -> 5.7
--- 20210320~Now DV php 系列
=========================================================================================================================
0.) //新增 SQL 欄位
oc_product_ext_setting->code:free_gift_price, free_gift_count
oc_product_ext->free_gift
oc_customer_ext->free_gift_count
oc_cart->free_gift
oc_depot->free_gift
0-1.) //新增 Free Gift 模塊
joe /var/www/html/admin/controller/extension/module/freegift.php
joe /var/www/html/admin/language/en-gb/extension/module/freegift.php
joe /var/www/html/catalog/controller/extension/module/freegift.php
Extensions->Extensions->Modules->freegift->install + Add New + enable
0-2.) //修改 home page + category Free Gift label + $0.00
joe /var/www/html/catalog/model/catalog/product.php
//新增函數讀取 oc_product_ext 資料並返回產品基本資料
->public function getFreeGiftProducts($limit, $page=1) {
joe /var/www/html/catalog/controller/extension/module/freegift.php
->'free_gift' => $result['free_gift'],
joe /var/www/html/catalog/view/theme/default/template/extension/module/product_list.twig
//判斷是否 free gift 展示 label + $0.00
-> {% if product.free_gift %}
{{ free_gift_title }}
joe /var/www/html/catalog/controller/product/category.php
->elseif($this->request->get['path']=='freegift'){
joe /var/www/html/catalog/view/theme/default/template/product/category.twig
-> {% if product.free_gift %}
{{ free_gift_title }}
1.) joe /var/www/html/catalog/controller/product/product.php
//指定入口
-> elseif($this->request->get['path']=='freegift'){
//指定客戶判斷餘量 -1:不顯示 >=0:顯示
$free_gift=($this->customer->getFreeGiftCount()>=0);
//指定產品
-> $free_gift = $free_gift && $product_info_ext['free_gift'];
2.) joe /var/www/html/system/library/cart/customer.php
//新增函數回傳客戶 free gift 餘量 guset:0
-> public function getFreeGiftCount() {
//新增函數回傳購物車中 free gift 數量
-> public function getCartFreeGiftCount() {
3.) joe /var/www/html/catalog/model/catalog/product.php
//判斷是否超 RMB 價格上限 -> 新增至 disable-options
-> if($query->row['free_gift'] && $tmparr['price'][$tmpk]>$free_gift_price && !in_array($tmpk, $disarr)){ $disarr[]=$tmpk;
4.) joe /var/www/html/catalog/view/theme/default/template/product/product.twig + popupop.twig
//判斷是否 free gift 展示 label + $0.00 + 100% Off
-> {% if free_gift %}
{{ free_gift_title }}
$0.00 {{ dtx_100_off }}
//新增上傳 hidden 資料 free gift
->
5.) joe /var/www/html/system/library/cart/cart.php
//修改2函數判斷是否 free gift -> 價格$0 + get free_gift
-> getProducts(){ ... 'price' => $query2->row['free_gift'] ? 0 : round($this->currency->convert($option_price, 'RMB', 'USD'), 2),
-> getDepotitems(){ ... 'price' => $query3->row['free_gift'] ? 0 : round($this->currency->convert($option_price, 'RMB', 'USD'), 2),
//修改函數 getSelectSubTotal 判斷是否 free gift -> total + 0
->$total += $product['free_gift'] ? 0 : $product['total'];
//修改函數 __construct 新增傳參 free gift
-> $this->add($cart['product_id'], $cart['quantity'], json_decode($cart['option']), $cart['recurring_id'], $cart['logistic_class'], $cart['free_gift']);
//修改函數 add 處理 SQL 新增 free gift 欄位
-> oc_cart SELECT, INSERT INTO, UPDATE
//修改函數 CartOrdertoDepot 更新 free gift 餘額
->$this->db->query("UPDATE " . DB_PREFIX . "customer_ext SET free_gift_count = (free_gift_count - " . (int)$free_gift_count . ") WHERE customer_id = '" . (int)$this->customer->getId() . "'");
6.) joe /var/www/html/catalog/controller/checkout/cart.php
//判斷 free gift 是否未 login -> error 報錯
//判斷 free gift 餘額(減已放入購物車)是否小於 Qty -> error 報錯
7.) joe /var/www/html/catalog/view/theme/default/template/cart/tabcart.twig
//判斷是否 free gift 展示 label
->{% if product.free_gift %}
->{% if depotitem.free_gift %}
8.)joe /var/www/html/catalog/view/theme/default/template/account/transaction.twig + /var/www/html/catalog/controller/account/transaction.php
//store credit -> store credit & free gift + 新增 free gift 餘額
9.)joe /var/www/html/catalog/controller/common/content_top.php
//新增 home page 判斷 free gift 餘量 >=0:顯示 list
->if($this->customer->getFreeGiftCount()>=0 || $part[0]!='freegift'){
10.) SELECT * FROM oc_product_ext pe INNER JOIN oc_product p ON pe.product_id=p.product_id WHERE 1
--- 20210628-0707 新增 Free Gift 功能
=========================================================================================================================
1.) /var/www/html/catalog/controller/checkout/depotcheckout.php
2.) /var/www/html/catalog/view/theme/default/template/checkout/depotcheckout.twig
//未登入者 ajax url: 'index.php?route=checkout/login' 下載登入或注冊入口但不處理 click
//已登入者進入 Step 2: Billing Details 選舊地址或填新地址
//-> 點 button-payment-address -> ajax url: 'index.php?route=checkout/payment_address/save' 上傳付款地址 -> ajax url: 'index.php?route=checkout/shipping_address'
//-> 下載進入 Step 3: Delivery Details 選舊地址或填新地址
//-> 點 button-shipping-address -> ajax url: 'index.php?route=checkout/shipping_address/save' 上傳收貨地址 -> ajax url: 'index.php?route=checkout/shipping_method'
//-> 下載進入 Step 4: Delivery Method 選物流方式
//-> 點 button-shipping-method -> ajax url: 'index.php?route=checkout/shipping_method/save' 上傳物流方式 -> ajax url: 'index.php?route=checkout/payment_method'
//-> 下載進入 Step 5: Payment Method 選付款方式和整張定單留言
//-> 點 button-payment-method -> ajax url: 'index.php?route=checkout/payment_method/save' 上傳付款方式 -> ajax url: 'index.php?route=checkout/confirm'
3.) /var/www/html/catalog/controller/checkout/confirm.php
//產生定單明細 status=0 $this->model_checkout_order->addOrder($order_data); 存入 db->order 所有相關表
//根據指定的付款方式調用對應的 controller $data['payment'] = $this->load->controller('extension/payment/' . $this->session->data['payment_method']['code']);
//-> 進入 Step 6: Confirm Order 列出定單明細可為單品留言 + 填信用卡資料或確認付款
//-> paypal 點 button-confirm -> ajax url: 'index.php?route=checkout/confirm/itemcomment' 上傳單品留言 -> window.location.href="https://www.willgetone.com/index.php?route=extension/payment/pp_express/checkout"
//-> 信用卡舊卡點 submit-vaulted -> ajax url: 'index.php?route=checkout/confirm/itemcomment' 上傳單品留言 -> $('#braintree-vaulted').submit()
//-> 信用卡新卡點 submit-new -> ajax url: 'index.php?route=checkout/confirm/itemcomment' 上傳單品留言 -> $('#braintree-new').submit()
//付款平台付款成功後修改定單狀態 $this->model_checkout_order->addOrderHistory($order_id, $order_status_id)
//catalog/model/checkout/order/addOrderHistory/before 觸發 oc_event 調用 mail/order 發通知 email
//-> 下載成功頁面 $this->response->redirect($this->url->link('checkout/success'))
4.) /var/www/html/catalog/controller/mail/order.php
public function index(&$route, &$args) { ... $this->add($order_info, $order_status_id, $comment, $notify);
// send cc $mail->setTo('dv4ml@ksoffice.com.tw'); //($order_info['email']); $mail->send();
5.) /var/www/html/catalog/controller/checkout/success.php
//cart checkout -> $this->cart->CartOrdertoDepot(); $this->cart->clear();
//depot checkout -> $this->cart->PaidDepotOrder();
--- 20210523 depot checkout 流程
=========================================================================================================================
According to IATA regulations, the logistics of this product is a special logistics
shipping_dv_yw01_sort_order = 101 -> special
shipping_dv_yw51
--- 20210521 opencart-3.0.3.6 新增特貨物流
=========================================================================================================================
/var/www/html/admin/view/javascript/common.js
/var/www/html/admin/controller/common/filemanager.php
/var/www/html/admin/view/tamplate/common/filemanager.twig
1.) joe /var/www/html/admin/view/tamplate/sale/order_info.twig
Image
$('#input-thumb-0-47').find('img').attr('src', $(this).find('img').attr('src'));
$('#input-image-0-47').val($(this).parent().find('input').val());
//上傳所有編輯資料
$.ajax({ url: 'https://www.willgetone.com/dv/dv-6.php',
data: $("select[id^='input-status'], input[id^='input-weight'], input[id^='input-image']"),
//發到庫通知信
$.ajax({ url: 'https://www.willgetone.com/index.php?route=mail/order/depotarrive&order_id=' + {{ order_id }},
2.) joe /var/www/html/controller/mail/order.php
//複製 function add -> depotarrive
3.) joe /var/www/html/view/theme/default/template/mail/depot_arrive.twig
//複製 order_add.twig -> depot_arrive.twig
--- 20210508 opencart-3.0.3.6 後台新增上傳編輯 depot item 狀態,重量,照片 + 發到庫通知信
=========================================================================================================================
修改同時匯入二種拼多多抓取的 rawData 格式 standard, null
store.initDataObj.goods.goodsID
goods.goods_id
store.initDataObj.goods.goodsName
goods.goods_name
store.initDataObj.goods.minGroupPrice
price.min_group_price (29.99 -> 2999)
// description
store.initDataObj.goods.goodsProperty[0].key
store.initDataObj.goods.goodsProperty[0].values[0]
goods.goods_property[0].key
goods.goods_property[0].values[0]
// 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~25
// 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
--- 20210502 修改同時匯入二種拼多多抓取的 rawData 格式 standard, null
=========================================================================================================================
PP 用 sc@dacomputing.com 付款, 密碼 18480ML5477ml
PP 後台 cutiepet.inc@gmail.com 密碼 $ML5477ml
Email : paypal@willgetone.com / cutiepet.inc@gmail.com
CC 用 4465 4203 9172 3483 03/24 MEI L CHEN 998
CC 後台 https://www.braintreegateway.com/merchants/xjw6bxr567wt8x5c/home
Cutiepet + ML5477ml
GMAIL 和 FB 帳密, koofficetw@gmail.com ; kkman1234
1.) joe /var/www/html/catalog/model/extension/payment/pp_express.php
//修改函數 paymentRequestInfo 根據 cart, depot mode 讀取定單資料
if($this->session->data['checkoutmode']=='cart') {$products=$this->cart->getSelectProducts();}
if($this->session->data['checkoutmode']=='depot') {$products=$this->cart->getSelectDepotItems();}
// foreach ($this->cart->getProducts() as $item) {
foreach ($products as $item) { ...
2.) joe /var/www/html/catalog/controller/checkout/success.php
//新增判斷 mode cart, depot 作對應的 SQL 更新
cart -> $this->cart->CartOrdertoDepot(); $this->cart->clear();
depot -> $this->cart->PaidDepotOrder();
3.) joe /var/www/html/system/library/cart/cart.php
//新增函數 PaidDepotOrder 更新 select depot 中的 item 為 will ship to you
--- 20210501 opencart-3.0.3.6 修改付款 pp_express 可以同時處理 select cart, select depot
=========================================================================================================================
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);
//(20210501) 修改錯誤函數 convertjintolb 將其他中文錯誤提前刪除或轉換顯示為英文
$tmpstr=str_replace('收藏', '', $tmpstr); $tmpstr=str_replace('关注', '', $tmpstr); $tmpstr=str_replace('勿拍', 'do not selete', $tmpstr);
//(20210610) 修改抖音
$tmpstr=str_replace('抖音', ' Tik Tok', $tmpstr);
//(20210619) 修改小号
$tmpstr=str_replace('小号', 'small', $tmpstr);
2.) joe /var/www/html/dv/dv-2-1.php
//重新列表已翻譯錯誤英文的 oc_product_description 再次重新翻譯 -> name 70x + description 6x
//重新列表已翻譯錯誤英文的 oc_product_ext 再次重新翻譯 -> option 1503x(斤) - 6x(公斤)
3.) 手工修改抖音 (20210610)
//oc_product_ext Douyin 74x, vibrato 26x, shaking 1x
UPDATE oc_product_ext SET option_value=REPLACE(option_value,'Douyin','Tik Tok') WHERE option_value LIKE '%抖音%' AND option_value LIKE '%Douyin%';
UPDATE oc_product_ext SET option_value=REPLACE(option_value,'vibrato','Tik Tok') WHERE option_value LIKE '%抖音%' AND option_value LIKE '%vibrato%';
UPDATE oc_product_ext SET option_value=REPLACE(option_value,'Vibrato','Tik Tok') WHERE option_value LIKE '%抖音%' AND option_value LIKE '%vibrato%';
UPDATE oc_product_ext SET option_value=REPLACE(option_value,'shaking','Tik Tok') WHERE option_value LIKE '%抖音%' AND option_value LIKE '%shaking%';
//oc_product_description Douyin 91x, vibrato 213+27x, shaking 8x
UPDATE oc_product_description en INNER JOIN oc_product_description_cn cn ON en.product_id=cn.product_id SET en.name=REPLACE(en.name,'Douyin','Tik Tok') WHERE cn.name LIKE '%抖音%'
UPDATE oc_product_description en INNER JOIN oc_product_description_cn cn ON en.product_id=cn.product_id SET en.name=REPLACE(en.name,'vibrato','Tik Tok') WHERE cn.name LIKE '%抖音%'
UPDATE oc_product_description en INNER JOIN oc_product_description_cn cn ON en.product_id=cn.product_id SET en.name=REPLACE(en.name,'shaking','Tik Tok') WHERE cn.name LIKE '%抖音%'
4.) 手工修改小号 (20210619)
UPDATE oc_product_ext SET option_value=REPLACE(option_value,'trumpet','small') WHERE option_value LIKE '%小号%' AND option_value LIKE '%trumpet%'; -> 144x
UPDATE oc_product_ext SET option_value=REPLACE(option_value,'Trumpet','small') WHERE option_value LIKE '%小号%' AND option_value LIKE '%trumpet%'; -> 103x
UPDATE oc_product_description en INNER JOIN oc_product_description_cn cn ON en.product_id=cn.product_id SET en.name=REPLACE(en.name,'trumpet','small') WHERE cn.name LIKE '%小号%' AND en.name LIKE '%trumpet%'; -> 15x
UPDATE oc_product_description en INNER JOIN oc_product_description_cn cn ON en.product_id=cn.product_id SET en.name=REPLACE(en.name,'Trumpet','small') WHERE cn.name LIKE '%小号%' AND en.name LIKE '%trumpet%'; -> 3x
--- 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 %}
//修改 modal 彈窗的 z-index 低於 magnific popup 高於 includeproduct.twig
/var/www/html/catalog/view/javascript/jquery/magnific/magnific-popup.css
.mfp-content {
...
z-index: 1045; }
/* The shadow behind the image */
.mfp-figure {
...
z-index: -1;
4.) /var/www/html/catalog/view/theme/default/template/product/product.twig
//popupop.twig 共用 Jquery 調用 magnific popup
-> $('.thumbnails').magnificPopup({
--- 20210201 opencart-3.0.3.6 研究 modal 彈窗 + magnific popup
=========================================================================================================================
{% include 'default/template/product/popupop.twig' ignore missing %}
{{ constant('Twig_Environment::VERSION') }}
2.13.0
->
cd /var/www/html/system/
wget 118.163.15.73/bpc/dv/modification.xml -N
->
$code));
]]> $code));
$loader2 = new \Twig\Loader\FilesystemLoader(array(DIR_TEMPLATE)); // to find further includes
$loader = new \Twig\Loader\ChainLoader(array($loader1, $loader2));
]]>
->Extensions->Modifications->Refresh
->default include path: DIR_TEMPLATE = "/var/www/html/catalog/view/theme/"
----------------------
(!!注意-> twig include 判斷日期如果沒有最新的就不會重加載)
--- 20210201 opencart-3.0.3.6 + twig 2.13.0 {% include %}無效錯誤 -> 修改 modification.xml
=========================================================================================================================
運費估算調用路徑
1.) catalog/controller/checkout/cart.php->
//找出所有/controller/extension/total/下的php
$this->load->model('setting/extension');
$data['modules'] = array();
$files = glob(DIR_APPLICATION . '/controller/extension/total/*.php');
if ($files) {
foreach ($files as $file) {
$result = $this->load->controller('extension/total/' . basename($file, '.php'));
if ($result) {
$data['modules'][] = $result;
}
}
}
2.) catalog/view/theme/default/template/checkout/cart.twig->
//列出所有total下enable的功能
{% for module in modules %}
{{ module }}
{% endfor %}
3.) catalog/controller/startup/startup.php->
//讀取db->oc_setting所有設定
// Settings
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "setting` WHERE store_id = '0' OR store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY store_id ASC");
foreach ($query->rows as $result) {
if (!$result['serialized']) {
$this->config->set($result['key'], $result['value']);
} else {
$this->config->set($result['key'], json_decode($result['value'], true));
}
}
4.) system/library/session/db.php->
//讀取db->oc_session->data->json_decode
public function read($session_id) {
$query = $this->db->query("SELECT `data` FROM `" . DB_PREFIX . "session` WHERE session_id = '" . $this->db->escape($session_id) . "' AND expire > " . (int)time());
if ($query->num_rows) {
return json_decode($query->row['data'], true);
5.) catalog/controller/extension/total/shipping.php->
//判斷本功能是否enable
class ControllerExtensionTotalShipping extends Controller {
public function index() {
if ($this->config->get('total_shipping_status') && $this->config->get('total_shipping_estimator') && $this->cart->hasShipping()) {
//送出session資料countries, zone_id, postcode, shipping_method
if (isset($this->session->data['shipping_address']['country_id'])) {
$data['country_id'] = $this->session->data['shipping_address']['country_id'];
//調用catalog/model/localisation/country.php取國家列表
$this->load->model('localisation/country');
//調用catalog/model/localisation/zone.php取單一國家zone列表
'zone' => $this->model_localisation_zone->getZonesByCountryId($this->request->get['country_id']),
6.) catalog/view/theme/default/template/extension/total/shipping.twig->
//按quote鍵->ajax catalog/controller/extension/total/shipping.php->quote()
...
$('#button-quote').on('click', function() {
$.ajax({
url: 'index.php?route=extension/total/shipping/quote',
type: 'post',
data: 'country_id=' + $('select[name=\'country_id\']').val() + '&zone_id=' + $('select[name=\'zone_id\']').val() + '&postcode=' + encodeURIComponent($('input[name=\'postcode\']').val()),
dataType: 'json',
beforeSend: function() {
$('#button-quote').button('loading');
},
complete: function() {
$('#button-quote').button('reset');
},
7.) catalog/controller/extension/total/shipping.php
//調用 catalog/model/extension/shipping/ 下所有可用 shipping extension (系統自帶13個)
->foreach ($results as $result) {
if ($this->config->get('shipping_' . $result['code'] . '_status')) {
$this->load->model('extension/shipping/' . $result['code']);
$quote = $this->{'model_extension_shipping_' . $result['code']}->getQuote($this->session->data['shipping_address']);
--- 20210131 opencart-3.0.3.6 運費估算調用路徑
=========================================================================================================================
所有url調用路徑
1.)index.php->
require_once('config.php'); //定義各種 DIR_XXX, DB_XXX
require_once(DIR_SYSTEM . 'startup.php'); //調用startup.php + function modification, library, start + spl_autoload_register
start('catalog'); //調用framework.php + 傳$application_config
2.)system/startup.php->
require_once(DIR_STORAGE . 'vendor/autoload.php'); //autoload vender
//加載所有library
spl_autoload_register('library'); //cache config db document encryption image language log mail pagination request response session squareup template url
//加載所有Engine
require_once(modification(DIR_SYSTEM . 'engine/action.php')); //-> function getId execute
require_once(modification(DIR_SYSTEM . 'engine/controller.php'));
require_once(modification(DIR_SYSTEM . 'engine/event.php')); //-> function register trigger unregister clear
require_once(modification(DIR_SYSTEM . 'engine/router.php')); //-> function addPreAction dispatch execute
require_once(modification(DIR_SYSTEM . 'engine/loader.php')); //-> function controller model view library helper config language callback
require_once(modification(DIR_SYSTEM . 'engine/model.php'));
require_once(modification(DIR_SYSTEM . 'engine/registry.php')); //-> function get set has
require_once(modification(DIR_SYSTEM . 'engine/proxy.php'));
3.)system/framework.php->
$config->load('default'); //system/cinfig/default.php 設db, action_default=common/home
$config->load($application_config); //system/cinfig/catalog.php 設action_pre_action=startup/startup...
$registry->set('config', $config); //設$this->config
$registry->set('load', $loader); //設$this->load
....
//設所有$this->request response db session cookie cache url language document
//判斷所有autoload->config_autoload language_autoload library_autoload model_autoload
//取url route
$route = new Router($registry);
//判斷所有Pre Actions 取所有值
if ($config->has('action_pre_action')) {
foreach ($config->get('action_pre_action') as $value) {
$route->addPreAction(new Action($value));
}
}
//跳轉Dispatch
$route->dispatch(new Action($config->get('action_router')), new Action($config->get('action_error')));
//送出結果Output
$response->output();
4.)system/engine/router.php->
function dispatch->function execute
5.) system/engine/action.php->
public function execute($registry, array $args = array()) {
...
$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);
...
include_once($file);
$controller = new $class($registry);
--- 20210131 opencart-3.0.3.6 所有url調用路徑
=========================================================================================================================
extension Lazy-Load-Images-OC3.0.x.ocmod
0.) SQL->oc_modification->xml (update from install.xml)
1.) 修改 catalog/view/theme/*/template/common/header.twig(20210327 已手工改)
->before add
2.) 修改所有要加 lazy-load 的 php
catalog/controller/extension/module/featured.php(20210327 已刪除不改)
catalog/controller/extension/module/{bestseller,special,latest}.php(20210327 已刪除不改)
catalog/controller/product/{special,search,category}.php(special 20210327 已刪除不改)(search,category 20210327 已手工改)
->before
foreach ($products as $product_id) {
foreach ($results as $result) {
->add
$data['lazy_load_width_height'] = 'width="' . $setting['width'] . '" height="' . $setting['height'] . '"';
$data['lazy_load_width_height'] = 'width="' . $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width') . '" height="' . $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height') . '"';
3.) 修改所有要加 lazy-load 的 twig
catalog/view/theme/*/template/extension/module/{featured,latest,special,bestseller}.twig(20210327 已刪除不改)
catalog/view/theme/*/template/product/{special,category,search}.twig(special 20210327 已刪除不改)(search,category 20210327 已手工改)
->
src="{{ product.thumb }}"
->replace
class="lazy-load" data-original="{{ product.thumb }}" {{ lazy_load_width_height }}
4.) dv 新增 product page 加 lazy-load
(20210307 直接新增在 product.php)
catalog/controller/product/product.php(20210327 已手工改)
->
->
上傳 simple_html_dom.php + product_description_lazyload_dv.php(自動修改 $data['description'] 中所有 img 格式成為 lazy-load 格式)
(20210327 已改 /var/www/html/ -> /var/www/html/dv/ 下)
cd /var/www/storage
mkdir dv (777)
wget 118.163.15.73/bpc/dv/simple_html_dom.php0
mv simple_html_dom.php0 simple_html_dom.php
wget 118.163.15.73/bpc/dv/product_description_lazyload_dv.php0
mv product_description_lazyload_dv.php0 product_description_lazyload_dv.php
chmod 777 *
-------------------------
ocmod 運行原則
1.) 優先使用 /var/www/storage/modification/system,catalog,admin/下已有的php twig
2.) 如果1.)沒有就使用 /var/www/html/system,catalog,admin/下的php twig
--- 20210130 opencart-3.0.3.6 研究 extension Lazy-Load-Images-OC3.0.x.ocmod + ocmod 運行原則
=========================================================================================================================
1.) 重新 zip 以下文件 + 目錄
install.xml
目錄 upload 包含2文件
Lazy-Load-Images-OC3.0.x.ocmod\upload\catalog\view\javascript\lazyload\jquery.lazyload.min.js
Lazy-Load-Images-OC3.0.x.ocmod\upload\catalog\view\javascript\lazyload\loading.gif
-> lazy-dv-1.ocmod.zip
2.) Extensions->Installer->upload lazy-dv-1.ocmod.zip
3.) Extensions->Modifications->Clear + Refresh
--- 20210129 opencart-3.0.3.6 安裝 extension Lazy-Load-Images-OC3.0.x.ocmod
=========================================================================================================================
Extensions->Modifications->Refresh
->Log:
-----------------------------------------------
2021-01-29 0:35:23 - MOD: Modification Default
...
FILE: system/library/template/twig.php
CODE: $loader = new \Twig_Loader_Filesystem(DIR_TEMPLATE);
NOT FOUND - OPERATIONS ABORTED!
->https://github.com/opencart/opencart/blob/3.0.x.x_Maintenance/upload/system/modification.xml 下載 modification.xml(bug fixed)
cd /var/www/html/system/
wget 118.163.15.73/bpc/dv/modification.xml -N
Extensions->Modifications->Refresh
--- 20210129 opencart-3.0.3.6 安裝 extension refresh 後 twig 錯誤 -> 修改 modification.xml
=========================================================================================================================
Extensions->Installer->upload Lazy-Load-Images-OC3.0.x.ocmod.zip
->error: mkdir permission denied
->cd /var/www/html/catalog/view/
chmod 777 . -R
--- 20210128 opencart-3.0.3.6 安裝 extension lazy-load 錯誤 -> 修改 /var/www/html/catalog/view/ 權限
=========================================================================================================================
0.) !!必需先停止 ocmod template cache
->後台 -> 右上角齒輪->theme-cache-: off + action -> 再至 extensions->modifications->右上角 clear + refresh
1.) joe /var/www/html/catalog/controller/product/product.php
-> $data['popupop'] = $this->load->controller('product/popupop');
2.) joe /var/www/html/catalog/view/theme/default/template/product/product.twig
-> {{ popupop }}
3.) cd /var/www/html/catalog/controller/product/
wget 118.163.15.73/bpc/dv/popupop.php0 -N
mv popupop.php0 popupop.php
joe /var/www/html/catalog/controller/product/popupop.php
->class ControllerCommonPopupop extends Controller {
...
$data['xxxx'] = 'xxxx';
return $this->load->view('product/popupop', $data);
4.) cd /var/www/html/catalog/view/theme/default/template/product/
wget 118.163.15.73/bpc/dv/popupop.twig -N
joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig
->
--- 20210124 opencart-3.0.3.6 新增 popup option page (已改用直接在調用頁中增加{% include %}方法)
=========================================================================================================================
修改 product page 上移 add to cart button + 下移 description
joe /var/www/html/catalog/view/theme/default/template/product/product.twig
->cd /var/www/html/catalog/view/theme/default/template/product/
wget 118.163.15.73/bpc/dv/product.twig -N
--- 20210124 opencart-3.0.3.6 修改 product page description 位置
=========================================================================================================================
http://18.217.214.174/index.php?route=checkout/cart 調用路徑
1.)index.php->start('catalog');
2.)system/startup.php->function start($application_config) { require_once(DIR_SYSTEM . 'framework.php'); }
3.)system/framework.php->$route->dispatch(new Action($config->get('action_router')), new Action($config->get('action_error')));
4.)system/engine/router.php->system/engine/action.php->
public function execute($registry, array $args = array()) {
...
$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);
// Initialize the class
if (is_file($file)) {
include_once($file);
5.)catalog/controller/checkout/cart.php
--- 20210123 opencart-3.0.3.6 shopping cart 頁調用路徑
=========================================================================================================================
首頁調用路徑 http://18.217.214.174/index.php(?route=common/home)
1.)index.php->start('catalog');
2.)system/startup.php->function start($application_config) { require_once(DIR_SYSTEM . 'framework.php'); }
3.)system/framework.php->$config = new Config();$config->load('default');
4.)system/library/config.php->public function load($filename) { $file = DIR_CONFIG . $filename . '.php';
5.)system/config/default.php->$_['action_default'] = 'common/home';
6.)system/framework.php->$route->dispatch(new Action($config->get('action_router')), new Action($config->get('action_error')));
7.)catalog/controller/common/home.php->
--- 20210123 opencart-3.0.3.6 首頁調用路徑
=========================================================================================================================
修改首頁 shopping cart 入口
joe /var/www/html/catalog/controller/common/header.php
// $data['shopping_cart'] = $this->url->link('checkout/cart');
$data['shopping_cart'] = 'www.buck4u.com';
--------------------
修改 shopping cart 頁跳轉
joe /var/www/html/catalog/controller/checkout/cart.php
header("Location: tb/Views/Shop/ShopCart.html");
exit;
--------------------
twig render 位置
system/library/template/twig.php->
$loader = new \Twig\Loader\ArrayLoader(array($filename . '.twig' => $code));
$twig = new \Twig\Environment($loader, $config);
->
system/storage/vendor/twig/twig/src/Loader/ArrayLoader.php //-> namespace Twig\Loader;
system/storage/vendor/twig/twig/src/Environment.php //-> namespace Twig;
--- 20210123 opencart-3.0.3.6 修改 shopping cart + 研究 twig render 位置
=========================================================================================================================
後台產品管理產生縮圖路徑
1.)進後台產品管理 http://18.217.214.174/admin/index.php?route=catalog/product
joe /var/www/html/admin/controller/catalog/product.php
->$this->model_tool_image->resize('no_image.png', 40, 40); //-> image/no_image.png
2.)調用 model_tool_image
joe /var/www/html/admin/model/tool/image.php
->class ModelToolImage extends Model {
public function resize($filename, $width, $height) {
...
if ($width_orig != $width || $height_orig != $height) {
$image = new Image(DIR_IMAGE . $image_old);
$image->resize($width, $height);
$image->save(DIR_IMAGE . $image_new);
} else {
3.)繼承基本class image
joe /var/www/html/system/library/image.php
->class Image {
public function resize($width = 0, $height = 0, $default = '') {
...
public function save($file, $quality = 90) {
...
錯誤: image/cache/ 下不產生縮圖致前后台所有縮圖全都破圖不能顯示
修改: 不明原因 $this->image = imagecreatefromgif($file); 產生的是object, 而不是resource
// if (is_resource($this->image)) {
if (is_object($this->image)) {
--- 20210120 opencart-3.0.3.6 後台產品管理產生縮圖路徑
=========================================================================================================================
安裝 sd-aws
sdonaws 592047561@qq.com + aa2233zz!!
IP: 18.217.214.174
Ubuntu Server 20.04 LTS (HVM), SSD Volume Type-> t2.micro->添加存储30G
sd-1.ppk->log in:ubuntu->sudo su
更新系统并安装必要的软件包
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install curl nano git
sudo apt install unzip
sudo apt install joe
安装Apache
sudo apt-get install apache2
sudo systemctl restart apache2
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2020-08-12T19:46:17
安装PHP/PHP-FPM
sudo apt install php8.0-cli
sudo apt-get install php8.0-gd
php -v
->PHP 8.0.1 (cli) (built: Jan 13 2021 08:22:35) ( NTS )
Copyright (c) The PHP Group Zend Engine v4.0.1, Copyright (c) Zend Technologies with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies
安装mysql
sudo apt-get install mysql-server
->Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 Server version: 8.0.22-0ubuntu0.20.04.3 (Ubuntu)
配置mysql
mysql_secure_installation
->root + frevres88->alter user 'root'@'localhost' identified by 'Frevres88!';
创建数据库+设置单独的MySQL用户帐户
mysql -u root -p
CREATE DATABASE oc_work CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'Frevres88!';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
CREATE USER 'ocwork'@'localhost' IDENTIFIED BY 'Frevres88!';
GRANT ALL PRIVILEGES ON *.* TO 'ocwork'@'localhost' WITH GRANT OPTION;
flush privileges;
select user,host from mysql.user;
\q
sudo systemctl restart mysql
安装phpmyadmin
sudo apt-get install php-mbstring
sudo apt-get install phpmyadmin
sudo apt-get update phpmyadmin
sudo apt update && sudo apt install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/html/P3-myA5
18.217.214.174/P3-myA5
-->
root 密碼安全度太差
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
SHOW VARIABLES LIKE 'validate_password%';
set global validate_password.policy=LOW;
ALTER user 'root'@'localhost' IDENTIFIED BY 'Frevres88!';
------------------------------------------------------------------------------------------------
下載 opencart-3.0.3.6.zip
cd /var/www/bk-zip/
wget 118.163.15.73/bpc/dv/upload.zip
建空資料庫 oc_work
安裝 opencart-3.0.3.6
cd /var/www/html/
sudo ln -s /usr/share/phpmyadmin /var/www/html/P3-myA5
unzip -q /var/www/bk-zip/upload.zip
mv config-dist.php config.php
mv admin/config-dist.php admin/config.php
chmod 777 system/storage/cache/
chmod 777 system/storage/download/
chmod 777 system/storage/logs/
chmod 777 system/storage/modification/
chmod 777 system/storage/session/
chmod 777 system/storage/upload/
chmod 777 system/storage/vendor/
chmod 777 image/
chmod 777 image/cache/
chmod 777 image/catalog/
chmod 777 config.php
chmod 777 admin/config.php
手工安装 cli_install.php
cd install
php cli_install.php install --db_hostname localhost --db_username ocwork --db_password Frevres88! --db_database oc_work --db_driver mysqli --db_port 3306 --username admin --password Frevres88! --email 1837794505@qq.com --http_server http://18.217.214.174/
->
SUCCESS! Opencart successfully installed on your server
Store link: http://18.217.214.174/
Admin link: http://18.217.214.174/admin/
136 张表 总计 5,467 InnoDB utf8_unicode_ci 550.2 KB 0 字节
->
手工移 storage 目錄出 html
rm /var/www/storage -rf
mv /var/www/html/system/storage /var/www/
mv /var/www/html/install /var/www/html/install-x
------------------------------------------------------------------------------------------------
Bugs opencart-3.0.3.6
1.) /var/www/html/install/cli_install.php
錯誤: DIR_STORAGE undefine
修改: 手工加定義
-> define('DIR_STORAGE', DIR_SYSTEM . 'storage/');
錯誤: MYSQL40 不能使用
/var/www/html/system/library/db/mysqli.php on line 40
Fatal error: Uncaught Exception: Error: Variable 'sql_mode' can't be set to the value of 'MYSQL40' Error No: 1231 SET @@session.sql_mode = 'MYSQL40' in /var/www/html/system/library/db/mysqli.php:44
修改: 手工加remark
-> // $db->query("SET @@session.sql_mode = 'MYSQL40'");
2.) system/storage 不可以放html下不安全一定要移出
修改: 改 config.php 的路徑定義
->function write_config_files($options) {
...
// $output .= 'define(\'DIR_STORAGE\', DIR_SYSTEM . \'storage/\');' . "\n";
$output .= 'define(\'DIR_STORAGE\', \'/var/www/storage/\');' . "\n";
修改: 改 admin/config.php 的路徑定義
->function write_config_files($options) {
...
// $output .= 'define(\'DIR_STORAGE\', DIR_SYSTEM . \'storage/\');' . "\n";
$output .= 'define(\'DIR_STORAGE\', \'/var/www/storage/\');' . "\n";
修改: 手工移 storage 目錄出 html
rm /var/www/storage -rf
mv /var/www/html/system/storage /var/www/
mv /var/www/html/install /var/www/html/install-x
3.) /var/www/html/system/library/image.php
錯誤: image/cache/ 下不產生縮圖致前后台所有縮圖全都破圖不能顯示
修改: 不明原因 $this->image = imagecreatefromgif($file); 產生的是object, 而不是resource
->public function save($file, $quality = 90) {
...
// if (is_resource($this->image)) {
if (is_object($this->image)) {
--- 20210119-20 AWS sdonaws 新account + opencart-3.0.3.6 安裝 + Debug
=========================================================================================================================
=========================================================================================================================
root@ip-172-31-40-85:/# df -h
Filesystem Size Used Avail Use% Mounted on
udev 488M 0 488M 0% /dev
tmpfs 100M 11M 89M 11% /run
/dev/xvda1 30G 20G 10G 66% /
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/loop2 18M 18M 0 100% /snap/amazon-ssm-agent/1566
/dev/loop1 29M 29M 0 100% /snap/amazon-ssm-agent/2012
/dev/loop4 97M 97M 0 100% /snap/core/9665
/dev/loop0 97M 97M 0 100% /snap/core/9804
tmpfs 100M 0 100M 0% /run/user/1000
--- 20200825 AWS-QT ADA 備份下載
=========================================================================================================================
後台打開設定
STORES->Configuration->GENERAL->Reports->General Options->Enable Reports->Yes
清空舊的表
customer_visitor->訪客記錄
report_event->訪問記錄
report_viewed_product_index->訪問產品
(20200502 16:00)
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200502_1600_ok.sql
(20200503 10:51)
TRUNCATE sales_bestsellers_aggregated_monthly;
SELECT * FROM sales_order_item WHERE created_at < '2020-03-20';
DELETE FROM sales_order_item WHERE created_at < '2020-03-20'; (共 54 行)
Bestsellers->You refreshed lifetime statistics.
--- 20200502 AWS-QT most viewed product report 沒有生效 + 新增 Packing Material + 清舊表成功
=========================================================================================================================
cd /var/www/magento2/app/design/frontend/Lee
cp pwc b4u -r
joe b4u/registration.php->
'frontend/Lee/b4u',
joe b4u/theme.xml->
b4u
cd /var/www/magento2/
php bin/magento cache:flush
chown -R www-data:www-data .
改store b4u的theme->b4u
php bin/magento cron:remove
Magento cron tasks have been removed
joe /var/www/magento2/app/design/frontend/Lee/b4u/Magento_Cms/templates/html/homepage/home_content.phtml
->addAttributeToFilter('new',1); (原為featured)
//->addCategoryFilter($category);
getName()*/; ?>
(原為featured)
刪除原Zou code第一大段
改 line 75:
' : '' */ ?>
--- 20200429 AWS-QT 增加新 theme -> Lee/b4u
=========================================================================================================================
(20200426 14:00)
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200426_backup_ok.sql
(20200428 12:50)
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200428_1250_ok.sql
(20200429 10:00)
cd /var/www/magento2_234_8pm_20200422_ready_ok/
tar -czf /var/www/bk-gz/magento2_234_8pm_20200422_ready_ok.tar.gz *
cd /var/www/bk-gz/
rm magento2-219-org-ok.tar.gz
rm magento2-219-qt-20200409-ok.tar.gz
rm magento232-20200405.tar.gz
--- 20200426-29 AWS-QT 正式使用備份 + 整理
=========================================================================================================================
S-0.)備份aws-qt magento2.3.4(現成) + 資料庫
cd /var/www/
cp magento2 magento2_234_8pm_20200422_ready_ok -r
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200422_ready_ok.sql
S-1.)改DNS + AWS-QT nginx 設定
改www.buck4u.com 指向 3.22.57.114
改www.purewaterclub.com 指向 3.22.57.114
rm /etc/nginx/sites-enabled/qt-wg-1
ln -s /etc/nginx/sites-available/b4-pwc-wk /etc/nginx/sites-enabled/
systemctl restart nginx
systemctl restart php7.2-fpm
S-2.)magento2.3.4(現成) + 導入 magento8pm_20200423_1500.sql + 修改資料庫 + 刪無用data + 升級資料庫
導出資料庫-aws-dv
php bin/magento maintenance:enable
mysqldump -u root -prevres88 --databases magento8pm > /var/www/html/magento8pm_20200423_1500.sql
導入資料庫-aws-qt
cd /var/www/bk-gz/
wget 3.22.57.63/magento8pm_20200423_1500.sql
joe magento8pm_20200423_1500.sql
line 22->(原為magento8pm)
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `magento2`;
->
mysql -u root -prevres88
mysql>drop database magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200423_1500.sql
mysql -u root -prevres88
USE magento2;
先修改資料庫
DROP TABLE ves_blockbuilder_block ;
DROP TABLE ves_blockbuilder_cms ;
DROP TABLE ves_blockbuilder_page ;
DROP TABLE ves_blockbuilder_product ;
DROP TABLE ves_blockbuilder_widget ;
DROP TABLE ves_blog_category ;
DROP TABLE ves_blog_category_store ;
DROP TABLE ves_blog_comment ;
DROP TABLE ves_blog_comment_store ;
DROP TABLE ves_blog_post ;
DROP TABLE ves_blog_post_category ;
DROP TABLE ves_blog_post_related ;
DROP TABLE ves_blog_post_store ;
DROP TABLE ves_blog_post_tag ;
DROP TABLE ves_brand ;
DROP TABLE ves_brand_group ;
DROP TABLE ves_brand_product ;
DROP TABLE ves_brand_store ;
DROP TABLE ves_megamenu_item ;
DROP TABLE ves_megamenu_menu ;
DROP TABLE ves_megamenu_menu_store ;
DROP TABLE ves_testimonial_testimonial ;
DROP TABLE ves_testimonial_testimonial_store ;
DROP TABLE core_config_dataBK;
DROP TABLE theme_0 ;
DROP TABLE catalog_category_entity_text_20191212 ;
DELETE FROM core_config_data WHERE path='dev/static/sign';
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
UPDATE core_config_data SET value='pwc-home' WHERE path='web/default/cms_home_page' AND scope_id=5 ;
DELETE FROM url_rewrite WHERE store_id=1 OR store_id=2 ;
DELETE FROM url_rewrite WHERE request_path LIKE 'ves%' OR target_path LIKE 'ves%' ;
DELETE FROM url_rewrite WHERE request_path LIKE 'zou%' OR target_path LIKE 'zou%' ;
DELETE FROM url_rewrite WHERE url_rewrite_id<=24838 AND entity_type='category' ;
DELETE FROM admin_user WHERE user_id < 5 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM cms_page WHERE page_id>4 AND page_id<>30 AND page_id<>36 AND page_id<>37 AND page_id<>42 AND page_id<>44 AND page_id<>45 AND page_id<>49;
TRUNCATE TABLE cms_page_store;
INSERT INTO cms_page_store (page_id,store_id) VALUES (1,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (2,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (3,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (30,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (36,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (37,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (42,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (44,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (45,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (49,0) ;
DELETE FROM cms_block WHERE is_active=0;
DELETE FROM cms_block_store WHERE block_id<32;
UPDATE catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
SET catalog_product_entity_text.value='Free shipping within USA, 48 states only'
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=159 AND catalog_product_entity_int.value=1 ;
UPDATE catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
SET catalog_product_entity_text.value='Shipping and handling: $3.5 Each additional item $0.2 FREE SHIPPING ON ORDERS OVER $25'
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=160 AND catalog_product_entity_int.value=1 ;
DELETE FROM core_config_data WHERE path LIKE 'payment/%' AND
path<>'payment/authorizenet_acceptjs/cctypes' AND
path<>'payment/authorizenet_acceptjs/currency' AND
path<>'payment/authorizenet_acceptjs/order_status' AND
path<>'payment/authorizenet_acceptjs/payment_action' ;
升級資料庫
cd /var/www/magento2/
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
S-3.)後台手工改設定
CONTENT->Configuration->改全部theme(web site+store+2 store view)為pwc(原為luma)
store->aws-219->aws-qt
CATALOG->Category->Default Category->Design->Use Parent Category Settings->Yes
將PWC下3個子目錄搬至Default Category下
刪PWC目錄
S-4.)後台設paypal + 刷卡 + 寄信 + reCaptcha
(20200423 15:30)通知ADA
(20200423 15:42)設好了, 己通知陳測試
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200422_ready_ada_ok.sql
/dev/xvda1 30G 15G 15G 51% /
du -sh
828M
(20200426 14:00)
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200426_backup_ok.sql
(20200428 12:50)
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200428_1250_ok.sql
--- 20200423 15:00 正式轉 AWS-DV magento8pm 完成
=========================================================================================================================
直接改xml + phtml太困難->放棄
joe /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Catalog/layout/catalog_product_view.xml
vendor/magento/module-theme/view/frontend/templates/html/header/logo.phtml
cp /var/www/magento2/vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml /var/www/html/catalog_product_viewxml
屬性表->eav_attribute->attribute_id(entity_type_id=4:產品屬性)
70->name
71->sku
72->description
73->short_description
159->free_shipping
160->b4_free_shipping
產品屬性值表數字型->catalog_product_entity_int->value(attribute_id=159:free_shipping)
0->no / 1->yes
產品屬性值表文字型->catalog_product_entity_text->value(attribute_id=73:short_description)
SELECT * FROM catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=159 AND catalog_product_entity_int.value=1 ;
->
UPDATE catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
SET catalog_product_entity_text.value='Free shipping within USA, 48 states only'
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=159 AND catalog_product_entity_int.value=1 ;
->
SELECT * FROM catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=160 AND catalog_product_entity_int.value=1 ;
->
UPDATE catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
SET catalog_product_entity_text.value='Shipping and handling: $3.5 Each additional item $0.2 FREE SHIPPING ON ORDERS OVER $25'
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=160 AND catalog_product_entity_int.value=1 ;
(20200422)在aws-dv上作
手工修改aws-dv ro站b4_free_shipping的產品說明刪除shipping價格
ID: 0 - 2200 b4 Free Shipping: Yes 14 records found
To buy this item can be combined with any products in our web store. If your order don't excess minimum amount, a shipping must be charged.
2043,2045,2052,2134,2135,2138,2139,2140,2142,2143,2144,2145,2147,2194
--- 20200422 AWS-QT 改產品頁 short description 內容改 shipping + AWS-DV 預先直接改RO的1元產品說明
=========================================================================================================================
cd /var/www/magento2/
mkdir -p app/design/frontend/Lee/pwc/Magento_Theme/templates/html/header/
cp vendor/magento/module-theme/view/frontend/templates/html/header/logo.phtml app/design/frontend/Lee/pwc/Magento_Theme/templates/html/header/logo.phtml
joe app/design/frontend/Lee/pwc/Magento_Theme/templates/html/header/logo.phtml
line 22->刪除
= $block->getLogoHeight() ? 'height="' . $block->escapeHtmlAttr($block->getLogoHeight()) . '"' :'' ?>
--- 20200421 AWS-QT 改首頁 logo 固定長寬比
=========================================================================================================================
cd /var/www/magento2/
cp vendor/magento/module-catalog/view/frontend/templates/product/list.phtml app/design/frontend/Lee/pwc/Magento_Catalog/templates/product/list.phtml
joe app/design/frontend/Lee/pwc/Magento_Catalog/templates/product/list.phtml
line 71->
SKU#: ').$_product->getSku() ?>
--- 20200421 AWS-QT 改產品列表頁加 SKU
=========================================================================================================================
joe /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Cms/templates/html/homepage/home_content.phtml
//$categoryId = 85; //FEATURE ITEMS
//$category = $categoryModel->load($categoryId);
$productCollection = $productCollection
->setVisibility([2,3,4])
->addAttributeToFilter('status', ['in' => [1]])
->addMinimalPrice()
->addFinalPrice()
->addTaxPercents()
->addAttributeToSelect($catalogConfig->getProductAttributes())
->addUrlRewrite()
->addStoreFilter()
->setPageSize(8)
->setCurPage(1)
->addAttributeToFilter('featured',1);
//->addCategoryFilter($category);
getName()*/; ?>
--- 20200421 AWS-QT 改首頁跑馬燈直接抓 attribute featured 產品
=========================================================================================================================
(20200420 10:50)
T-1.)magento2.3.4(現成) + 導入magento8pm_20200420_1050.sql + 修改資料庫 + 刪無用data + 升級資料庫
導出資料庫-aws-dv
mysqldump -u root -prevres88 --databases magento8pm > /var/www/html/magento8pm_20200420_1050.sql
導入資料庫-aws-qt
cd /var/www/bk-gz/
wget 3.22.57.63/magento8pm_20200420_1050.sql
joe magento8pm_20200420_1050.sql
line 22->(原為magento8pm)
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `magento2`;
->
mysql -u root -prevres88
mysql>drop database magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200420_1050.sql
mysql -u root -prevres88
USE magento2;
先修改資料庫
DROP TABLE ves_blockbuilder_block ;
DROP TABLE ves_blockbuilder_cms ;
DROP TABLE ves_blockbuilder_page ;
DROP TABLE ves_blockbuilder_product ;
DROP TABLE ves_blockbuilder_widget ;
DROP TABLE ves_blog_category ;
DROP TABLE ves_blog_category_store ;
DROP TABLE ves_blog_comment ;
DROP TABLE ves_blog_comment_store ;
DROP TABLE ves_blog_post ;
DROP TABLE ves_blog_post_category ;
DROP TABLE ves_blog_post_related ;
DROP TABLE ves_blog_post_store ;
DROP TABLE ves_blog_post_tag ;
DROP TABLE ves_brand ;
DROP TABLE ves_brand_group ;
DROP TABLE ves_brand_product ;
DROP TABLE ves_brand_store ;
DROP TABLE ves_megamenu_item ;
DROP TABLE ves_megamenu_menu ;
DROP TABLE ves_megamenu_menu_store ;
DROP TABLE ves_testimonial_testimonial ;
DROP TABLE ves_testimonial_testimonial_store ;
DROP TABLE core_config_dataBK;
DROP TABLE theme_0 ;
DROP TABLE catalog_category_entity_text_20191212 ;
DELETE FROM core_config_data WHERE path='dev/static/sign';
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
UPDATE core_config_data SET value='pwc-home' WHERE path='web/default/cms_home_page' AND scope_id=5 ;
DELETE FROM url_rewrite WHERE store_id=1 OR store_id=2 ;
DELETE FROM url_rewrite WHERE request_path LIKE 'ves%' OR target_path LIKE 'ves%' ;
DELETE FROM url_rewrite WHERE request_path LIKE 'zou%' OR target_path LIKE 'zou%' ;
DELETE FROM url_rewrite WHERE url_rewrite_id<=24838 AND entity_type='category' ;
DELETE FROM admin_user WHERE user_id < 5 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
DELETE FROM theme WHERE theme_id > 3 ;
x->DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 AND page_id <> 37 AND page_id <> 42 AND page_id <> 44 AND page_id <> 45 AND page_id <> 49;
新增加 1:404 + 3:Enable Cookies
DELETE FROM cms_page WHERE page_id>4 AND page_id<>30 AND page_id<>36 AND page_id<>37 AND page_id<>42 AND page_id<>44 AND page_id<>45 AND page_id<>49;
TRUNCATE TABLE cms_page_store;
INSERT INTO cms_page_store (page_id,store_id) VALUES (1,0) ; (新增加)
INSERT INTO cms_page_store (page_id,store_id) VALUES (2,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (3,0) ; (新增加)
INSERT INTO cms_page_store (page_id,store_id) VALUES (30,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (36,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (37,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (42,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (44,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (45,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (49,0) ;
DELETE FROM cms_block WHERE is_active=0;
DELETE FROM cms_block_store WHERE block_id<32;
x->UPDATE catalog_product_entity_text SET value='' WHERE value LIKE '%s-Desc%';
(20200422)改為修改short description為shipping
free_shipping->
UPDATE catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
SET catalog_product_entity_text.value='Free shipping within USA, 48 states only'
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=159 AND catalog_product_entity_int.value=1 ;
b4_free_shipping->
UPDATE catalog_product_entity_text LEFT JOIN catalog_product_entity_int ON catalog_product_entity_text.entity_id=catalog_product_entity_int.entity_id
SET catalog_product_entity_text.value='Shipping and handling: $3.5 Each additional item $0.2 FREE SHIPPING ON ORDERS OVER $25'
WHERE catalog_product_entity_text.attribute_id=73 AND catalog_product_entity_int.attribute_id=160 AND catalog_product_entity_int.value=1 ;
(20200422)一定要補作否則checkout會出錯
DELETE FROM core_config_data WHERE path LIKE 'payment/%' AND
path<>'payment/authorizenet_acceptjs/cctypes' AND
path<>'payment/authorizenet_acceptjs/currency' AND
path<>'payment/authorizenet_acceptjs/order_status' AND
path<>'payment/authorizenet_acceptjs/payment_action' ;
-------------- 以下正式轉不用作-----------------
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.buck4u.com/';
UPDATE core_config_data SET value='http://qt.purewaterclub.com/' WHERE value='http://www.purewaterclub.com/';
UPDATE core_config_data SET value='https://qt.purewaterclub.com/' WHERE value='https://www.purewaterclub.com/';
升級資料庫
cd /var/www/magento2/
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
->OK
後台手工改設定
CONTENT->Configuration->改全部theme(web site+store+2 store view)為pwc(原為luma)
CATALOG->Category->Default Category->Design->Use Parent Category Settings->Yes
將PWC下3個子目錄搬至Default Category下 + 刪PWC
x->新增Parts & Tools目錄下FEATURE ITEMS子目錄(ID:應為85)->86 (20200421 前台跑馬燈已改程式)
x->joe /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Cms/templates/html/homepage/home_content.phtml
$categoryId = 86; //85; //FEATURE ITEMS //2;
x->將feature enable的15個product添加FEATURE ITEMS目錄
--- 20200420 第2次試轉 AWS-DV magento8pm 成功
=========================================================================================================================
rm /etc/nginx/sites-enabled/zou-wg-1
rm /etc/nginx/sites-enabled/qtpic-wg-1
mv /etc/nginx/sites-enabled/aws-wg-1* /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/aws-wg-1 /etc/nginx/sites-enabled/
joe /var/www/magento2/nginx.conf.sample
line 188->
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# START - Multisite customization
fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE;
fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
fastcgi_param MAGE_MODE $MAGE_MODE;
# END - Multisite customization
include fastcgi_params;
}
joe /etc/nginx/sites-available/qt-wg-1->
upstream fastcgi_backend {
server unix:/run/php/php7.2-fpm.sock;
}
map $http_host $MAGE_RUN_CODE {
qt.wg-1.com b4u_home;
qt.purewaterclub.com pwc_ro;
}
server {
listen 80;
server_name qt.wg-1.com;
set $MAGE_ROOT /var/www/magento2;
set $MAGE_MODE developer;
set $MAGE_RUN_TYPE store;
include /var/www/magento2/nginx.conf.sample;
error_log /var/log/nginx/error.log;
}
server {
listen 80;
server_name qt.purewaterclub.com;
set $MAGE_ROOT /var/www/magento2;
set $MAGE_MODE developer;
set $MAGE_RUN_TYPE store;
include /var/www/magento2/nginx.conf.sample;
error_log /var/log/nginx/error.log;
}
預作nginx的buck4u + pwc 設定
cp /etc/nginx/sites-available/qt-wg-1 /etc/nginx/sites-available/b4-pwc-wk
joe /etc/nginx/sites-available/b4-pwc-wk
upstream fastcgi_backend {
server unix:/run/php/php7.2-fpm.sock;
}
map $http_host $MAGE_RUN_CODE {
www.buck4u.com b4u_home;
www.purewaterclub.com pwc_ro;
}
server {
listen 80;
server_name www.buck4u.com;
set $MAGE_ROOT /var/www/magento2;
set $MAGE_MODE developer;
set $MAGE_RUN_TYPE store;
include /var/www/magento2/nginx.conf.sample;
error_log /var/log/nginx/error.log;
}
server {
listen 80;
server_name www.purewaterclub.com;
set $MAGE_ROOT /var/www/magento2;
set $MAGE_MODE developer;
set $MAGE_RUN_TYPE store;
include /var/www/magento2/nginx.conf.sample;
error_log /var/log/nginx/error.log;
}
以下正式轉好才作--------------
rm /etc/nginx/sites-enabled/qt-wg-1
ln -s /etc/nginx/sites-available/b4-pwc-wk /etc/nginx/sites-enabled/
systemctl restart nginx
systemctl restart php7.2-fpm
--- 20200420 AWS-QT nginx 設定
=========================================================================================================================
(20200419 19:19)
T-1.)magento2.3.4(現成) + 導入magento8pm_20200419_1920.sql + 修改資料庫 + 刪無用data + 升級資料庫
x->後台手工改pwc home page(直接改SQL不用作)
x->STORE->Configuration->Store View->pwc_ro->GENERAL->Web->Default Pages->CMS Home Page->purewaterclub.com(原為Home Page)
導出資料庫-aws-dv
mysqldump -u root -prevres88 --databases magento8pm > /var/www/html/magento8pm_20200419_1920.sql
備份資料庫-aws-qt
cp magento2 magento2_234_8pm_20200419_lee_ok -r
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200419_lee_ok.sql
導入資料庫
wget 3.22.57.63/magento8pm_20200419_1920.sql
joe magento8pm_20200419_1920.sql
line 22->(原為magento8pm)
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `magento2`;
->
mysql -u root -prevres88
mysql>drop database magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200419_1920.sql
mysql -u root -prevres88
USE magento2;
先修改資料庫
DROP TABLE ves_blockbuilder_block ;
DROP TABLE ves_blockbuilder_cms ;
DROP TABLE ves_blockbuilder_page ;
DROP TABLE ves_blockbuilder_product ;
DROP TABLE ves_blockbuilder_widget ;
DROP TABLE ves_blog_category ;
DROP TABLE ves_blog_category_store ;
DROP TABLE ves_blog_comment ;
DROP TABLE ves_blog_comment_store ;
DROP TABLE ves_blog_post ;
DROP TABLE ves_blog_post_category ;
DROP TABLE ves_blog_post_related ;
DROP TABLE ves_blog_post_store ;
DROP TABLE ves_blog_post_tag ;
DROP TABLE ves_brand ;
DROP TABLE ves_brand_group ;
DROP TABLE ves_brand_product ;
DROP TABLE ves_brand_store ;
DROP TABLE ves_megamenu_item ;
DROP TABLE ves_megamenu_menu ;
DROP TABLE ves_megamenu_menu_store ;
DROP TABLE ves_testimonial_testimonial ;
DROP TABLE ves_testimonial_testimonial_store ;
DROP TABLE core_config_dataBK;
DROP TABLE theme_0 ;
DROP TABLE catalog_category_entity_text_20191212 ;
DELETE FROM core_config_data WHERE path='dev/static/sign';
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
UPDATE core_config_data SET value='pwc-home' WHERE path='web/default/cms_home_page' AND scope_id=5 ;
DELETE FROM url_rewrite WHERE store_id=1 OR store_id=2 ;
DELETE FROM url_rewrite WHERE request_path LIKE 'ves%' OR target_path LIKE 'ves%' ;
DELETE FROM url_rewrite WHERE request_path LIKE 'zou%' OR target_path LIKE 'zou%' ;
DELETE FROM url_rewrite WHERE url_rewrite_id<=24838 AND entity_type='category' ;
DELETE FROM admin_user WHERE user_id < 5 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 AND page_id <> 37 AND page_id <> 42 AND page_id <> 44 AND page_id <> 45 AND page_id <> 49;
TRUNCATE TABLE cms_page_store;
INSERT INTO cms_page_store (page_id,store_id) VALUES (2,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (30,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (36,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (37,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (42,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (44,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (45,0) ;
INSERT INTO cms_page_store (page_id,store_id) VALUES (49,0) ;
DELETE FROM cms_block WHERE is_active=0;
DELETE FROM cms_block_store WHERE block_id<32;
UPDATE catalog_product_entity_text SET value='' WHERE value LIKE '%s-Desc%';
-------------- 以下正常轉不用作-----------------
INSERT INTO core_config_data (scope,scope_id,path,value) VALUES ('default',0,'web/default/cms_home_page','home');
UPDATE cms_page SET page_layout='1column',content_heading='',custom_theme='' WHERE page_id=2 ;
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.buck4u.com/';
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.purewaterclub.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.purewaterclub.com/';
升級資料庫
cd /var/www/magento2/
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
->OK,bug前台buck4u點logo跳至pwc
後台手工改設定
CONTENT->Configuration->改全部theme(web site+store+2 store view)為pwc(原為luma)
CATALOG->Category->PWC->Design->Use Parent Category Settings->Yes
新增Parts & Tools目錄下FEATURE ITEMS子目錄(ID:應為85)
將PWC下3個子目錄搬至Default Category下+刪PWC
將feature enable的15個product添加FEATURE ITEMS目錄
-------------------------
停止theme Zou產品頁custom tab
mv /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Catalog/layout/catalog_product_view.xml /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Catalog/layout/catalog_product_view.xml-0
停止theme Zou目錄頁上方大圖
mv /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Catalog/layout/catalog_category_view.xml /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Catalog/layout/catalog_category_view.xml-0
批次修改short description防止queue
FREE Shipping
php bin/magento cron:run
joe /var/www/magento2/var/log/magento.cron.log
--- 20200419 AWS-QT magento2.3.4 + 第1次試轉 sql AWS-DV magento8pm 成功
=========================================================================================================================
0.)測試
50GPD Home drinking RO System w/tank extra free 3 PC filters
RQ-5T-50+3
1.)改mysql設定可以查2英文字
參考->https://dev.mysql.com/doc/refman/5.6/en/fulltext-fine-tuning.html#fulltext-word-length
joe /etc/mysql/my.cnf->增加
[mysqld]
innodb_ft_min_token_size=2
ft_min_word_len=2
->
systemctl restart mysql
mysql -u root -p
失敗->mysql> SET GLOBAL innodb_ft_min_token_size = 2;->ERROR 1238 (HY000): Variable 'innodb_ft_min_token_size' is a read only variable
mysql>SHOW VARIABLES LIKE 'innodb_ft_min_token_size';
->
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| innodb_ft_min_token_size | 2 |(原本為3)
+--------------------------+-------+
1 row in set (0.00 sec)
mysql>SHOW VARIABLES LIKE 'ft_min_word_len';
->
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| ft_min_word_len | 2 |(原本為4)
+-----------------+-------+
1 row in set (0.00 sec)
->
2.)修改系統查詢
cd /var/www/magento2
joe vendor/magento/module-catalog-search/etc/search_request.xml
line 16->
(原為should,改為must)
->
/usr/bin/php bin/magento indexer:reindex
/usr/bin/php bin/magento cache:flush
--- 20200419 AWS-QT RO站前台查不到SKU
=========================================================================================================================
magento2->表customer_entity->password_hash
1@aa.com + aa223344
140e8587c46ea4afc679cb70bae56341:70:0->aa223344-osc-v.1
$P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:0->aa223344-osc-v.2
fe3b24a5674b3b2c7fdb8bfe4665037271c85b87d4a0e7b011e369fbe1dab83c:vVuPQqsPntRvuyEw:2->aa223344-magento2.3.4
joe /var/www/magento2/vendor/magento/framework/Encryption/Encryptor.php
1.)修改原有的isValidHash(),加入判斷利用salt位置傳遞的hash值是否為osc v.2,並比對由GenPasswordHash()產生的v.2 hash是否正確
line 272->
public function isValidHash($password, $hash)
{
$this->explodePasswordHash($hash);
foreach ($this->getPasswordVersion() as $hashVersion) {
// $password = $this->hash($this->getPasswordSalt() . $password, $hashVersion);
public function isValidHash($password, $hash)
{
try {
$this->explodePasswordHash($hash);
$recreated = $password;
foreach ($this->getPasswordVersion() as $hashVersion) {
if ($hashVersion === self::HASH_VERSION_ARGON2ID13) {
$recreated = $this->getArgonHash($recreated, $this->getPassw
} else {
//----- 20200419 DV -------
// remark oraginal code
// $recreated = $this->generateSimpleHash($this->getPasswordSalt() . $recreated, $hashVersion);
// code add by dv
$tmpsalt=$this->getPasswordSalt();
//--- check if RO Site 2nd password hash ($P$D... 33 digit)->(P$D... 32 digit)
if($hashVersion==0 && substr($tmpsalt,0,3)=='P$D'){
//--- make hash by salt
$tmpsalt="$".$tmpsalt;
//--- check if password OK with SQL hash($ + P$D..)
if($this->GenPasswordHash($password,$tmpsalt)==$tmpsalt){
//--- set password -> generated hash
$recreated=$tmpsalt;
}
}
else{
// run oraginal code
$recreated = $this->generateSimpleHash($this->getPasswordSalt() . $recreated, $hashVersion);
}
//----------------------------------------------------------
}
$hash = $this->getPasswordHash();
}
} catch (\RuntimeException $exception) {
//Hash is not a password hash.
$recreated = $this->hash($password);
}
return Security::compareStrings(
$recreated,
$hash
);
}
2.)新增產生osc v.2的password hash
line 269->
//----- 20200419 DV ---------------------------------------------------------
public function GenPasswordHash($password,$setting){
$itoa64='./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$count_log2 = strpos($itoa64,$setting[3]);
if ($count_log2 < 7 || $count_log2 > 30)return $output;
$count = 1 << $count_log2;
$salt = substr($setting, 4, 8);
if (strlen($salt) != 8)return $output;
if (PHP_VERSION >= '5') {
$hash = md5($salt . $password, TRUE);
do {
$hash = md5($hash . $password, TRUE);
} while (--$count);
}
else {
$hash = pack('H*', md5($salt . $password));
do {
$hash = pack('H*', md5($hash . $password));
} while (--$count);
}
$output = substr($setting, 0, 12);
$tmpout = '';
$count=16;
$i = 0;
do {
$value = ord($hash[$i++]);
$tmpout .= $itoa64[$value & 0x3f];
if ($i < $count)$value |= ord($hash[$i]) << 8;
$tmpout .= $itoa64[($value >> 6) & 0x3f];
if ($i++ >= $count)break;
if ($i < $count)$value |= ord($hash[$i]) << 16;
$tmpout .= $itoa64[($value >> 12) & 0x3f];
if ($i++ >= $count)break;
$tmpout .= $itoa64[($value >> 18) & 0x3f];
}while ($i < $count);
$output .= $tmpout;
return $output;
}
//----------------------------------------------------------
--- 20200419 AWS-QT 改相容舊RO站客戶登入密碼核心 PHP
=========================================================================================================================
cd /var/www/magento2/app/design/frontend/
cp Zou Lee -r
mv Lee/demo Lee/pwc
joe Lee/pwc/registration.php->
'frontend/Lee/pwc',
joe Lee/pwc/theme.xml->
pwc
cd /var/www/magento2/
php bin/magento cache:flush
改完所有store的theme->pwc
rm /var/www/magento2/app/design/frontend/Zou -r
後台刪theme Zou
--- 20200419 AWS-QT 改Zou/demo -> Lee/pwc
=========================================================================================================================
清理aws-dv
cd /var/www/html/magento8pm-20200319-braintree-ok-dv-fix-chen-test-ok/
tar -czf magento8pm-20200319-braintree-ok-dv-fix-chen-test-ok.tar.gz *
cd /var/www/html/magento8pm-20200416
tar -czf magento8pm-20200416.tar.gz *
mysqldump -u root -prevres88 --databases magento8pm > magento8pm_20200418.sql
----------------------------------------------------
/dev/xvda1 30G 24G 5.5G 82% /
(20200419 11:06)點Flush Cache Storage按鈕->(等於同時按下面3按鈕)
/dev/xvda1 30G 21G 8.2G 72% /
root@awsko:/var/www/html/magento8pm# du -sh -> 810M
----------------------------------------------------
整理+備份aws-qt(wget aws-dv gz)
cd /var/www/bk-gz/
wget 3.22.57.63/magento8pm-20200319-braintree-ok-dv-fix-chen-test-ok.tar.gz
wget 3.22.57.63/magento8pm-20200416.tar.gz
wget 3.22.57.63/magento2-20200405.tar.gz
wget 3.22.57.63/magento232-20200405.tar.gz
wget 3.22.57.63/magento8pm_20200418.sql
cd /var/www/magento2-219-org-ok
tar -czf /var/www/bk-gz/magento2-219-org-ok.tar.gz *
cd /var/www/magento2-219-qt-20200409-ok
tar -czf /var/www/bk-gz/magento2-219-qt-20200409-ok.tar.gz *
cd /var/www/magento2-20200407-org-ok
tar -czf /var/www/bk-gz/magento2-20200407-org-ok.tar.gz *
cd /var/www/magento2_234_8pm_20200414_ok
tar -czf /var/www/bk-gz/magento2_234_8pm_20200414_ok.tar.gz *
cd /var/www/magento2_234_8pm_20200415_ok
tar -czf /var/www/bk-gz/magento2_234_8pm_20200415_ok.tar.gz *
cd /var/www/magento2_234_8pm_20200416_ada_ok
tar -czf /var/www/bk-gz/magento2_234_8pm_20200416_ada_ok.tar.gz *
cd /var/www/pwpic
tar -czf /var/www/bk-gz/pwpic-20200418-new-dir.tar.gz *
cd /var/www/
cp magento2 magento2_234_8pm_20200418_zou_ok -r
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200418_zou_ok.sql
--- 20200419 整理+備份 AWS-DV + AWS-QT
=========================================================================================================================
備份magento 2.3.4 + 資料庫
cd /var/www/
cp magento2 magento2_234_8pm_ada_ml_20200417_ok -r
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_ada_ml_20200417_ok.sql
安裝 Theme Zou demo
cd /var/www/magento2/app/design/frontend/
wget 118.163.15.73/Zou.zip
unzip -q Zou.zip
cd /var/www/magento2/
php bin/magento cache:flush
->OK,測所有index,upgrade,compile,deploy->OK
參考Theme Zou指向demo.js
/var/www/magento2/app/design/frontend/Zou/demo/requirejs-config.js
Magento_Theme/layout/default_head_blocks.xml
參考http://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html
改首頁跑馬燈
joe /var/www/magento2/app/design/frontend/Zou/demo/web/js/demo.js
loop: true,
autoplay: true,
autoplayTimeout: 3000,
dots: true,
items: 5,
mouseDrag: true,
responsive:{
0:{
items:2
},
480:{
items:2
},
767:{
items:4
},
992:{
items:4
},
1200:{
items:5
->
改首頁導航背景色(去掉zou transparent)
joe /var/www/magento2/app/design/frontend/Zou/demo/web/css/demo.css ->最後2行transparent都去掉?
.sections.nav-sections {
/* background: transparent; */
->
改首頁跑馬燈指定目錄
joe /var/www/magento2/app/design/frontend/Zou/demo/Magento_Cms/templates/html/homepage/home_content.phtml
joe /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Cms/templates/html/homepage/home_content.phtml
$categoryId = 85; //FEATURE ITEMS (原為3)
(20200419)
將HOT SELLERS和FEATURE ITEMS上下對調
->
改首頁目錄連接頁在最上面 + 去掉zou slider + static block
joe /var/www/magento2/app/design/frontend/Zou/demo/Magento_Cms/layout/cms_index_index.xml
->(原為before="home_block_container")
參考底部luma layout xml
/var/www/magento2/vendor/magento/theme-frontend-luma/Magento_Theme/layout/default.xml
改zou底部留luma 版權 + 去掉store view選擇
joe /var/www/magento2/app/design/frontend/Zou/demo/Magento_Theme/layout/default.xml
->
改zou底部去掉中間 + 去掉左右大title + 去掉版權
joe /var/www/magento2/app/design/frontend/Zou/demo/Magento_Theme/templates/html/footer_cont.phtml
joe /var/www/magento2/app/design/frontend/Lee/pwc/Magento_Theme/templates/html/footer_cont.phtml
Design->Layout Update XML
block-slideshow-bannertopblock-banner-centernew-products-carouselbanner-mass-bottomproduct-tabsbanner-mass-bottom2
--- 20200202 product-list
=========================================================================================================================
Base URL for User Media Files:/var/www/html/magento8pm/pub/media/
8pm Slider dv