...
//個別 panel-collapse 內裝入要折疊或展開的內容
5.) $(".collapse.in").collapse("toggle");
//用 js 將所有已展開(class 中帶有 in)的 panel-collapse 觸發一次折疊
--- 20210218 使用 js bootstrap collapse
=========================================================================================================================
checkout 頁合併付款方式 + 定單確認為一頁
1.) joe /var/www/html/catalog/view/theme/default/template/checkout/checkout.twig
//刪除第3,4,6步驟(Delivery Details, Delivery Method, Confirm Order)的折疊區塊
->...
//修改如果登入時已 logged 的 ajax 下載頁面為由原 payment_address -> 新增的 cartorder (panel 仍為 #collapse-payment-method)
->$.ajax({ url: 'index.php?route=checkout/cartorder',
...
success: function(html) { $('#collapse-payment-method .panel-body').html(html);
2.) joe /var/www/html/catalog/view/theme/default/template/checkout/cartorder.twig
//以原 payment_method.twig 為基礎刪除同意條款 + continue 送出選付款方式按鈕
->{% if text_agree %}...{% endif %}
//將原 confirm.twig 的 order 內容 + total 列表移入至最上方 + 增加 style
->{% if not redirect %}...{% endif %}
//將原 confirm.twig 的 confirm 確定定單按鈕移入至最下方
->
{{ entry_telephone }}
//刪除 required
->
--- 20210213 opencart-3.0.3.6 取消註冊 telephone required
=================================================================================================
新增 shopping cart 頁數量為0時彈窗確認刪除
joe /var/www/html/catalog/view/theme/default/template/checkout/tabcart.twig
//建立彈窗 div 結構
This action will remove this item from your shopping cart.
//為0時傳參 + 調用彈窗
$('#button-remove').attr(tmpa,tmpid);
$('#modal-remove').modal('show');
--- 20210212 opencart-3.0.3.6 新增 shopping cart 頁數量為0時彈窗確認刪除
=================================================================================================
新增 shopping cart 頁 total extension->domestic shipping 國內運費
1.) cp /var/www/html/admin/controller/extension/total/sub_total.php -> domestic.php
//複制後台 extension controller + 改 class name(必需要和php名相同) + 改所有變數 sub_total -> domestic
2.) cp /var/www/html/admin/language/en-gb/extension/total/sub_total.php -> domestic.php
//複制後台語言包 + 改所有常數 sub_total -> domestic
3.) cp /var/www/html/admin/view/template/extension/total/sub_total.twig -> domestic.twig
//複制後台 extension template + 改所有變數 sub_total -> domestic
4.) cp /var/www/html/catalog/model/extension/total/sub_total.php -> domestic.php
//複制前台 extension model + 改 class name(必需要和php名相同) + 改所有變數 sub_total -> domestic
(20210309 原語言包作廢改用 common/common)
5.) cp /var/www/html/catalog/language/en-gb/extension/total/sub_total.php -> domestic.php
//複制前台語言包 + 改所有常數 sub_total -> domestic
(20210309 原語言包作廢改用 common/common)
6.) Extensions->Extensions->Order Totals->install + enable + sort order 3
//後台先安裝 extension -> 安裝後 db->oc_extension 自動產生 shipping domestic -> 再 enable + sort order 3
7.) joe /var/www/html/catalog/model/extension/total/domestic.php
//修改調用 model cart 函數
->$domestic = $this->cart->getTotalDomestic();
8.) joe /var/www/html/system/library/cart/cart.php
//新增統計國內運費變數 + 函數
->'domestic' => $product_query->row['domestic'],
...
public function getTotalDomestic() {
--- 20210212 opencart-3.0.3.6 新增 shopping cart 頁 total extension->domestic shipping 國內運費
=================================================================================================
shopping cart 頁尾部所有 totals 產生路徑
1.) /var/www/html/catalog/view/theme/default/template/checkout/tabcart.twig
//列出所有的 total
->{% for total in totals %}
{{ total.title }}:
{{ total.text }}
{% endfor %}
2.) /var/www/html/catalog/controller/checkout/cart.php
//取所有 total extension
-> $results = $this->model_setting_extension->getExtensions('total');
//數據庫取所有 total extension list
/var/www/html/catalog/model/setting/extension.php
(!! type 是 SQL 保留字所有必需前後加 `type` !!)
-> $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "'");
-> db->oc_extension->code->10個值(sub_total,reward,shipping,coupon,tax,credit,voucher,total,handling,low_order_fee)
//排序所有 total extension (讀取db->oc_setting所有設定)
foreach ($results as $key => $value) {
$sort_order[$key] = $this->config->get('total_' . $value['code'] . '_sort_order');
}
//判斷所有 total extension 是否執行 (讀取db->oc_setting所有設定)
-> if ($this->config->get('total_' . $result['code'] . '_status')) {
//加載 total extension model
-> $this->load->model('extension/total/' . $result['code']);
//執行 total extension model 的 getTotal
// We have to put the totals in an array so that they pass by reference.
$this->{'model_extension_total_' . $result['code']}->getTotal($total_data);
3.) /var/www/html/catalog/model/extension/total/sub_total.php
//第一個 total extension 取總貨款
-> $sub_total = $this->cart->getSubTotal();
4.) /var/www/html/system/library/cart/cart.php
//累加所有貨款
->public function getSubTotal() {
$total = 0;
foreach ($this->getProducts() as $product) {
$total += $product['total'];
}
//從 db->oc_cart 取產品 list
->public function getProducts() {
...
$cart_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "cart WHERE api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "'");
//從 db->oc_product 取產品資料
->foreach ($cart_query->rows as $cart) {
...
$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_store p2s LEFT JOIN " . DB_PREFIX . "product p ON (p2s.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND p2s.product_id = '" . (int)$cart['product_id'] . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
...
$price = $product_query->row['price'];
--- 20210212 opencart-3.0.3.6 研究 shopping cart 頁尾部所有 totals 產生路徑
=================================================================================================
shopping cart 頁->小屏內容不超出屏幕 + 新增 checkbox 列
1.) joe /var/www/html/catalog/controller/checkout/cart.php
//放大縮圖 47x47 -> 100x100
->// $image = $this->model_tool_image->resize($product['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_cart_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_cart_height'));
$image = $this->model_tool_image->resize($product['image'], 100, 100);
2.) joe /var/www/html/catalog/view/theme/default/template/checkout/tabcat.twig
//刪除 model 欄
{{ column_model }}
{{ product.model }}
//TD name 改為 div 移到 td-img 之下
//設 td-img, img, name 的 position
.cart-td-img{
position: relative;
.cart-img{
position: absolute;
.cart-name{
position: relative;
//設屏小於767px css
@media only screen and (max-width: 767px) {
->
//表單頭不顯示
.tsts{
display: none;
...
thead class="tsts">
//設 td-price, td-qty, td-total 的 float, box-sizing, width
.cart-td-price{
box-sizing: border-box;
float: left;
width: 30%;
.cart-td-qty{
box-sizing: border-box;
float: left;
width: 40%;
.cart-td-total{
box-sizing: border-box;
float: left;
width: 30%;
//設 qty input 格的 min-width 小一點給手機版用
.cart-qty-input{
min-width: 40px !important;
//加 price, qty, total 上方 title
.cart-td-price:before{
content: "Price";
.cart-td-qty:before{
content: "Qty";
.cart-td-total:before{
content: "Subtotal";
//新增 td-checkbox 在表第一列
...
//表第一列放大 checkbox 方格
.cart-checkbox{
width: 20px;
height: 20px;
--- 20210211 opencart-3.0.3.6 修改 shopping cart 頁->小屏內容不超出屏幕 + 新增 checkbox 列
=================================================================================================
修改 shopping cart 頁->增加 tab
1.) joe /var/www/html/catalog/view/theme/default/template/checkout/cart.twig
//刪除原shopping cart 改為include tabcart.twig
->
{{ heading_title }}
...
{{ column_right }}
->{% include('default/template/checkout/tabcart.twig') %}
2.) joe /var/www/html/catalog/view/theme/default/template/checkout/tabcart.twig
//增加 tab 選擇器
//增加 tab 內容
{{ tab-cart }}
{{ tab-depot }}
--- 20210207 opencart-3.0.3.6 修改 shopping cart 頁->增加 tab
=================================================================================================
(!!copy時錯誤: db->oc_product->date_available: default="0000-00-00" 格式不對系統自動改為 default 無)
1.) db->oc_product 增加新欄位 domestic
(20210303 改為放在 db->oc_product_ext)
2.) joe /var/www/html/catalog/model/catalog/product.php
-> public function getProduct($product_id) {
...
'domestic' => $query->row['domestic'],
3.) joe /var/www/html/catalog/controller/product/product.php
(joe /var/www/storage/modification/catalog/controller/product/product.php 測試時用)
->
...
$data['domestic'] = floatval($product_info['domestic']);
4.) joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig
//直接調用
{{ domestic }}
--- 20210203 opencart-3.0.3.6 增加國內運費
=================================================================================================
product頁讀取欄位title + SQL資料路徑
/var/www/html/catalog/controller/product/product.php
//讀取欄位title
$this->load->language('product/product');
/var/www/html/catalog/language/en-gb/product/product.php
$_['text_brand'] = 'Brand';
$_['text_manufacturer'] = 'Brand:';
$_['text_model'] = 'Product Code:';
$_['text_reward'] = 'Reward Points:';
$_['text_points'] = 'Price in reward points:';
$_['text_stock'] = 'Availability:';
$_['text_instock'] = 'In Stock';
$_['text_tax'] = 'Ex Tax:';
//讀取 db->oc_product 送出到product.twig + popupop.twig
$data['weight'] = $product_info['weight'];
$data['weight_format'] = $this->weight->format($product_info['weight'], $product_info['weight_class_id']);
$data['length'] = $this->length->format($product_info['length'], $product_info['length_class_id']);
$data['width'] = $this->length->format($product_info['width'], $product_info['length_class_id']);
$data['height'] = $this->length->format($product_info['height'], $product_info['length_class_id']);
//原db->oc_option...4個table的欄位
oc_option->option_id 5,14,15 標準option組id->帶type,sort
oc_option_description 標準option組代表的語言,名稱,說明?
oc_option_value->option_value_id 標準option組的值的id->帶圖url,sort
oc_option_value_description 標準option組的值代表的語言,名稱
//原db->oc_product...2個table的欄位
oc_product->product_id 30 產品的id
oc_product_option->product_option_id 226,236,237 產品的option組的id
oc_product_option->option_id 5 14 15 標準option組的id
oc_product_option_value->product_option_value_id 產品的option組的值的id->帶庫存,扣庫,增減單價,積分,重量
226->15,16,28
236->29~34
237->35~40
//合併原db->oc_option...4個table欄位 -> db->oc_product...2個table
oc_product_option 加5欄位 type,sort_order / language_id,name,description
oc_product_option_value 加3欄位 image,sort_order language_id,name
//合併原db->oc_option...4個table資料 -> db->oc_product...2個table
select * from oc_product_option inner join oc_option on oc_product_option.option_id=oc_option.option_id where 1
update oc_product_option inner join oc_option on oc_product_option.option_id=oc_option.option_id set oc_product_option.type=oc_option.type,oc_product_option.sort_order=oc_option.sort_order where 1;
select * from oc_product_option inner join oc_option_description on oc_product_option.option_id=oc_option_description.option_id where 1
update oc_product_option inner join oc_option_description on oc_product_option.option_id=oc_option_description.option_id set oc_product_option.language_id=oc_option_description.language_id where 1;
update oc_product_option inner join oc_option_description on oc_product_option.option_id=oc_option_description.option_id set oc_product_option.name=oc_option_description.name where 1;
update oc_product_option inner join oc_option_description on oc_product_option.option_id=oc_option_description.option_id set oc_product_option.description=oc_option_description.description where 1;
select * from oc_product_option_value inner join oc_option_value on oc_product_option_value.option_value_id=oc_option_value.option_value_id where 1
update oc_product_option_value inner join oc_option_value on oc_product_option_value.option_value_id=oc_option_value.option_value_id set oc_product_option_value.image=oc_option_value.image where 1;
update oc_product_option_value inner join oc_option_value on oc_product_option_value.option_value_id=oc_option_value.option_value_id set oc_product_option_value.sort_order=oc_option_value.sort_order where 1;
select * from oc_product_option_value inner join oc_option_value_description on oc_product_option_value.option_value_id=oc_option_value_description.option_value_id where 1
update oc_product_option_value inner join oc_option_value_description on oc_product_option_value.option_value_id=oc_option_value_description.option_value_id set oc_product_option_value.language_id=oc_option_value_description.language_id where 1;
update oc_product_option_value inner join oc_option_value_description on oc_product_option_value.option_value_id=oc_option_value_description.option_value_id set oc_product_option_value.name=oc_option_value_description.name where 1;
//修改 /var/www/html/catalog/model/catalog/product.php 讀取SQL product option 資料
->foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) {
->joe /var/www/html/catalog/model/catalog/product.php
->
public function getProductOptions($product_id) {
...
// $product_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE po.product_id = '" . (int)$product_id . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY o.sort_order");
$product_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option po WHERE po.product_id = '" . (int)$product_id . "' AND po.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY po.sort_order");
...
// $product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_id = '" . (int)$product_id . "' AND pov.product_option_id = '" . (int)$product_option['product_option_id'] . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY ov.sort_order");
$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value pov WHERE pov.product_id = '" . (int)$product_id . "' AND pov.product_option_id = '" . (int)$product_option['product_option_id'] . "' AND pov.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY pov.sort_order");
//修改 /var/www/html/system/library/cart/cart.php 讀取SQL product option 資料
->joe /var/www/html/system/library/cart/cart.php
->
public function getProducts() {
...
// $option_query = $this->db->query("SELECT po.product_option_id, po.option_id, od.name, o.type FROM " . DB_PREFIX . "product_option po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE po.product_option_id = '" . (int)$product_option_id . "' AND po.product_id = '" . (int)$cart['product_id'] . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "'");
$option_query = $this->db->query("SELECT po.product_option_id, po.option_id, po.name, po.type FROM " . DB_PREFIX . "product_option po WHERE po.product_option_id = '" . (int)$product_option_id . "' AND po.product_id = '" . (int)$cart['product_id'] . "' AND po.language_id = '" . (int)$this->config->get('config_language_id') . "'");
...
// $option_value_query = $this->db->query("SELECT pov.option_value_id, ovd.name, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_option_value_id = '" . (int)$value . "' AND pov.product_option_id = '" . (int)$product_option_id . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
$option_value_query = $this->db->query("SELECT pov.option_value_id, pov.name, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix FROM " . DB_PREFIX . "product_option_value pov WHERE pov.product_option_value_id = '" . (int)$value . "' AND pov.product_option_id = '" . (int)$product_option_id . "' AND pov.language_id = '" . (int)$this->config->get('config_language_id') . "'");
//清空或刪原db->oc_option...4個table資料測是否成功->??表oc_option 空的OK,沒有會死??(已解決)
--- 20210203 opencart-3.0.3.6 修改合併 product option 7個 SQL table
=================================================================================================
modal 彈窗 + magnific popup
joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig
1.) $('#modal-shipping').modal('show');
//Jquery 調用 modal 彈窗
/var/www/html/catalog/view/javascript/bootstrap/js/bootstrap.js
->Modal.prototype.show = function (_relatedTarget) { ...
2.)
//修改 container 的寬度(default 750px)不要超出 modal 彈窗的寬度(default 600px)
/var/www/html/catalog/view/javascript/bootstrap/css/bootstrap.css
->
@media (min-width: 768px) {
.container {
width: 750px;
...
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
3.)
//修改 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 }}
...
$('#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
->
{{ xxxx }}
--- 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.2FREE 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.2FREE 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.2FREE 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
Search Terms
Shipping & Returns
Privacy Notice
RO FAQ
Advanced Search
My Account
Membrane Rejection Chart
Contact Us
->
Search Terms search/term/popular http://qt.wg-1.com/index.php/search/term/popular/
Block Id: 37 PWC Shipping & Returns pwc-shipping-returns
Block Id: 42 PWC Privacy Notice pwc-privacy-notice
Block Id: 44 PWC FAQ pwc-faq
Advanced Search catalogsearch/advanced http://qt.wg-1.com/index.php/catalogsearch/advanced/
My Account customer/account http://www.purewaterclub.com/index.php/customer/account
Block Id: 45 Membrane Rejection Chart membrane-rejection-chart
Block Id: 49 PWC Contact Us pwc-contact-us
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;
cp /var/www/pwpic/import/membrane-rejection-chart.png /var/www/pwpic/webimg/items/PWC-Pic/membrane-rejection-chart.png
chown www-data:www-data /var/www/pwpic/webimg/items/PWC-Pic/membrane-rejection-chart.png
rm /var/www/magento2/pub/static/frontend/Zou/ -r
php bin/magento setup:static-content:deploy en_US -f
php bin/magento indexer:reindex
php bin/magento cache:flush
chown -R www-data:www-data .
清browser cache
--- 20200417-18 AWS-QT 裝theme Zou
=========================================================================================================================
備份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
--- 20200417 12:00 AWS-QT ML完成paypal + 刷卡 + 寄信測試
=========================================================================================================================
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_ada_20200416_ok.sql
cp /var/www/pwpic/wysiwyg/ves_8pm/our-service/* /var/www/pwpic/pageimg/
FREE SHIPPING
magento2
joe pub/static/frontend/Magento/luma/en_US/requirejs-config.js
-------------------
{{widget type="Magento\Catalog\Block\Product\Widget\Link" template="product/widget/new/content/new_grid.phtml" id_path="product/1897"}}
{{widget type="Magento\Catalog\Block\Product\Widget\Link" template="product/widget/link/link_inline.phtml" id_path="product/1898"}}
{{widget type="Magento\Catalog\Block\Product\Widget\Link" template="product/widget/link/link_inline.phtml" id_path="product/1899"}}
{{widget type="Magento\Catalog\Block\Product\Widget\Link" template="product/widget/link/link_inline.phtml" id_path="product/1896"}}
{{widget type="Magento\Catalog\Block\Product\Widget\Link" template="product/widget/link/link_block.phtml" id_path="product/1895"}}
{{widget type="Magento\Catalog\Block\Product\Widget\Link" template="product/widget/link/link_block.phtml" id_path="product/1894"}}
{{block type="core/template" template="page/template.phtml"}}
mkdir -p app/design/frontend/base/default/template/page/
joe /var/www/magento2/app/design/frontend/base/default/template/page/template.phtml
{{widget type="Magento\Catalog\Block\Product\Widget\NewWidget" display_type="all_products" show_pager="0" products_count="10" template="product/widget/new/content/new_grid.phtml"}}
{{widget type="Magento\Catalog\Block\Product\Widget\NewWidget" display_type="all_products" show_pager="1" products_per_page="5" products_count="10" template="product/widget/new/column/new_default_list.phtml" page_var_name="pdjbbe"}}
cd /var/www/pwpic/pageimg/
wget 118.163.15.73/owl.zip
unzip -q owl.zip
--- 20200416 AWS-QT 未裝 theme Zou 首頁block直接加跑馬燈 失敗
=========================================================================================================================
DELETE FROM core_config_data WHERE path LIKE 'payment/paypal_express%' ; 影响了 32 行。 (查询花费 0.0049 秒。)
DELETE FROM core_config_data WHERE path LIKE 'payment/%' AND NOT(path LIKE 'payment/authorizenet%');
DELETE FROM core_config_data WHERE path LIKE 'checkout%' ; 影响了 12 行。 (查询花费 0.0041 秒。)
DELETE FROM core_config_data WHERE path LIKE '%checkout%' ; 影响了 3 行。 (查询花费 0.0033 秒。)
DELETE FROM core_config_data WHERE path LIKE 'carriers%' ; 影响了 56 行。 (查询花费 0.0050 秒。)
DELETE FROM core_config_data WHERE path LIKE 'shipping%' ; 影响了 8 行。 (查询花费 0.0033 秒。)
DELETE FROM core_config_data WHERE path LIKE 'tax%' ; 影响了 27 行。 (查询花费 0.0034 秒。)
DELETE FROM core_config_data WHERE path LIKE 'paypal%' ; 影响了 27 行。 (查询花费 0.0052 秒。)
DELETE FROM core_config_data WHERE path LIKE 'payment/%' ; 影响了 40 行。 (查询花费 0.0072 秒。)
payment/authorizenet_acceptjs/cctypes
payment/authorizenet_acceptjs/currency
payment/authorizenet_acceptjs/order_status
payment/authorizenet_acceptjs/payment_action
SELECT * 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' ;
--------------------------------------
刪除233筆payment,只留下參考empty的8筆,否則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' ;
影响了 233 行。 (查询花费 0.0077 秒。)
--------------------------------------
(20200416 10:30:47)
ADA完成paypal + 刷卡等ML測試
--- 20200416 AWS-QT Check out 空白
=========================================================================================================================
----------------------------------------------------
/dev/xvda1 30G 26G 3.2G 90% /
(20200415 23:57)點Flush Cache Storage按鈕->(等於同時按下面3按鈕)
/dev/xvda1 30G 20G 9.1G 69% /
root@awsko:/var/www/html/magento8pm# du -sh -> 768M
----------------------------------------------------
purewaterclub.com
buck4u.com
{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="1"}}
qt_pwc_dir_47
qt_pwc_dir_50
qt_pwc_dir_68
qt_pwc_dir_65
qt_service
ln -s /var/www/html/pwpic/pageimg/ /var/www/html/magento8pm/pub/media/
cd /var/www/html/pwpic/pageimg/
wget 118.163.15.73/qt-dir-1.zip
unzip -q qt-dir-1.zip
chown -R www-data:www-data .
--- 20200416 AWS-QT + AWS-DV 建新block + 改目錄連結頁
=========================================================================================================================
T-1.)全新重裝magento2.3.4 + 導入magento8pm_20200413.sql + 修改 + 升級資料庫
導出產生資料庫
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_8pm_234_20200413_ok.sql
mysql -u root -prevres88
mysql>DROP DATABASE magento2;
mysql>CREATE DATABASE magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.sql
先修改資料庫
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 cataloginventory_stock_cl ; (change log 不要刪)
DROP TABLE catalogrule_product_cl ;
DROP TABLE catalogrule_rule_cl ;
DROP TABLE catalogsearch_fulltext_cl ;
DROP TABLE catalogsearch_fulltext_scope2 ;
DROP TABLE catalogsearch_fulltext_scope3 ;
DROP TABLE catalogsearch_fulltext_scope4 ;
DROP TABLE catalogsearch_fulltext_scope5 ;
DROP TABLE catalogsearch_fulltext_scope6 ;
(剩342 = 250 + 92表)
DROP TABLE catalog_category_entity_text_20191212 ;
DROP TABLE catalog_category_product_cl ;
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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='2' WHERE path='design/theme/theme_id' ;
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM admin_user WHERE user_id < 5 ;
清空 cms_block,cms_block_store,cms_page,cms_page_store
TRUNCATE TABLE cms_block;
TRUNCATE TABLE cms_block_store;
TRUNCATE TABLE cms_page;
TRUNCATE TABLE cms_page_store;
設cms page
INSERT INTO cms_page (title,page_layout,identifier,content) VALUES ('purewaterclub.com','1column-fullwidth','pwc-home','PWC');
INSERT INTO cms_page (title,page_layout,identifier,content) VALUES ('buck4u.com','1column-fullwidth','buck4u-home','Buck4U');
設default-cms home page
INSERT INTO core_config_data (scope,scope_id,path,value) VALUES ('default',0,'web/default/cms_home_page','pwc-home');
??(前台報錯)
DELETE FROM url_rewrite WHERE entity_type='category' ;
全新安裝magento 2.3.4
mv magento2 magento2-234-8pm-20200414-ok
cd /var/www/magento2/
wget 118.163.15.73/magento2.zip (Magento-CE-2.3.4-2020-01-16-11-19-26.zip)
unzip -q magento2.zip
---------------
先停止sudo systemctl stop php7.1-fpm->才不會出現報錯
sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx
key=換?
An existing user has the given username but different email. Username and e
mail both need to match an existing user or both be new.
改admin-email->ada@ksoffice.com.tw(原dv4ml@dacomputing.com)
-----------------
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c1007bf562f4d7ee82e5eef4b8865b" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=ada@ksoffice.com.tw \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
Nothing to import.
建圖片連結
cd /var/www/magento2/pub/media/
rm catalog -r
ln -s /var/www/pwpic/catalog/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/webimg/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/pageimg/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/logo/ /var/www/magento2/pub/media/ (20200419 新增)
ln -s /var/www/pwpic/favicon/ /var/www/magento2/pub/media/ (20200419 新增)
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
升級database
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy en_US -f
Execution time: 6.8340449333191
php bin/magento setup:di:compile
root@ip-172-31-40-85:/var/www/magento2# php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 7/7 [=============] 100% 1 min 359.0 MiB
Generated code and dependency injection configuration successfully.
php bin/magento indexer:reindex
php bin/magento cache:flush
chown -R www-data:www-data .
->前台報錯
mag2 error
2062f7ab27094d8e234193d0ad08a82944228b6f404baadb72182b1393407534
cp var/report/2062f7ab27094d8e234193d0ad08a82944228b6f404baadb72182b1393407534 /var/www/html/err-105
http://3.22.57.114/err-105
->Item (Magento\\Catalog\\Model\\Category\\Interceptor) with the same ID
DELETE FROM url_rewrite WHERE entity_type='category' ;
php bin/magento indexer:reindex
->前台OK
--------------------------------------
T-2.)magento2.3.4(用T-1不重裝) + 導入magento8pm_20200413.sql + 修改資料庫 + 刪無用data + 升級資料庫
備份+導入資料庫
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_8pm_234_20200414_ok.sql
mysql -u root -prevres88
mysql>DROP DATABASE magento2;
mysql>CREATE DATABASE magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.sql
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 ;
(剩350 = 250 + 100表)
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.purewaterclub.com/';
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
設default-cms home page
INSERT INTO core_config_data (scope,scope_id,path,value) VALUES ('default',0,'web/default/cms_home_page','home');
UPDATE core_config_data SET value='home' WHERE path='web/default/cms_home_page' ;
刪ves data + 無用
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM admin_user WHERE user_id < 5 ;
TRUNCATE TABLE cms_block_store;
TRUNCATE TABLE cms_block;
DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 ;
UPDATE cms_page SET content=identifier,content_heading='',custom_theme='' WHERE 1 ;
DELETE FROM cms_page_store WHERE page_id <>2 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
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' ;
升級資料庫
php bin/magento setup:upgrade
先作deploy否則compile卡住
php bin/magento setup:static-content:deploy en_US -f
Execution time: 21.4403860569
再作compile否則前台空白
php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 7/7 [======================] 100% 1 min 359.0 MiB
Generated code and dependency injection configuration successfully.
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean
chown -R www-data:www-data .
->前台空白
--------------------------------------
T-3.)magento2.3.4(用T-1不重裝) + 導入magento2_8pm_234_20200414_ok.sql(直接用T-1不升級)
備份+導入資料庫
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_8pm_234_20200414_1_no_front.sql
mysql -u root -prevres88
mysql>DROP DATABASE magento2;
mysql>CREATE DATABASE magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento2_8pm_234_20200414_ok.sql
->前台OK
--------------------------------------
T-4.)magento2.3.4(御載再命令列安裝) + 導入magento2_8pm_234_20200414_1_no_front.sql(直接用T-2 改名稱 magento2_no_front 不升級)
導入資料庫改名稱為magento2_no_front(原為magento2)
mysql -u root -prevres88 < /var/www/bk-gz/magento2_8pm_234_20200414_1_no_front.sql
joe /var/www/bk-gz/magento2_8pm_234_20200414_1_no_front.sql
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2_no_front` /*!40100 DEFAULT CHARACTER S
USE `magento2_no_front`;
->
php bin/magento setup:uninstall
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c1007bf562f4d7ee82e5eef4b8865b" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2_no_front \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=ada@ksoffice.com.tw \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
Nothing to import.
cd /var/www/magento2/pub/media/
rm catalog -r
ln -s /var/www/pwpic/catalog/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/webimg/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/pageimg/ /var/www/magento2/pub/media/
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
php bin/magento indexer:reindex
php bin/magento cache:flush
chown -R www-data:www-data .
->前台OK,search沒有
--------------------------------------
T-5.)magento2.3.4(御載再命令列安裝) + magento2_no_front資料庫(因命令列漏改誤用T-4)
御載+重新安裝mag2
php bin/magento setup:uninstall
[SUCCESS]: Magento uninstallation complete.
---------------
先停止sudo systemctl stop php7.1-fpm->才不會出現報錯
sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx
-----------------
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c1007bf562f4d7ee82e5eef4b8865b" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2_no_front \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=ada@ksoffice.com.tw \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
Nothing to import.
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
升級資料庫
php bin/magento setup:upgrade
先作deploy否則compile卡住
php bin/magento setup:static-content:deploy en_US -f
Execution time: 26.365685939789
再作compile否則前台空白
php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 7/7 [============================] 100% 48 secs 359.0 MiB
Generated code and dependency injection configuration successfully.
php bin/magento indexer:reindex
php bin/magento cache:clean
chown -R www-data:www-data .
->前台OK,search沒測
--------------------------------------
T-6.)magento2.3.4(御載再命令列安裝) + 導入magento8pm_20200413.sql + 修改資料庫 + 刪無用data + 升級資料庫
導入資料庫
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.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 ;
(剩350 = 250 + 100表)
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.purewaterclub.com/';
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
設default-cms home page
INSERT INTO core_config_data (scope,scope_id,path,value) VALUES ('default',0,'web/default/cms_home_page','home');
UPDATE core_config_data SET value='home' WHERE path='web/default/cms_home_page' ;
刪ves data + 無用
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM admin_user WHERE user_id < 5 ;
TRUNCATE TABLE cms_block_store;
TRUNCATE TABLE cms_block;
DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 ;
UPDATE cms_page SET content=identifier,content_heading='',custom_theme='' WHERE 1 ;
DELETE FROM cms_page_store WHERE page_id <>2 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
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' ;
御載+重新安裝mag2
php bin/magento setup:uninstall
[SUCCESS]: Magento uninstallation complete.
---------------
先停止sudo systemctl stop php7.1-fpm->才不會出現報錯
sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx
-----------------
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c1007bf562f4d7ee82e5eef4b8865b" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=ada@ksoffice.com.tw \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
Nothing to import.
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
升級資料庫
php bin/magento setup:upgrade
先作deploy否則compile卡住
php bin/magento setup:static-content:deploy en_US -f
Execution time: 25.61025595665
再作compile否則前台空白
php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 7/7 [============================] 100% 48 secs 359.0 MiB
Generated code and dependency injection configuration successfully.
php bin/magento indexer:reindex
php bin/magento cache:clean
chown -R www-data:www-data .
->前台空白,直接連其他OK
http://qt.wg-1.com/ro/replacement.html
-----------------------------
magento 2.1.9 vs 2.3.4 變化->如果沒修改造成前台空白
layout->1column-fullwidth->1column
php bin/magento cache:flush
INSERT INTO cms_page (title,page_layout,identifier,content) VALUES ('buck4u.com','1column-fullwidth','buck4u-home','Buck4U');
-----------------------------
--------------------------------------
(20200415 09:38)
T-7.)magento2.3.4(直接用T-6) + 導入magento8pm_20200413.sql + 修改資料庫 + 刪無用data + 升級資料庫
備份+導入資料庫
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_8pm_234_20200414_2_layout_ok.sql
mysql -u root -prevres88
mysql>DROP DATABASE magento2;
mysql>CREATE DATABASE magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.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 ;
(剩350 = 250 + 100表)
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.purewaterclub.com/';
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
設default-cms home page
INSERT INTO core_config_data (scope,scope_id,path,value) VALUES ('default',0,'web/default/cms_home_page','home');
??->UPDATE core_config_data SET value='home' WHERE path='web/default/cms_home_page' ;
改cms-page(必改layout否則版本差別造成首頁空白)
UPDATE cms_page SET page_layout='1column',content=identifier,content_heading='',custom_theme='' WHERE 1 ;
刪ves data + 無用
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM admin_user WHERE user_id < 5 ;
TRUNCATE TABLE cms_block_store;
TRUNCATE TABLE cms_block;
DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 ;
DELETE FROM cms_page_store WHERE page_id <>2 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
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' ;
升級資料庫
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
->OK,後台product->attribute set故障
--------------------------------------
(20200415 10:33)
T-8.)magento2.3.4(御載再命令列安裝) + 導入magento8pm_20200413.sql + 修改資料庫 + 刪無用data + 升級資料庫
先御載mag2
php bin/magento setup:uninstall
[SUCCESS]: Magento uninstallation complete.
導入資料庫
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.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 ;
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.purewaterclub.com/';
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
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=identifier,content_heading='',custom_theme='' WHERE 1 ;
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM admin_user WHERE user_id < 5 ;
TRUNCATE TABLE cms_block_store;
TRUNCATE TABLE cms_block;
DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 ;
DELETE FROM cms_page_store WHERE page_id <>2 ;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
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' ;
重新安裝mag2
---------------
先停止再重啟才不會出現報錯
sudo systemctl stop php7.1-fpm
sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx
-----------------
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c1007bf562f4d7ee82e5eef4b8865b" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=ada@ksoffice.com.tw \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
Nothing to import.
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
升級資料庫
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
->和T7一樣
--------------------------------------
(20200415 10:53)
T-9.)全新安裝magento2.3.4(御載再命令列安裝) + magento2資料庫(直接用T-7)
mv magento2 magento2-234-8pm-20200415-ok
cd /var/www/magento2/
wget 118.163.15.73/magento2.zip (Magento-CE-2.3.4-2020-01-16-11-19-26.zip)
unzip -q magento2.zip
建圖片連結
cd /var/www/magento2/pub/media/
rm catalog -r
ln -s /var/www/pwpic/catalog/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/webimg/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/pageimg/ /var/www/magento2/pub/media/
sudo systemctl stop php7.1-fpm
sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c1007bf562f4d7ee82e5eef4b8865b" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=ada@ksoffice.com.tw \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
Nothing to import.
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
->和T8一樣
T-10.)magento2_20200413_234_empty
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
INSERT INTO core_config_data (scope,scope_id,path,value) VALUES ('default',0,'admin/usage/enabled','0');
正在显示第 0 - 24 行 (共 644 行, 查询花费 0.0003 秒。)表: core_config_data_000
delete from core_config_data where path like 'admin/security%' 正在显示第 0 - 24 行 (共 638 行, 查询花费 0.0003 秒。)
delete from core_config_data where path = 'admin/usage/enabled' 影响了 1 行。 (查询花费 0.0031 秒。)
delete from core_config_data where path like 'carriers%' 影响了 56 行。 (查询花费 0.0058 秒。)
update core_config_data set value='2' where path='catalog/category/root_id' 影响了 1 行。 (查询花费 0.0025 秒。)
delete from core_config_data where path like 'catalog%' AND path<>'catalog/category/root_id' 影响了 65 行。 (查询花费 0.0041 秒。)
delete from core_config_data where path like 'checkout%' 影响了 7 行。 (查询花费 0.0029 秒。)
delete from core_config_data where path like 'cms%' 影响了 2 行。 (查询花费 0.0034 秒。)
skip----------
delete from core_config_data where path like 'design%' 影响了 115 行。 (查询花费 0.0037 秒。)
delete from core_config_data where path like 'customer%' 影响了 21 行。 (查询花费 0.0029 秒。)
delete from core_config_data where path like 'dev%' 影响了 6 行。 (查询花费 0.0030 秒。)
test-ok-1-----
delete from core_config_data where path='dev/css/merge_css_files'
delete from core_config_data where path='dev/css/minify_files'
delete from core_config_data where path='dev/debug/template_hints_admin'
delete from core_config_data where path='dev/debug/template_hints_blocks'
delete from core_config_data where path='dev/debug/template_hints_storefront'
delete from core_config_data where path='dev/front_end_development_workflow/type'
delete from core_config_data where path='dev/grid/async_indexing'
delete from core_config_data where path='dev/image/default_adapter'
delete from core_config_data where path='dev/restrict/allow_ips'
delete from core_config_data where path='dev/static/sign'
delete from core_config_data where path='dev/template/allow_symlink'
delete from core_config_data where path='
delete from core_config_data where path='
delete from core_config_data where path='
delete from core_config_data where path='
delete from core_config_data where path='
delete from core_config_data where path='
--------------------------------------
(20200415 15:27)
T-11.)magento2.3.4(T-10) + 導入magento8pm_20200413.sql + 修改資料庫 + 刪無用data + 升級資料庫
導入資料庫
mysql -u root -prevres88
mysql>TRUNCATE DATABASE magento2;
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.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 ;
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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.buck4u.com/';
UPDATE core_config_data SET value='https://qt.wg-1.com/' WHERE value='https://www.purewaterclub.com/';
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ;
DELETE FROM core_config_data WHERE path='dev/static/sign';
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=identifier,content_heading='',custom_theme='' WHERE 1 ;
DELETE FROM core_config_data WHERE path LIKE 'ves%' ;
DELETE FROM theme WHERE theme_id > 3 ;
DELETE FROM admin_user WHERE user_id < 5 ;
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) ;
DELETE FROM cms_page WHERE page_id <> 2 AND page_id <> 30 AND page_id <> 36 ;
TRUNCATE TABLE cms_block_store;
TRUNCATE TABLE cms_block;
DELETE FROM store WHERE store_id=1 OR store_id=2 ;
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' ;
升級資料庫
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento indexer:reindex
chown -R www-data:www-data .
->OK
----------------------------------------
刪除此行可解決product attribute set 破圖故障(2.3.4->1才正常)
DELETE FROM core_config_data WHERE path='dev/static/sign'
Stores->Configuration->Advanced->Developer->Static Files Settings->Sign Static Files->(?default 2.1.9:No-0 / 2.3.4:Yes-1)
----------------------------------------
----------------------------------------
解決cms page->store view設定問題,否則cms page不生效(0:All Store Views)
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) ;
----------------------------------------
(20200415 16:22)
備份-ada開始測paypal,刷卡,寄email
cp magento2 magento2-234-8pm-20200415-ok -r
mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_8pm_234_20200415_before_ada_ok.sql
--- 20200414-15 AWS-QT 全新magento2.3.4 + copy sql AWS-DV magento8pm 成功
=========================================================================================================================
------------------------------------------------------------------
(20200413 17:00)
AWS-QT重開機->IP:3.22.57.114(原3.134.105.225)
aws.wg-1.com(pwc 圖片href連結)
qt.wg-1.com(2.3.4版本test)
qtpwc.wg-1.com(??)
zou.wg-1.com(??)
------------------------------------------------------------------
T-0.)轉移資料庫
導出/備份資料庫aws-dv sql->magento8pm->magento8pm_20200413.sql
cd /var/www/html/
mysqldump -u root -prevres88 --databases magento8pm > magento8pm_20200413.sql
->48557821 Apr 13 01:15 magento8pm_20200413.sql
下載aws-qt
cd /var/www/bk-gz/
wget 3.22.57.63/magento8pm_20200413.sql
修改導入資料庫名稱
joe /var/www/bk-gz/magento8pm_20200413.sql->
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2` /*!40100 DEFAULT CHARACTER S
USE `magento2`;
導入資料庫
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.sql
T-1.)magento2-234-ok + sql magento2_20200406-ok
複制Data
cp sql->magento2_20200406-ok->magento2
mysqldump -u root -prevres88 --databases magento2_20200406-ok > /var/www/bk-gz/magento2_20200406.sql
joe /var/www/bk-gz/magento2_20200406.sql->
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2` /*!40100 DEFAULT CHARACTER S
USE `magento2`;
->
mysql -u root -prevres88 < /var/www/bk-gz/magento2_20200406.sql
cd /var/www/
cp magento2-234-ok magento2 -r
cd magento2
joe app/etc/env.php->
'username' => 'root',
php bin/magento cache:flush
php bin/magento setup:upgrade
chown -R www-data:www-data .
->ok
T-2.)magento2-234-ok + sql magento8pm_20200413
複制Data
cp sql->magento8pm_20200413->magento2
mysql -u root -prevres88
mysql>DROP DATABASE magento2;
joe /var/www/bk-gz/magento8pm_20200413.sql->
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `magento2` /*!40100 DEFAULT CHARACTER S
USE `magento2`;
->
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.sql
修改SQL
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.buck4u.com/'; (影响了 5 行)
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.purewaterclub.com/'; (影响了 2 行)
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id'; (影响了 4 行)
DELETE FROM theme WHERE theme_id > 3 ; (影响了 3 行)
UPDATE cms_page SET content='buck4u' WHERE page_id=36 ; (buck4u.com)
UPDATE cms_page SET content='pwc' WHERE page_id=30 ; (purewaterclub.com)
cd /var/www/magento2/
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US -f
Execution time: 21.579952001572
chown -R www-data:www-data .
->前台空白
T-3.)重裝magento2.3.4 + sql empty
cd /var/www/magento2/
wget 118.163.15.73/magento2.zip (Magento-CE-2.3.4-2020-01-16-11-19-26.zip)
unzip -q magento2.zip
---------------
先停止sudo systemctl stop php7.1-fpm->才不會出現報錯
-----------------
mysql -u root -prevres88
mysql>DROP DATABASE magento2;
mysql>CREATE DATABASE magento2;
cd /var/www/magento2/
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c102e5eef4b8865b07bf562f4d7ee8" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=root \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=dv4ml@dacomputing.com \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
chown -R www-data:www-data .
->OK
T-4.)重裝magento2.3.4 + sql magento8pm_20200413
複制Data
cp sql->magento8pm_20200413->magento2
mysql -u root -prevres88 < /var/www/bk-gz/magento8pm_20200413.sql
修改SQL
改base url為qt.wg-1.com->
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.buck4u.com/'; (影响了 5 行)
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://www.purewaterclub.com/'; (影响了 2 行)
改前台theme為luma->
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ; (影响了 4 行)
刪theme->
DELETE FROM theme WHERE theme_id > 3 ; (影响了 3 行)(只留admin blank luma)
改首頁頁面->
UPDATE cms_page SET content='buck4u' WHERE page_id=36 ; (buck4u.com)
UPDATE cms_page SET content='pwc' WHERE page_id=30 ; (purewaterclub.com)
先升級database
cd /var/www/magento2/
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento indexer:reindex
chown -R www-data:www-data .
->前台空白
(20200414 02:00)
T-4-1.)再更換core_config_data
copy magento2_20200413_234_empty.core_config_data -> magento2.core_config_data
清空magento2->core_config_data;
cp magento2-219-check-ok:core_config_data data-> magento2:core_config_data
??->catalog/category/root_id->NULL??
->報錯找不到theme 7
{"0":"Unable to load theme by specified key: '7'","1":
T-4-2.)清空cms_page + cms_block
->報錯找不到theme 7
T-4-3.)登入後台新增cms page(ID:1 Title:xxx)
->後台檢查default page出現xxx選擇
T-4-4.)設定website web default CMS Home Page -> xxx
->前台OK
表: core_config_data->web/default/cms_home_page -> xxx
表: core_config_dataBK->web/default/cms_home_page -> 8pm-home-page-default
--- 20200413 AWS-QT magento2 + copy sql AWS-DV magento8pm
=========================================================================================================================
0.)改DNS + apache
設8pm.wg-1.com->3.22.57.63 (原mag.wg-1.com)
cd /etc/apache2/sites-available
cp mag-wg-1.conf 8pm-wg-1.conf
joe 8pm-wg-1.conf
->
DocumentRoot /var/www/html/magento2-qt
ServerName 8pm.wg-1.com
ErrorLog /var/log/apache2/error_log
CustomLog /var/log/apache2/access_log common
Options FollowSymLinks
AllowOverride all
Require all granted
# Order allow,deny
# Allow from all
->
ln -s /etc/apache2/sites-available/8pm-wg-1.conf /etc/apache2/sites-enabled/8pm-wg-1.conf
service apache2 restart
1.)copy magento8pm + sql
cp sql->magento8pm->magento2_qt
刪表ves_megamenu_item-0(20200411 8pm已刪)
cd /var/www/html/
cp magento8pm magento2-qt -r
cd magento2-qt
joe app/etc/env.php
'dbname' => 'magento2_qt',
/usr/bin/php bin/magento cache:flush
/usr/bin/php bin/magento indexer:reindex
chown -R www-data:www-data .
php bin/magento setup:upgrade --keep-generated
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US -f
New version of deployed files: 1586406539
php bin/magento setup:db:status
Declarative Schema is not up to date
Run 'setup:upgrade' to update your DB schema and data.
Uncaught ReferenceError: Unable to process binding "if: function(){return loading }"
Message: loading is not defined
at if (eval at createBindingsStringEvaluator (knockout.js:2982), :3:55)
at ko.computed.disposeWhenNodeIsRemoved (knockout.js:4381)
at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout.js:2173)
at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout.js:2140)
at Function.evaluateImmediate (knockout.js:2101)
at Object.ko.computed.ko.dependentObservable
2.)修改SQL
------------------------------------
mag2 表結構-ref
表: store
store_website(website)->store_group(store)->store(store view)
表: theme->theme_id
1->Magento/blank
2->Magento/luma
7->Venustheme/8pm
9->Venustheme/7pm
11->Venustheme/6pm
表: core_config_data->path='design/theme/theme_id'
->scope(default,websites,stores)->value(thene_id)
------------------------------------
UPDATE core_config_data SET value='http://8pm.wg-1.com/' WHERE value='http://www.buck4u.com/' ; (影响了 5 行)
UPDATE core_config_data SET value='http://8pm.wg-1.com/' WHERE value='http://www.purewaterclub.com/' ; (影响了 2 行)
UPDATE core_config_data SET value='http://8pm.wg-1.com/' WHERE value='http://zou.wg-1.com/' ; (影响了 2 行)(20200411 8pm已刪)
改website aws-219->default store->b4u(20200411 8pm已改)
刪store->x-zou + store view->pwc_buck4aqua(20200411 8pm已刪)
改首頁頁面->
UPDATE cms_page SET content='buck4u' WHERE page_id=36 ; (buck4u.com)
UPDATE cms_page SET content='pwc' WHERE page_id=30 ; (purewaterclub.com)
改前台theme為luma->
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id' ; (影响了 4 行)
------------
備份sql->magento2_qt_bk_1
mysql -u root -prevres88
mysql>CREATE DATABASE magento2_qt_bk_1 ;
mysqldump -u root -prevres88 --add-drop-table magento2-qt| mysql -u root -prevres88 magento2_qt_bk_1
刪theme->
先刪目錄
cd app/design/frontend/
rm Venustheme -r
DELETE FROM theme WHERE theme_id > 3 ; (留admin blank luma)
刪store->
SELECT * FROM store WHERE group_id=1 ; (zou)
DELETE FROM store WHERE group_id=1 ;
刪cms_page->
SELECT * FROM cms_page WHERE page_id<>30 AND page_id<>36 ; (purewaterclub.com) (buck4u.com)
DELETE FROM cms_page WHERE page_id<>30 AND page_id<>36 ;
清空cms_page_store,cms_block,cms_block_store
TRUNCATE cms_page_store;
TRUNCATE cms_block;
TRUNCATE cms_block_store;
------------
備份sql->magento2_qt_bk_2
mysql -u root -prevres88
mysql>CREATE DATABASE magento2_qt_bk_2 ;
mysqldump -u root -prevres88 --add-drop-table magento2-qt| mysql -u root -prevres88 magento2_qt_bk_2
關插件 Ves
/usr/bin/php bin/magento module:status
/usr/bin/php bin/magento module:disable --clear-static-content Ves_All
/usr/bin/php bin/magento module:disable --clear-static-content Ves_BaseWidget
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Blog
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Brand
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Megamenu
/usr/bin/php bin/magento module:disable --clear-static-content Ves_PageBuilder
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Productlist
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Setup
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Testimonial
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Themesettings
後刪目錄(會出現mcrypt錯誤->已解決)
---- Crypt.php bug ---------------------------
[Exception]
Deprecated Functionality: Function mcrypt_module_open() is deprecated in /v
ar/www/html/magento2-qt/vendor/magento/framework/Encryption/Crypt.php on li
ne 54
->
joe vendor/magento/framework/Encryption/Crypt.php
->在function mcrypt_xxx前面加@
line 54: $this->_handle = @mcrypt_module_open($cipher, '', $mode, '');
line 80: @mcrypt_module_close($this->_handle);
line 56: $maxKeySize = @mcrypt_enc_get_key_size($this->_handle);
line 62: $initVectorSize = @mcrypt_enc_get_iv_size($this->_handle);
line 83: @mcrypt_generic_init($this->_handle, $key, $initVector);
line 93: @mcrypt_generic_deinit($this->_handle);
line 94: @mcrypt_module_close($this->_handle);
line 138: return @mcrypt_generic($this->_handle, $data);
line 152: $data = @mdecrypt_generic($this->_handle, $data);
------------------------------------------------
cd app/code
rm MageVision -r
rm Ves -r
刪Ves表
------------
導出sql->magento2_qt->magento2_qt_20200412.sql
mysqldump -u root -prevres88 --databases magento2_qt > magento2_qt_20200412.sql
->
mysql -u root -prevres88
mysql>SOURCE /var/www/magento2_qt_20200412.sql;
------------
備份sql->magento2_qt->magento2_qt_20200412
mysql -u root -prevres88
mysql>CREATE DATABASE magento2_qt_20200412 ;
mysqldump -u root -prevres88 --add-drop-table magento2_qt| mysql -u root -prevres88 magento2_qt_20200412
改magento2_qt,magento2_qt_20200412->
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://8pm.wg-1.com/' ; (影响了 7 行)
4.)magento2-20200407-org-ok (2.3.4 + Bss + Zou) + magento2_qt
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento indexer:reindex
chown -R www-data:www-data .
->page,block,product->OK
8pm.wg-1.com
8pm.wg-1.com/admin_lak7t5/
service apache2 restart
DROP DATABASE magento2-qt;
mysql>CREATE DATABASE magento2_qt ;
mysqldump -u root -prevres88 --add-drop-table magento2_qt_bk_2| mysql -u root -prevres88 magento2_qt
改store->default page->CMS Home Page->Use Website
category error : Item (Magento\Catalog\Model\Category\Interceptor) with the same ID “191” already exists
DELETE FROM url_rewrite WHERE entity_type='category'
php bin/magento setup:db:status
php bin/magento setup:db-schema:upgrade
php bin/magento setup:db-data:upgrade
php bin/magento
php bin/magento
--- 20200411-12 AWS-DV magento + sql
=========================================================================================================================
----------------------------------------------------
/dev/xvda1 30G 26G 3.8G 88% /
(20200410 18:00)點4按鈕->
/dev/xvda1 30G 19G 11G 65% /
root@awsko:/var/www/html/magento8pm# du -sh -> 755M
----------------------------------------------------
後台page,block,product無法正常使用
1.)magento2-20200407-org-ok (2.3.4 + Bss + Zou) + magento2_20200406-ok (import 14 items + test page)
cp sql->magento2_20200406-ok->magento2
cp magento2-20200407-org-ok/ magento2 -r
cd /var/www/magento2
cp app/etc/env.php app/etc/env.php-0
joe app/etc/env.php
'username' => 'root',
php bin/magento indexer:reindex
chown -R www-data:www-data .
->page,block,product->OK
2.)magento2-20200407-org-ok (2.3.4 + Bss + Zou) + magento8pm-20200406 (aws-dv sql org)
cp sql->magento8pm-20200406->magento2
改base url->default->web/unsecure/base_url->http://qt.wg-1.com/ (原http://www.buck4u.com/)
表core_config_data->
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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='http://qt.wg-1.com/' WHERE value='http://zou.wg-1.com/';
改首頁+store theme(1:blank,2:luma)
UPDATE core_config_data SET value='2' WHERE path='design/theme/theme_id';
刪不要的theme -> sql->table->theme刪不要的theme
表theme->
DELETE FROM theme WHERE theme_id > 3 ;
刪Ves theme->無效
DELETE FROM cms_page_store WHERE page_id > 4; 影响了 35 行。 (查询花费 0.0064 秒。)
DELETE FROM cms_page WHERE page_id > 10; 影响了 32 行。 (查询花费 0.0126 秒。)
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US -f
New version of deployed files: 1586406539
chown -R www-data:www-data .
->page,block,product->失敗
3.)magento2-20200407-org-ok (2.3.4 + Bss + Zou) + magento2-219-org-ok (aws-qt mag2 2.1.9 自動產生空sql)
cp sql->magento2-219-org-ok->magento2
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento indexer:reindex
chown -R www-data:www-data .
->page,block,product->OK
--- 20200410 AWS-QT magento 2.3.4 + sql
=========================================================================================================================
mv magento2 magento2-219-qt-wk
cp magento2-234-ok/ magento2 -r
cd magento2
chown -R www-data:www-data .
joe /etc/nginx/sites-available/qt-wg-1
upstream fastcgi_backend {
server unix:/run/php/php7.2-fpm.sock;
}
joe /etc/php/7.2/fpm/pool.d/www.conf
user = www-data
group = www-data
;user = lee
;group = lee
listen.owner = www-data
listen.group = www-data
;listen.owner = lee
;listen.group = lee
joe app/etc/env.php
'username' => 'root',
sudo systemctl restart nginx
sudo systemctl restart php7.2-fpm
apt-cache pkgnames | grep php7.2
rm /usr/bin/php
cp /usr/bin/php7.2 /usr/bin/php
PHP 7.2.29-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 20 2020 13:54:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.29-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy -f
Execution time: 36.79079914093
->New version of deployed files: 1586443960
php bin/magento cache:clean
chown -R www-data:www-data .
rename sql->magento2->magento2-234-wk
cp sql->magento2-qt->magento2
error->INSERT INTO `db` VALUES("localhost", "magento2", "magento_user", "Y", "Y", "Y", "Y", "Y", "Y", "N", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y");
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento cache:clean
chown -R www-data:www-data .
php bin/magento cache:flush
mv magento2 magento2-219-qt-wk
備份->rename sql->magento2 magento2-129-qt-wk
mysql -u root -p
->root + revres88
mysql>
CREATE DATABASE magento2 CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON magento2.* TO magento_user@localhost IDENTIFIED BY 'revres88';
quit
cd /var/www/
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2
/root/.config/composer/auth.json
su lee
cd /var/www/magento2/
wget 118.163.15.73/magento2.1.9.tar.gz (Magento-CE-2.1.9-2017-09-13-03-35-18.tar.gz)
tar -xzf magento2.1.9.tar.gz
composer install -v
error
UPDATE `db`SET Db = "magento2" where Db = "magento2-219-qt-wk";
php bin/magento config:set system/backup/functionality_enabled 1
php bin/magento setup:backup --db
composer require magento/product-community-edition 2.3.4 --no-update
wget https://raw.githubusercontent.com/magento/magento2/2.3.0/dev/tools/UpgradeScripts/pre_composer_update_2.3.php
php -f pre_composer_update_2.3.php -- --root='项目根目录路径' --repo=https://repo.magento.com/
wget https://raw.githubusercontent.com/magento/magento2/2.3.0/dev/tools/UpgradeScripts/pre_composer_update_2.3.php
php -f pre_composer_update_2.3.php -- --root='/var/www/magento2' --repo=https://repo.magento.com/
composer update
git checkout tags/2.3.4 -b 2.3.4
成功備份
cp magento2 magento2-234-pwc-20200409-ok -r
cp sql->magento2->magento2-234-pwc-20200409-ok
error->ALTER TABLE `catalog_eav_attribute`
ADD CONSTRAINT `CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE;
--- 20200410 AWS-QT upgrade magento 2.1.9 -> 2.3.4 第2次失敗
=========================================================================================================================
chown lee:lee . -hR
su lee
php bin/magento maintenance:enable
cp composer.json composer.json-0
composer remove magento/product-community-edition --no-update
composer show magento/product-community-edition 2.3.* --all | grep -m 1 versions
composer require magento/product-community-edition=2.3.4 --no-update
->./composer.json has been updated
php bin/magento maintenance:enable
composer require magento/product-community-edition 2.3.4 --no-update
composer update (2020040921:30-22:36) (2020040922:57-)
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
->New version of deployed files: 1586443960
php bin/magento indexer:reindex
php bin/magento maintenance:disable
php bin/magento cache:clean
bin/magento --version
dh -sh
--- 20200409 AWS-QT upgrade magento 2.1.9 -> 2.3.4 第1次失敗
=========================================================================================================================
0.)備份magento2->magento2-232-ok
cd /var/www/
mv magento2 magento2-234-ok
mkdir magento2
chown lee:lee magento2
備份->rename sql magento2->magento2-234-less-1-table
mysql -u root -p
->root + revres88
mysql>
CREATE DATABASE magento2 CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON magento2.* TO magento_user@localhost IDENTIFIED BY 'revres88';
quit
1.)安裝PHP 7.1
sudo apt-get update -y
sudo apt install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo add-apt-repository -y ppa:ondrej/nginx
sudo apt-get update -y
apt-cache pkgnames | grep php7.1
sudo apt-get install -y php7.1 php7.1-fpm php7.1-mcrypt php7.1-curl php7.1-cli php7.1-mysql php7.1-gd php7.1-xsl php7.1-json php7.1-intl php-pear php7.1-dev php7.1-common php7.1-mbstring php7.1-zip php7.1-bcmath php7.1-fileinfo php7.1-soap php7.1-imagick libcurl4-openssl-dev curl -y
(不必停留給phpmyadmin用)2.)停用php 7.2
不必停留給phpmyadmin用->x->sudo systemctl stop php7.2-fpm
sudo systemctl start php7.1-fpm
sudo rm /usr/bin/php
sudo cp /usr/bin/php7.1 /usr/bin/php
php -v
->
PHP 7.1.33-14+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 20 2020 13:57:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.33-14+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
2.)修改php.ini設定
sudo su
joe /etc/php/7.1/fpm/php.ini
joe /etc/php/7.1/cli/php.ini
->
memory_limit = 1024M
max_execution_time = 1800
zlib.output_compression = On
->
systemctl restart php7.1-fpm
3.)修改nginx設定(7.2->7.1)
joe /etc/nginx/sites-available/qt-wg-1
upstream fastcgi_backend {
server unix:/run/php/php7.1-fpm.sock;
}
4.)安裝Magento ver. 2.1.9
su lee
cd /var/www/magento2/
wget 118.163.15.73/magento2.1.9.tar.gz (Magento-CE-2.1.9-2017-09-13-03-35-18.tar.gz)
tar -xzf magento2.1.9.tar.gz
->
---------------
先直接改Encryptor.php->return null;->才不會出現報錯
joe /var/www/magento2/vendor/magento/framework/Encryption/Encryptor.php
protected function getCrypt($key = null, $cipherVersion = null, $initVector = true)
{
return null;
/*
return new Crypt($key, $cipher, $mode, $initVector);
*/
}
-----------------
->
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c102e5ee62f4d7ee8f4b8865b07bf5" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=magento_user \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=dv4ml@dacomputing.com \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
->
Write installation date...
[Progress: 425 / 425]
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_lak7t5
->
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
chown -R lee:lee .
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US
New version of deployed files: 1586397922
->
PHP Fatal error: Cannot use 'Void' as class name as it is reserved in /var/www/magento2/vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php on line 9
Here is how to fix it:
joe vendor/magento/module-sales/etc/webapi.xml line 112:
-
+
joe vendor/magento/module-sales/Block/Adminhtml/Order/Invoice/View.php line 242:
- return $this->getUrl('sales/*/void', ['invoice_id' => $this->getInvoice()->getId()]);
+ return $this->getUrl('sales/*/voidInvoice', ['invoice_id' => $this->getInvoice()->getId()]);
joe vendor/magento/module-sales/Block/Adminhtml/Order/Creditmemo/View.php line 183:
- return $this->getUrl('sales/*/void', ['creditmemo_id' => $this->getCreditmemo()->getId()]);
+ return $this->getUrl('sales/*/voidCreditmemo', ['creditmemo_id' => $this->getCreditmemo()->getId()]);
joe vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php line 9:
- class Void extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice\View
+ class VoidInvoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice\View
joe vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php line 10:
- class Void extends \Magento\Backend\App\Action
+ class VoidCreditmemo extends \Magento\Backend\App\Action
mv vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/VoidCreditmemo.php
mv vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/VoidInvoice.php
lee@ip-172-31-40-85:/var/www/magento2$ php bin/magento setup:di:compile Compilation was started.
Repositories code generation... 1/7 [====>-----------------------] 14% 1 sec 44.0 MiB
Application code generator... 3/7 [============>---------------] 42% 7 secs 136.0 MiB36.0 MiB
Interceptors generation... 4/7 [================>-----------] 57% 20 secs 154.0 MiBMiB
Area configuration aggregation... 5/7 [====================>-------] 71% 32 secs 170.0 MiB
Interception cache generation... 6/7 [========================>---] 85% 45 secs 246.0 MiBB
Interception cache generation... 7/7 [============================] 100% 56 secs 246.0 MiB
Generated code and dependency injection configuration successfully.
->
sudo systemctl restart nginx
sudo systemctl restart php7.1-fpm
必须要设权限,不然会报各种权限错误!
cd /var/www/magento2/
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
nginx error_log
joe /var/log/nginx/error.log
mag2 error
929652303517
cp var/report/929652303517 /var/www/html/err-101
http://3.134.105.225/err-101
sudo su
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
chown -R lee:lee .
備份
cp magento2 magento2-219-org-ok -r
sql->magento2->magento2-219-org-ok
sql->magento8pm->magento8pm-qt
換舊sql-magento8pm-20200406
su lee
cd /var/www/magento2/
cp app/etc/env.php app/etc/env.php-0
joe app/etc/env.php
'dbname' => 'magento8pm-qt',(原magento2)
'username' => 'root', (原magento_user)
->
php bin/magento indexer:reindex
php bin/magento cache:flush
改base url
core_config_data table->
default->web/unsecure/base_url->http://qt.wg-1.com/ (原http://www.buck4u.com/)
UPDATE core_config_data SET value='http://qt.wg-1.com/' WHERE value='http://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='http://qt.wg-1.com/' WHERE value='http://zou.wg-1.com/'
手工刪theme
rm -rf var/view_preprocessed/* pub/static/frontend/*
sql->table->theme刪不要的theme
UPDATE core_config_data SET value='1' WHERE path='design/theme/theme_id'
php bin/magento cache:flush
php bin/magento setup:static-content:deploy en_US
New version of deployed files: 1586406539
建圖片連結
cd /var/www/magento2/pub/media/
rm catalog -r
ln -s /var/www/pwpic/catalog/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/webimg/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/pageimg/ /var/www/magento2/pub/media/
php bin/magento indexer:reindex
php bin/magento cache:flush
??? php bin/magento catalog:images:resize
Product images resized successfully
sudo su
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
??? chown -R www-data:www-data .
?->chown -R lee:lee . -hR
joe /etc/php/7.1/fpm/pool.d/www.conf
;user = www-data
;group = www-data
user = lee
group = lee
;listen.owner = www-data
;listen.group = www-data
listen.owner = lee
listen.group = lee
->
sudo systemctl restart nginx
sudo systemctl restart php7.1-fpm
cd /var/www/magento2
find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
chmod 777 var/ -R
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown lee:lee . -hR
chmod u+x bin/magento
chmod -R g+rwxs .
ls -la
備份
cp magento2 magento2-219-qt-20200409-ok -r
cp sql->magento8pm-qt->magento8pm-qt-20200409-ok
#1062 - Duplicate entry 'localhost-magento8pm-qt-magento_user' for key 'PRIMARY'
Warning: Illegal string offset 'is_in_stock' in /var/www/magento2/vendor/magento/module-catalog-inventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php on line 87
Customer Grid index is locked by another reindex process. Skipping.
php bin/magento indexer:status
php bin/magento indexer:reset
php bin/magento indexer:reindex
php bin/magento indexer:info
php bin/magento indexer:reset catalogsearch_fulltext
php bin/magento indexer:reindex catalogsearch_fulltext
------------------------------------------------------------
以下為 ref
I run 7.1 in production no problem. If you want to get around the error so you can run the install.
add this line
error_reporting(E_ALL ^ E_DEPRECATED);
to the top of
sudo vim lib/internal/Magento/Framework/Encryption/Crypt.php
重新安裝mcrypt新版本
sudo apt-get install mcrypt php7.1-mcrypt
root@awsko:/home/ubuntu# /usr/bin/php -v
PHP 7.1.33-9+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb 5 2020 16:53:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.33-9+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
2.)停用php 7.1
sudo systemctl stop php7.1-fpm
sudo rm /usr/bin/php
sudo cp /usr/bin/php7.2 /usr/bin/php
php -v
systemctl restart nginx
sudo systemctl restart php7.2-fpm
--- 20200407-08 AWS-QT 降級 PHP 7.2 -> 7.1
=========================================================================================================================
0.)測試
50GPD Home drinking RO System w/tank extra free 3 PC filters
RQ-5T-50+3
1.)改atrribute->sku->searchable
2.)改mysql設定可以查2英文字
參考->https://dev.mysql.com/doc/refman/5.6/en/fulltext-fine-tuning.html#fulltext-word-length
joe /etc/my.cnf(不知是否有效)
joe /etc/mysql/my.cnf
->
[mysqld]
innodb_ft_min_token_size=2
ft_min_word_len=2
->
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)
->
systemctl restart mysql
3.)修改系統查詢
joe vendor/magento/module-catalog-search/etc/search_request.xml
->
(原為should,改為must)
->
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
/usr/bin/php bin/magento cache:flush
--- 20200407 AWS-DV RO站前台查不到SKU
=========================================================================================================================
0.)建新目錄
cd /var/www/
mv magento2 magento2-234
mkdir magento2
1.)mysql建新表
備份->rename sql magento2->magento2-234
mysql -u root -p
->root + revres88
mysql>
CREATE DATABASE magento2 CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON magento2.* TO magento_user@localhost IDENTIFIED BY 'revres88';
quit
2.)Magento ver. 2.1.9
cd /var/www/magento2/
wget 118.163.15.73/magento2.1.9.tar.gz (Magento-CE-2.1.9-2017-09-13-03-35-18.tar.gz)
tar -xzf magento2.1.9.tar.gz
->
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="34c102e5ee62f4d7ee8f4b8865b07bf5" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=magento_user \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=dv4ml@dacomputing.com \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
->
Write installation date...
Installing admin user...
[Progress: 981 / 985]
Caches clearing:
Cache cleared successfully
[Progress: 982 / 985]
Disabling Maintenance Mode:
[Progress: 983 / 985]
Post installation file permissions check...
For security, remove write permissions from these directories: '/var/www/magento2/app/etc'
[Progress: 984 / 985]
Write installation date...
[Progress: 985 / 985]
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /adminmag
Nothing to import.
->
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
chown -R lee:lee .
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
->
Compilation was started.
Repositories code generation... 1/7 [====>-----------------------] 14% 1 sec 78.5 MiB
Application code generator... 3/7 [============>---------------] 42% 17 secs 209.0 MiB
Interceptors generation... 4/7 [================>-----------] 57% 29 secs 233.0 MiB
Area configuration aggregation... 5/7 [====================>-------] 71% 47 secs 263.0 MiB
Interception cache generation... 6/7 [========================>---] 85% 53 secs 359.0 MiB
Interception cache generation... 7/7 [============================] 100% 1 min 359.0 MiB
Generated code and dependency injection configuration successfully.
->
sudo systemctl restart nginx
sudo systemctl restart php7.2-fpm
--- 20200407 AWS-QT 重裝 magento 2.1.9
=========================================================================================================================
0.)建新目錄
su lee
cd /var/www/
mv magento2 magento2-20200407-bk
mkdir magento2
1.)mysql建新表
mysql -u root -p
->root + revres88
mysql>
CREATE DATABASE magento2 CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON magento2.* TO magento_user@localhost IDENTIFIED BY 'revres88';
quit
2.)Magento ver. 2.3.4 (aws-dv 2.1.9)
cd /var/www/magento2/
wget 118.163.15.73/magento2.zip (Magento-CE-2.3.4-2020-01-16-11-19-26.zip)
unzip -q magento2.zip
->
php bin/magento setup:install --backend-frontname="admin_lak7t5" \
--key="ee62f4d7ee8f4b8865b07bf534c102e5" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=magento_user \
--db-password='revres88' \
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=dv4ml@dacomputing.com \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Los_Angeles \
--use-rewrites=1
->
Write installation date...
Installing admin user...
[Progress: 981 / 985]
Caches clearing:
Cache cleared successfully
[Progress: 982 / 985]
Disabling Maintenance Mode:
[Progress: 983 / 985]
Post installation file permissions check...
For security, remove write permissions from these directories: '/var/www/magento2/app/etc'
[Progress: 984 / 985]
Write installation date...
[Progress: 985 / 985]
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /adminmag
Nothing to import.
->
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
chown -R lee:lee .
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
->
Compilation was started.
Repositories code generation... 1/7 [====>-----------------------] 14% 1 sec 78.5 MiB
Application code generator... 3/7 [============>---------------] 42% 17 secs 209.0 MiB
Interceptors generation... 4/7 [================>-----------] 57% 29 secs 233.0 MiB
Area configuration aggregation... 5/7 [====================>-------] 71% 47 secs 263.0 MiB
Interception cache generation... 6/7 [========================>---] 85% 53 secs 359.0 MiB
Interception cache generation... 7/7 [============================] 100% 1 min 359.0 MiB
Generated code and dependency injection configuration successfully.
->
sudo systemctl restart nginx
sudo systemctl restart php7.2-fpm
3.)備份mag2 + sql
cp magento2 magento2-20200407-org-0 -r
cp sql->magento2->magento2-20200407-org-0
4.)安裝 Theme Zou demo
cd /var/www/magento2/app/design/frontend/
wget 118.163.15.73/Zou.zip
unzip Zou.zip
php bin/magento cache:flush
5.)安裝插件 DisableCompare
mkdir -p /var/www/magento2/app/code/Bss/DisableCompare
cd /var/www/magento2/app/code/Bss/DisableCompare
wget 118.163.15.73/mag-ext-1.zip
unzip mag-ext-1.zip
cd /var/www/magento2/
php bin/magento module:status
php bin/magento module:enable --clear-static-content Bss_DisableCompare
php bin/magento setup:upgrade
php bin/magento setup:di:compile
6.)建立圖片連結
ln -s /var/www/pwpic/catalog/ /var/www/magento2/pub/media/
ln -s /var/www/pwpic/pageimg/ /var/www/magento2/pub/media/
7.)備份mag2 + sql
cp magento2 magento2-20200407-org-ok -r
cp sql->magento2->magento2-20200407-org-ok
--- 20200407 AWS-QT 重裝 magento 2.3.4
=========================================================================================================================
1.)改mysql password(原為frevres88->revres88)
mysql -u root -p
mysql>
set password for root@localhost = password('revres88');
set password for magento_user@localhost = password('revres88');
2.)改mag2-mysql password(原為frevres88->revres88)
cd /var/www/magento2/app/etc
joe env.php->
'password' => 'revres88',
3.)Try Error -> 全部失敗
解壓(無列表)->
tar -xzf magento8pm-20200325-new-ro-online-bk.tar.gz
改app/etc/env.php -> magento8pm
copy AWS-DV-SQL magento8pm -> AWS-QT-SQL
新增magento8pm缺少的table
disable upgrade 失敗的mag2 model
修改table->core_config_data->web/unsecure/base_url等4筆
改DNS zou.wg-1.com
--- 20200406 AWS-QT 改 mysql password
=========================================================================================================================
1.)安裝 Theme Zou demo
su lee
cd /var/www/magento2/app/design/frontend/
wget 118.163.15.73/Zou.zip
unzip Zou.zip
cd /var/www/magento2/
x->2.)安裝插件 Bannerslider(slider manage沒有list無法管理->不使用了)
cd /var/www/magento2/
git clone https://github.com/Magestore/Bannerslider-Magento2.git
mkdir -p app/code/Magestore/Bannerslider
cp Bannerslider-Magento2/* app/code/Magestore/Bannerslider/ -rf
rm Bannerslider-Magento2 -rf
php bin/magento module:enable --clear-static-content Magestore_Bannerslider
php bin/magento setup:upgrade
3.)下載滾動js OwlCarousel2(可以不用作,sample中已含)
參數設定 -> http://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html
wget https://github.com/OwlCarousel2/OwlCarousel2/archive/2.3.4.zip
mv 2.3.4.zip app/design/frontend/Zou/demo/web/js/
cd app/design/frontend/Zou/demo/web/js
unzip 2.3.4.zip
rm 2.3.4.zip
4.)補作deploy js OwlCarousel2(20200407)
cd /var/www/magento2/
php bin/magento setup:static-content:deploy en_US -f
->Execution time: 28.715186834335
cd /var/www/magento2/app/design/frontend/Zou/demo/web/js/
joe demo.js
http://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html
cd /var/www/magento2/app/design/frontend/Zou/demo/Magento_Cms/layout/
joe cms_index_index.xml
cd /var/www/magento2/app/design/frontend/Zou/demo/web/css/
joe demo.css
?->2行都去掉 background: transparent;
cd /var/www/magento2/app/design/frontend/Zou/demo/Magento_Cms/templates/html/homepage/
joe home_content.phtml
--- 20200405-07 AWS-QT 裝 theme Zou demo
=========================================================================================================================
1.)還原magento2->20200404(未裝任何插件)
tar -xzvf magento2-20200404.tar.gz
bin/magento setup:di:compile
->
Compilation was started.
Repositories code generation... 1/7 [===>------------------] 14% 1 sec 78.5 MiB
Interception cache generation... 7/7 [=============] 100% 59 secs 357.0 MiB
Generated code and dependency injection configuration successfully.
2.)恢復magento2->裝了插件x3(DisableCompare,Ves,SliderBanner)
joe /etc/php/7.2/fpm/php.ini
joe /etc/php/7.2/cli/php.ini
->
display_errors = On (原 Off)
log_errors = On
;error_log = php_errors.log
->
touch /var/log/php_error.log(後來改 chown lee:lee)
find . -name "php_errors.log"(找不到)
systemctl restart php7.2-fpm
cd /var/www/magento2/
php -dmemory_limit=2G bin/magento setup:di:compile
->
Compilation was started.
Repositories code generation... 1/7 [==>-----------------] 14% < 1 sec 78.5 MiB
Service data attributes generation... 2/7 [===>---------] 28% 19 secs 213.0 MiB
Application code generator... 3/7 [=====>-------] 42% 20 secs 213.0 MiB
3.)刪去Ves,SliderBanner>只留DisableCompare
Compilation was started.
Repositories code generation... 1/7 [==>-----------------] 14% < 1 sec 78.5 MiB
Application code generator... 3/7 [=====>-------] 42% 15 secs 209.0 MiB
Interceptors generation... 4/7 [=======>-----] 57% 34 secs 233.0 MiB
08:58->09:26->ctrl-c->中斷
4.)magento2-20200406-ok + DisableCompare + Themem Zou
cp magento2-20200406-ok magento2 -r
php bin/magento setup:di:compile
Compilation was started.
Repositories code generation... 1/7 [==>-----------------] 14% < 1 sec 78.5 MiB
Application code generator... 3/7 [=====>-------] 42% 17 secs 209.0 MiB
Interceptors generation... 4/7 [=======>-----] 57% 30 secs 233.0 MiB
Area configuration aggregation... 5/7 [=========>---] 71% 49 secs 263.0 MiB
Killed
php bin/magento cache:clean
(20200407)->成功
lee@ip-172-31-40-85:/var/www/magento2$ php bin/magento setup:di:compile
Compilation was started.
Repositories code generation... 1/7 [==>-----------------] 14% < 1 sec 78.5 MiB
Application code generator... 3/7 [=====>-------] 42% 15 secs 209.0 MiB
Interceptors generation... 4/7 [=======>-----] 57% 27 secs 233.0 MiB
Area configuration aggregation... 5/7 [=========>---] 71% 46 secs 263.0 MiB
Interception cache generation... 6/7 [===========>-] 85% 53 secs 359.0 MiB
Interception cache generation... 7/7 [=============] 100% 1 min 359.0 MiB
Generated code and dependency injection configuration successfully.
5.)magento2-20200406-ok + DisableCompare + Themem Zou
root@ip-172-31-40-85:/var/www/magento2-20200406-ok# php bin/magento setup:di:compile
Compilation was started.
Repositories code generation... 1/7 [====>-----------------------] 14% < 1 sec 78.5 MiB
Application code generator... 3/7 [============>---------------] 42% 18 secs 209.0 MiB
Interceptors generation... 4/7 [================>-----------] 57% 31 secs 233.0 MiB
Area configuration aggregation... 5/7 [====================>-------] 71% 50 secs 265.0 MiB
Interception cache generation... 6/7 [========================>---] 85% 59 secs 359.0 MiB
Interception cache generation... 7/7 [============================] 100% 1 min 359.0 MiB
Generated code and dependency injection configuration successfully.
--- 20200404-07 研究 bin/magento setup:di:compile 失敗或需時太久原因
=========================================================================================================================
1.)新增Attribute b4_free_shipping
------------ To Do-----------------
import 產品自動建目錄(不可以有1/,先改其他
取消目錄PWC?
google reCaptcha?
建新根目錄?
取消review?
----------------------
--- 20200404 AWS-QT 手工更新 Attribute set + import product.csv
=========================================================================================================================
1.)安裝 Theme 8pm
su lee
cd /var/www/magento2/app/design/frontend
wget 118.163.15.73/theme8pm.zip
unzip theme8pm.zip
cd /var/www/magento2/
php bin/magento indexer:reindex
php bin/magento cache:flush
2.)安裝插件 DisableCompare
su lee
cd /var/www/magento2/app/
mkdir code/Bss/DisableCompare
cd code/Bss/DisableCompare
wget 118.163.15.73/mag-ext-1.zip
unzip mag-ext-1.zip
cd /var/www/magento2/
php bin/magento module:status
php bin/magento module:enable --clear-static-content Bss_DisableCompare
php bin/magento setup:upgrade
php bin/magento setup:di:compile->卡住?加上插件要花很長時間
Compilation was started.
Application code generator... 3/7 [=====>-------] 42% 15 secs 209.0 MiB
3.)安裝插件 Ves 全部不能用
cd /var/www/magento2/app/code/
wget 118.163.15.73/mag-ext-2.zip
unzip mag-ext-2.zip
php bin/magento module:enable --clear-static-content Ves_All
php bin/magento module:enable --clear-static-content Ves_Megamenu
php bin/magento module:enable --clear-static-content Ves_Setup
php bin/magento module:enable --clear-static-content Ves_BaseWidget
php bin/magento module:enable --clear-static-content Ves_Themesettings
php bin/magento module:enable --clear-static-content Ves_PageBuilder
php bin/magento module:enable --clear-static-content Ves_Productlist
php bin/magento setup:upgrade
wget 118.163.15.73/mag-ext-3.zip(只有Ves 3x)
unzip mag-ext-3.zip
php bin/magento module:uninstall --clear-static-content Ves_Megamenu
->Ves_Megamenu is not an installed composer package
php bin/magento module:disable --clear-static-content Ves_All
php bin/magento module:disable --clear-static-content Ves_Megamenu
php bin/magento module:disable --clear-static-content Ves_Setup
php bin/magento module:disable --clear-static-content Ves_BaseWidget
php bin/magento module:disable --clear-static-content Ves_Themesettings
php bin/magento module:disable --clear-static-content Ves_PageBuilder
php bin/magento module:disable --clear-static-content Ves_Productlist
--- 20200404 AWS-QT 安裝 theme 8pm + Ext DisableCompare + Ves 失敗
=========================================================================================================================
0.)copy pwpic from aws-dv
cd /var/www/pwpic/
chown www-data:www-data .
舊aws-dv
joe /etc/apache2/sites-available/aws-wg-1.conf
DocumentRoot /var/www/html/pwpic/webimg
ServerName aws.wg-1.com
ErrorLog /var/log/apache2/error_log
CustomLog /var/log/apache2/access_log common
Options FollowSymLinks
AllowOverride all
Require all granted
# Order allow,deny
# Allow from all
1.)新aws-qt->qtpic-wg-1->qtpic.wg-1.com指向3.134.105.225(AWS-QT)
joe /etc/nginx/sites-available/qtpic-wg-1
server {
listen 80;
server_name qtpic.wg-1.com;
root /var/www/pwpic/webimg;
}
->
測if OK->sudo nginx -t
sudo ln -s /etc/nginx/sites-available/qtpic-wg-1 /etc/nginx/sites-enabled/
sudo systemctl restart nginx
2.)新aws-qt->aws-wg-1
joe /etc/nginx/sites-available/aws-wg-1
server {
listen 80;
server_name aws.wg-1.com;
root /var/www/pwpic/webimg;
}
3.)aws.wg-1.com指向3.134.105.225(AWS-QT)
4.)備份mag2 + sql
cd /var/www/magento2
備份mag2->tar -czf magento2-20200403.tar.gz *
解壓->tar -xzvf magento2-20200403.tar.gz
備份sql->copy magento2 -> magento2_20200403
備份mag2->tar -czf magento2-20200404.tar.gz * (裝完theme 8pm)
備份sql->copy magento2 -> magento2_20200404 (裝完theme 8pm)
備份mag2->tar -czf magento2-20200404-bug.tar.gz * (裝完theme 8pm + ext 3x )(20200407)
備份mag2->tar -czf magento2-20200406-bug.tar.gz * (裝完theme 8pm + ext 3x )(20200407)
備份pwpic->tar -czf pwpic-20200407.tar.gz *
備份mag2->tar -czf magento2-20200406-ok.tar.gz * (裝完theme Zou + ext Bss )(20200407)
5.)建立圖片連結
cd /var/www/pwpic/catalog/
chown -R lee:lee .
su lee
ln -s /var/www/pwpic/catalog/ /var/www/magento2/pub/media/
php bin/magento indexer:reindex
php bin/magento cache:flush
--- 20200403-04 AWS-DV 圖片移轉至 AWS-QT
=========================================================================================================================
(20200402 22:10)
aws-hdd-100%->
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 30G 28G 1.1G 97% /
cd /var/www/html
rm Magento-CE-2.3.2.tar.bz2
rm magento8pm.tar.gz
rm php-7.0.4.tar.gz
rm ves_8pmfriday_quickstart.zip
rm magento8pm-20200324-new-ro-online-bk.tar.gz
rm magento8pm-20191107-ok.tar.gz
rm magento8pm-20191107-pm-ok.tar.gz
login as: ubuntu
Authenticating with public key "imported-openssh-key"
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-1060-aws x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Thu Apr 2 14:04:31 UTC 2020
System load: 0.17 Processes: 122
Usage of /: 99.9% of 29.02GB Users logged in: 1
Memory usage: 78% IP address for eth0: 172.31.32.158
Swap usage: 53%
=> / is using 99.9% of 29.02GB
* Kubernetes 1.18 GA is now available! See https://microk8s.io for docs or
install it with:
sudo snap install microk8s --channel=1.18 --classic
* Multipass 1.1 adds proxy support for developers behind enterprise
firewalls. Rapid prototyping for cloud operations just got easier.
https://multipass.run/
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
123 packages can be updated.
0 updates are security updates.
*** System restart required ***
Last login: Wed Apr 1 02:47:24 2020 from 114.34.53.65
ubuntu@awsko:~$ sudo su
root@awsko:/home/ubuntu# df -h
Filesystem Size Used Avail Use% Mounted on
udev 480M 0 480M 0% /dev
tmpfs 99M 11M 88M 11% /run
/dev/xvda1 30G 30G 0 100% /
tmpfs 492M 0 492M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 492M 0 492M 0% /sys/fs/cgroup
/dev/loop0 18M 18M 0 100% /snap/amazon-ssm-agent/1480
/dev/loop3 92M 92M 0 100% /snap/core/8689
/dev/loop4 18M 18M 0 100% /snap/amazon-ssm-agent/1566
/dev/loop1 94M 94M 0 100% /snap/core/8935
tmpfs 99M 0 99M 0% /run/user/1000
root@awsko:/home/ubuntu#
cd /var/www/html
rm magento8pm-20191220-dv-fail.tar.gz
rm magento8pm-20200227-card-braintree-error.tar.gz
apt-get autoclean
apt-get clean
zip -r pwpic-0.zip pwpic-0/
PC下載 -> http://18.218.158.219/pwpic-0.zip
rm pwpic-0.zip
rm pwpic-0 -r
aws-qt:
wget http://18.218.158.219/pwpic-0.zip
wget http://18.218.158.219/pwpic.zip
wget http://18.218.158.219/magento8pm-20191107-bk-for-dv.tar.gz
wget http://18.218.158.219/magento8pm-20191123-bk.tar.gz
wget http://18.218.158.219/magento8pm-20191230-before-md5-patch.tar.gz
wget http://18.218.158.219/magento8pm-20200121-bk.tar.gz
wget http://18.218.158.219/magento8pm-20200221-dv.tar.gz
wget http://18.218.158.219/magento8pm-20200311-braintree-ok-20200121-recover-dv-fix-ok.tar.gz
--aws未刪
wget http://18.218.158.219/magento8pm-20200319-braintree-ok-dv-fix-chen-test-ok.tar.gz
wget http://18.218.158.219/magento8pm-20200325-new-ro-online-bk.tar.gz
aws-dv:
zip -r pwpic.zip pwpic/
rm pwpic.zip
rm pwpic-0.zip
rm pwpic-0 -r
rm magento8pm-20191107-bk-for-dv.tar.gz
rm magento8pm-20191123-bk.tar.gz
rm magento8pm-20191230-before-md5-patch.tar.gz
rm magento8pm-20200121-bk.tar.gz
rm magento8pm-20200221-dv.tar.gz
rm magento8pm-20200311-braintree-ok-20200121-recover-dv-fix-ok.tar.gz
--- 20200403 AWS-DV 空間爆滿100% 第1次
=========================================================================================================================
aws-qt
3.134.105.225 qt.wg-1.com
0.)預裝系統
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install curl nano git
sudo apt install unzip
sudo apt-get install joe
1.)nginx
sudo apt-get install nginx
sudo systemctl start nginx(會報錯)
2.)PHP 7.2
sudo apt-get update -y
sudo apt install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo add-apt-repository -y ppa:ondrej/nginx
sudo apt-get update -y
以下都要先安裝->
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install php-pear
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install php7.2-dev
sudo apt-get -y install libmcrypt-dev
pecl channel-update pecl.php.net
sudo pecl install mcrypt-1.0.1
檢查已安裝->
apt-cache pkgnames | grep php7.2
要修改->libcurl4->為libcurl4-openssl-dev
x->sudo apt-get install -y php7.1 php7.1-fpm php7.1-mcrypt php7.1-curl php7.1-cli php7.1-mysql php7.1-gd php7.1-xsl php7.1-json php7.1-intl php-pear php7.1-dev php7.1-common php7.1-mbstring php7.1-zip php7.1-bcmath php7.1-fileinfo php7.1-soap php7.1-imagick libcurl4 curl -y
x->sudo apt-get install -y php7.1 php7.1-fpm php7.1-mcrypt php7.1-curl php7.1-cli php7.1-mysql php7.1-gd php7.1-xsl php7.1-json php7.1-intl php-pear php7.1-dev php7.1-common php7.1-mbstring php7.1-zip php7.1-bcmath php7.1-fileinfo php7.1-soap php7.1-imagick libcurl4-openssl-dev curl -y
x->sudo apt-get install -y php7.2 php7.2-fpm php7.2-mcrypt php7.2-curl php7.2-cli php7.2-mysql php7.2-gd php7.2-xsl php7.2-json php7.2-intl php-pear php7.2-dev php7.2-common php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-fileinfo php7.2-soap php7.2-imagick libcurl4-openssl-dev curl -y
sudo apt-get install -y php7.2 php7.2-fpm php7.2-curl php7.2-cli php7.2-mysql php7.2-gd php7.2-xsl php7.2-json php7.2-intl php-pear php7.2-dev php7.2-common php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-fileinfo php7.2-soap php7.2-imagick libcurl4-openssl-dev curl -y
刪除如果有裝老版本->
sudo apt-get purge php7.0 php7.0-common
sudo apt-get purge php7.1 php7.1-common
設環境參數->
sudo rm /usr/bin/php
sudo cp /usr/bin/php7.2 /usr/bin/php
php –v ->
PHP 7.2.29-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 20 2020 13:54:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.29-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
改php.ini->
joe /etc/php/7.2/fpm/php.ini
joe /etc/php/7.2/cli/php.ini
->
memory_limit = 1024M
max_execution_time = 1800
zlib.output_compression = On
->
sudo systemctl restart php7.2-fpm
3.)mysql
sudo apt-get install mysql-server-5.7
->root + frevres88(20200406改revres88)
mysql -u root -p
mysql>
CREATE DATABASE magento2 CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON magento2.* TO magento_user@localhost IDENTIFIED BY 'frevres88';
quit
->
cd /etc/nginx/sites-available/
joe qt-wg-1
upstream fastcgi_backend {
server unix:/run/php/php7.2-fpm.sock;
}
server {
listen 80;
server_name qt.wg-1.com;
set $MAGE_ROOT /var/www/magento2;
set $MAGE_MODE developer;
include /var/www/magento2/nginx.conf.sample;
error_log /var/log/nginx/error.log;
}
->
測if OK->sudo nginx -t
sudo ln -s /etc/nginx/sites-available/qt-wg-1 /etc/nginx/sites-enabled/
sudo systemctl restart nginx
4.)phpmyadmin
3.134.105.225/admin_7s9q2
sudo apt-get purge phpmyadmin
sudo apt-get install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/html/admin_7s9q2
joe /etc/nginx/sites-available/default->
index index.html index.htm index.php index.nginx-debian.html;
location /phpmyadmin {
index index.php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
---------------------------------------
修正一直出現報錯bug: (20200409)
Warning in ./libraries/sql.lib.php#601
count(): Parameter must be an array or an object that implements Countable
->
sudo su
joe /usr/share/phpmyadmin/libraries/sql.lib.php lines 601
->
|| (count($analyzed_sql_results[‘select_expr’] == 1)->右括 ) 位置錯誤
->
|| (count($analyzed_sql_results[‘select_expr’]) == 1
---------------------------------------
5.)composer
cd ~/
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/bin/composer
composer -v
->Composer version 1.10.1 2020-03-13 20:34:27
6.)Magento ver. 2.3.4 (aws-dv 2.1.9)
cd /var/www/
失敗->composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2(但是keyin了username+password-key)
cd /var/www/magento2/
wget 118.163.15.73/magento2.zip
unzip magento2.zip
composer install -v
->
php bin/magento setup:install --backend-frontname="adminmag" \
--key="65b07bf534c102e5ee62f4d7ee8f4b88" \
--base-url="http://qt.wg-1.com" \
--base-url-secure="https://qt.wg-1.com" \
--db-host=localhost \
--db-name=magento2 \
--db-user=magento_user \
--db-password='frevres88' \(20200406改revres88)
--admin-firstname=Lee \
--admin-lastname=David \
--admin-email=dv4ml@dacomputing.com \
--admin-user=adminmag \
--admin-password=frevres0907 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1
->
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /adminmag
Nothing to import.
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} \; && find pub/static -type d -exec chmod 777 {} \; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
chown -R www-data:www-data .
systemctl restart nginx
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento info:adminuri
改admin-url->
joe app/etc/env.php->
return [
'backend' => [
'frontName' => 'admin_lak7t5'
7.)建新權限USER
adduser lee
passwd aa223344
joe /etc/sudoers->
lee ALL=(ALL:ALL) ALL
usermod -a -G www-data lee
cd /var/www/magento2
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
chmod 777 var/ -R \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown lee:lee . -hR
chmod u+x bin/magento
chmod -R g+rwxs .
ls -la
chown lee:lee /var/www
joe /etc/php/7.2/fpm/pool.d/www.conf ->
;user = www-data
;group = www-data
user = lee
group = lee
;listen.owner = www-data
;listen.group = www-data
listen.owner = lee
listen.group = lee
->
joe /etc/nginx/nginx.conf ->
#user www-data;
user lee;
->
systemctl restart nginx
systemctl restart php7.2-fpm
8.)更新magento2->su lee
php bin/magento maintenance:enable
rm -rf var/di/* && rm -rf var/generation/* && rm -rf var/cache/* && rm -rf var/page_cache/* && rm -rf var/view_preprocessed/* && rm -rf pub/static/* && rm -rf generated/* && mkdir var/di
php bin/magento setup:upgrade && php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f && php bin/magento indexer:reindex && php bin/magento maintenance:disable && php bin/magento cache:clean && php bin/magento cache:flush
失敗->9.)導入Demo Data->
wget https://codeload.github.com/magento/magento2-sample-data/zip/2.2.4
mv 2.2.4 2.2.4.zip
unzip 2.2.4.zip
mv magento2-sample-data-2.2.4 magento2-sample-data
rm 2.2.4.zip
php -f magento2-sample-data/dev/tools/build-sample-data.php -- --ce-source="/var/www/magento2"
php bin/magento setup:upgrade
->
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Magento_CatalogSampleData' for key 'PRIMARY', query was: INSERT INTO `setup_module` (`module`, `schema_version`) VALUES (?, ?)
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento sampledata:deploy->
Authentication required (repo.magento.com):
Username: 0c2e51e0297016e62e864f5effe625c7 (Public Key)
Password: 38410b35ec042696d687ee7c90436d88 (Private Key)
Do you want to store credentials for repo.magento.com in /var/www/magento2/var/composer_home/auth.json ? [Yn]
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed
php bin/magento setup:upgrade
chown -R www-data:www-data .
php bin/magento indexer:reindex
php bin/magento cache:flush
x->chown -R www-data:www-data .
x->chown -R lee:lee .
php bin/magento indexer:reindex
php bin/magento cache:flush
chown -R www-data:www-data .
systemctl restart nginx
--- 20200402-03 AWS-QT 裝新 magento 2.3.4
=========================================================================================================================
1.)Update field limitation rules from the database
Directly in the customer_eav_attribute table, update rows with attribute_id=5 [firstname] and attribute_id=7 [last name] and replace 255 by 25.
Change code
validate_rules->a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;} //before update or by default
To
validate_rules->a:2:{s:15:"max_text_length";i:25;s:15:"min_text_length";i:1;} // after change
ID:9223 Leupoldjrm xwusaymetmbexagGP
ID:9224 Holographichwd zvusalmezniuxjsGP
(20200324 PM 15:35)改 25->16
ID:9231(20200328刪1人)
ID:9237(20200331刪1人)
ID:9243(20200402刪1人)
ID:9248(20200402刪1人)filma16@mail.ru
ID:9254(20200411刪1人)larsen360@live.dk
ID:9256(20200411刪1人)na.dy.a._o.k.o.leva@mail.ru
ID:9259(20200415刪1人)na.dya_o.kole.v.a@mail.ru
ID:9262(20200415刪1人)n.ad.y.a._o.kol.ev.a@mail.ru
ID:9270(20200422刪1人)eleoChorb@parkll.xyz
2.)Add Google CAPTCHA
https://www.mageplaza.com/blog/how-to-add-google-recaptcha-into-magento-2.html
在你的網站中加進 reCAPTCHA
「purewaterclubmag」已完成註冊。
在向使用者顯示的 HTML 程式碼中使用這串網站金鑰。
6LfIkeMUAAAAAI_FngvUCMAroZ7RizbD3Su6uoDs
用這串密鑰來建立網站和 reCAPTCHA 之間的通訊。
6LfIkeMUAAAAAE6LbLQ2aYQit3coOi3QO3pQSa0a
李生 14:36:28
要仔細研究看看要改哪些檔案
ADA 14:36:44
GMAIL
purewaterclubmag@gmail.com ; AA2233zz!!
--- 20200324 預防 bulk spam 註冊
=========================================================================================================================
1.)www.purewaterclub.com + purewaterclub.com 拍向 aws-magento8pm
2.)改STORES->Configuration->Store View:pwc_ro->GENERAL-Web->Base URLs + Base URLs (Secure): http://www.purewaterclub.com/
3.)cd /etc/apache2/sites-available
cp purewaterclub.conf www-purewaterclub.conf(比照mag2.purewaterclub.com)
joe www-purewaterclub.conf
4.)修改Mega Menu(不明原因又被改回default,所以再次修改)
共用目錄頁->blank:menu-top(不存在,不會出現)
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Megamenu/layout/default.xml
menu-top
b4u_home->7pm:menu-top-b4u
/var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Megamenu/layout/default.xml
menu-top-b4u
pwc_ro->6pm:menu-top-pwc
/var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/Ves_Megamenu/layout/default.xml
menu-top-pwc
4-1.)改menu-top-pwc->goto old site -> http://last.pureaterclub.com/ (拼錯字少"w") -> http://last.purewaterclub.com/
5.)改TAX,GUEST
手工刪除黑客注冊垃圾帳號
舊RO->sale
DELETE FROM address_book WHERE entry_street_address LIKE '%minsk%' AND entry_city LIKE '%minsk%' -> 10 record
DELETE FROM address_book WHERE entry_country_id<>'223' AND entry_street_address LIKE '%?%' -> 1 record
DELETE FROM address_book WHERE entry_country_id='110' -> 1 record (KE Kenya)
DELETE FROM address_book WHERE entry_country_id='17' -> 2 record (BH Bahrain)
UPDATE customers LEFT JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id SET customers_email_memo='xxxxx' WHERE address_book_id IS NULL -> 14 record
DELETE FROM customers WHERE customers_email_memo='xxxxx' -> 14 record
->http://last.purewaterclub.com/gen-customer-csv.php->q-20200319.csv
import Customer -> ro-customer-20200319-last-ok -> Checked rows: 5, checked entities: 10, invalid rows: 0, total errors: 0
新pwc_ro後台
ID:9141,9142,9143,9144,9145,9151
ID:9152-9169(20200320刪18人)
ID:9170-9177(20200321刪8人)
ID:9178-9184(20200322刪7人)
ID:9186-9189(20200323刪4人)
ID:9191-9200(20200323刪10人)
ID:9201-9207(20200324刪7人)
ID:9209-9213(20200324刪5人)
ID:9215-9222(20200324刪10人)
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
/usr/bin/php bin/magento cache:flush
->9135 records found
--- 20200319 AM 11:30 ML test OK + ADA backup OK + New RO Site ready + 轉最新客戶資料
=========================================================================================================================
1.)建新Attribute
spec_101:11種(尺寸x數量)珠光膜氣泡袋
spec_102:7種(尺寸x數量)牛皮紙氣泡袋
2.)建新Attribute Set
b4_bag:加spec_101,spec_102
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
/usr/bin/php bin/magento cache:flush
sudo php -f /var/www/html/magento8pm/bin/magento indexer:reindex
--- 20200315 上新 item 2 x mailer
=========================================================================================================================
1.)改buck4u shipping
->STORES->Configuration->SALES->Shipping Methods->Flat Rate->
Enabled:Yes
Type:Per Item
Price:0.2
Handling Fee:3.3
Ship to Applicable Countries:Specific Countries
Ship to Specific Countries:United States
->Free Shipping->Enabled:No
->Table Rates->Enabled:No
2.)設free_shipping
舊RO->1元及低價item->b4_free_shipping
舊RO->其他item->free_shipping
3.)設Cart Price Rules
3-1.)Marketing->Cart Price Rules->RO FREE SHIPPING
Conditions->Apply the rule only if the following conditions are met (leave blank for all products).
If ALL of these conditions are TRUE :
If an item is FOUND in the cart with ALL of these conditions true:
Free Shipping is Yes
Actions->
Free Shipping:For matching items only
Apply the rule only to cart items matching the following conditions (leave blank for all items).
If ALL of these conditions are TRUE :
3-2.)Marketing->Cart Price Rules->B4 FREE SHIPPING $25
Conditions->Apply the rule only if the following conditions are met (leave blank for all products).
If ALL of these conditions are TRUE :
If total amount equals or greater than 25 for a subselection of items in cart matching ALL of these conditions:
b4 Free Shipping is Yes
Actions->
Free Shipping:For matching items only
Apply the rule only to cart items matching the following conditions (leave blank for all items).
If ALL of these conditions are TRUE :
--- 20200314 改 buck4u shipping + cart price rules
=========================================================================================================================
0.)因為刷卡功能報錯,還原系統恢復功能
20200309 ADA 11:52:57
弄回去 0121版本, 前台可刷上但後台掛掉, 把後台重REINDEX, 後台好了, 前台只有 buck4u 可以, buck4all 和 mag2 都掛掉,
而且 buck4u 不能刷卡, 換來換去, 最後又弄回今天的版本
1.)還原mag2目錄改用magento8pm-20200121
rm -Rf magento8pm
mv magento8pm-20200121 magento8pm
->Required parameter 'theme_dir' was not passed
添加新theme 6pm
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/
cp 8pm 6pm -r
cd 6pm
joe registration.php
joe theme.xml
cd /var/www/html/magento8pm/app/design/frontend/
chown -R www-data:www-data .
chown www-data:www-data 7pm
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Themesettings/web/
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Themesettings/web/
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/Ves_Themesettings/web/
chown www-data:www-data css
->前台可刷卡但後台掛掉, 把後台重REINDEX->我reindex 後台仍上不了
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
/usr/bin/php bin/magento cache:flush
2.)還原資料庫改用magento8pm-20200215-ok
->前後台都會直接跳到buck4all.com
先改conf為demo2,進後台後再改為b4u_home
cd /etc/apache2/sites-available
joe buck4u.conf ->
joe buck4u-ssl.conf ->
SetEnv MAGE_RUN_CODE "b4u_home" -> 原為 "demo2"
service apache2 restart
->關閉wysiwyg editer
STORES->Configuration->General->Content Management->WYSIWYG Options->Enable WYSIWYG Editor->Disabled Completely
->去掉產品頁Short Description,Share,加SKU
STORES->Configuration->VES THEMESETTINGS->Product View Page->Other Elements
->去掉產品頁Paypal+Paypal credit icon
STORES->Configuration->SALES->Payment Methods->PayPal Express Checkout->Configure->Basic Setting->Display on Product Details Page->No
3.)修改Store View的code,theme(Head,Header,Footer),Base URL,Default page
b4u_home->b4u_home + 7pm(buck4u.com) + www.buck4u.com + buck4u.com
pwc_ro->pwc_ro + 6pm(purewaterclub.com) + mag2.purewaterclub.com + purewaterclub.com
3-1.)修改Home Page
b4u_home->Page:buck4u.com->Ves-Page:buck4u-home-page
pwc_ro->Page:purewaterclub.com->Ves-Page:pwc-home-page
3-2.)修改Mega Menu
共用目錄頁->blank:menu-top(不存在,不會出現)
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Megamenu/layout/default.xml
menu-top
b4u_home->7pm:menu-top-b4u
/var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Megamenu/layout/default.xml
menu-top-b4u
pwc_ro->6pm:menu-top-pwc
/var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/Ves_Megamenu/layout/default.xml
menu-top-pwc
改goto old site -> http://last.pureaterclub.com/
4.)重新建立圖片根位置連結
cd /var/www/html/magento8pm/pub/media/
mv catalog catalog-0
ln -s /var/www/html/pwpic/catalog/ /var/www/html/magento8pm/pub/media/
mv wysiwyg wysiwyg-0
ln -s /var/www/html/pwpic/wysiwyg/ /var/www/html/magento8pm/pub/media/
mv /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/images /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/images-0
mv /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/images /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/images-0
mv /var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/web/images /var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/web/images-0
ln -s /var/www/html/pwpic/themeimg/images/ /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/
ln -s /var/www/html/pwpic/themeimg/images/ /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/
ln -s /var/www/html/pwpic/themeimg/images/ /var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/web/
5.)修改自建目錄頁連結
改pwc-dir-47->Design
http://www.buck4all.com/index.php/ro/replacement.html -> ro/replacement.html
改pwc-dir-50->Design
改pwc-dir-65->Design
改pwc-dir-68->Design
http://www.buck4all.com/index.php/ro/combo-set.html -> combo-set.html
6.)重新導入Old RO 客戶資料
->手工刪除Old RO 黑客注冊垃圾帳號
DELETE FROM address_book WHERE entry_country_id='50' -> 1 record (CK Cook Islands)
DELETE FROM address_book WHERE entry_country_id='17' -> 2 record (BH Bahrain)
DELETE FROM address_book WHERE entry_country_id='88' -> 1 record (GU Guam)
DELETE FROM address_book WHERE entry_country_id='232' -> 1 record (VI Virgin Islands (U.S.)
UPDATE customers LEFT JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id SET customers_email_memo='xxxxx' WHERE address_book_id IS NULL -> 5 record
DELETE FROM customers WHERE customers_email_memo='xxxxx' -> 5 record
->http://www.purewaterclub.com/gen-customer-csv.php
Checked rows: 9126, checked entities: 18252, invalid rows: 0, total errors: 0
->手工刪除mag2 客戶資料無用帳號
ID=2066->lake757@yahoo.com->VI
ID=6462->mm@mm.com
ID=6515->mmm@mm.com
ID=7536->ugamnut56@hotmail.com->GU
Customers 9129 records found
7.)清Catalog + Attribute Set + Product Attributes
刪Catalog
A total of 71(disable)+19(qq%)+(Arcadio Gym Short-33-Red) have been deleted.
362 records found + (ADA-TEST-Metal aerator faucet adapter SP-aerator-M->ADA-TEST)
->更新產品出錯Required parameter 'theme_dir' was not passed
刪除theme Zou,6pm,7pm 重新添加新theme 6pm,7pm
刪除表theme中的x-Venustheme - 8pm,Zou/demo
刪Attribute Set
Bag,Bottom,Downloadable,Gear,ro-qq-003,Sprite Stasis Ball,Sprite Yoga Strap,Top
The attribute set has been removed.(8 record)
增加Product Attributes
free_shipping,b4_free_shipping
修改Attribute Set:default
刪Product Attributes 舊的8pm + ro-qq
activity,Category Gear,Climate,Collar,eco_collection,erin_recommends,features_bags,format,gender,pattern,performance_fabric,size,
sleeve,strap_bags,style_bags,style_bottom,style_general
ro_qq_003_size
You deleted the product attribute.
53 records found
---------------------- ADA 20200311 AM 10:00 Backup All -----------------------
8.)改目錄頁footer
Manage Elements->pwc-footer
cd /var/www/html/magento8pm/vendor/magento/module-theme/view/frontend/layout/
mv default.xml default.xml-0
wget http://www.purewaterclub.com/default.xml
9.)install extension disable compare
cd /var/www/html/magento8pm/app/code/
mkdir Bss/DisableCompare
cd Bss/DisableCompare
wget http://www.purewaterclub.com/aws-ext-20200215.zip -> unzip aws-ext-20200215.zip
cd /var/www/html/magento8pm
/usr/bin/php bin/magento module:enable --clear-static-content Bss_DisableCompare
-------- 以下禁作,疑似可能造成刷卡功能失敗 --------------------------------
To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Generated static view files cleared successfully
/usr/bin/php bin/magento setup:upgrade
/usr/bin/php bin/magento setup:di:compile
--- 20200309-11 恢復刷卡功能->還原目錄 magento8pm-20200121 + 資料庫 magento8pm-20200215-ok + 重新補作所有修改
=========================================================================================================================
改theme 8pm short description tilte為shipping
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/Magento_Catalog/templates/product/view
joe product_info_main.phtml
->
FREE SHIPPING ON ORDERS OVER $35
Shipping and handling
Free shipping on orders over $35.00 when you buy ellielantern's other eligible items, and use the cart to make your purchase.
$0.25 shipping for each additional eligible item you buy from ellielantern, when you use the cart to make your purchase.
Shipping discount will be applied when you add qualifying items from ellielantern to your cart
All promotional offers from ellielantern
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Themesettings/web/
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Themesettings/web/
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/Ves_Themesettings/web/
chown www-data:www-data css
The system has an issue when create css file
Message: The path "design/frontend/Venustheme/7pm/Ves_Themesettings/web/css:///var/www/html/magento8pm/app/var/www/html/magento8pm/app/" is not writable
The system has an issue when create css file
Message: The path "design/frontend/Venustheme/7pm/Ves_Themesettings/web/css:///var/www/html/magento8pm/app/var/www/html/magento8pm/app/" is not writable
The system has an issue when create css file
Message: The path "design/frontend/Venustheme/6pm/Ves_Themesettings/web/css:///var/www/html/magento8pm/app/var/www/html/magento8pm/app/" is not writable
tar -czf pwpic-20200223.tar.gz *
-rw-r--r-- 1 root root 274210605 Feb 24 01:25 pwpic-20200223.tar.gz
zip -r pwpic-20200223.zip ./
-rw-r--r-- 1 root root 285427566 Feb 24 01:29 pwpic-20200223.zip
DELETE FROM address_book WHERE entry_street_address LIKE '%minsk%' AND entry_city LIKE '%minsk%' -> 2 record
DELETE FROM address_book WHERE entry_lastname LIKE 'dhfh' -> 3 record
DELETE FROM address_book WHERE entry_country_id='121' -> 1 record (LY Libyan)
UPDATE customers LEFT JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id SET customers_email_memo='xxxxx' WHERE address_book_id IS NULL -> 5 record
DELETE FROM customers WHERE customers_email_memo='xxxxx' -> 5 record
Checked rows: 9, checked entities: 18, invalid rows: 0, total errors: 0
Customers 9117 records found
去掉產品頁Paypal+Paypal credit icon
STORES->Configuration->SALES->Payment Methods->PayPal Express Checkout->Configure->Basic Setting->Display on Product Details Page->No
--- 20200224 打包下載所有圖片 + 建 mag2.purewaterclub.com 取代 www.buck4all.com + 補上傳新增9客戶資料
=========================================================================================================================
添加新theme 6pm
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/
cp 8pm 6pm -r
cd 6pm
joe registration.php
joe theme.xml
直接改不同的default.xml可改變Ves header使用MegaMenu的名稱
blank的menu一定要用,被設為default(menu-top),無法在目錄頁針對不同Theme對應不同menu
1.)blank(關閉menu給pwc+b4共用目錄頁Theme)
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Megamenu/layout/default.xml
menu-top
2.)b4u
/var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Megamenu/layout/default.xml
menu-top-b4u
3.)pwc
/var/www/html/magento8pm/app/design/frontend/Venustheme/6pm/Ves_Megamenu/layout/default.xml
menu-top-pwc
--- 20200223 增加新 theme 6pm
=========================================================================================================================
1.)合併所有圖片pwpic + /var/www/html/magento8pm/pub/media/
cd /var/www/html/pwpic/catalog/
mkdir category
cd category
cp -r /var/www/html/magento8pm/pub/media/catalog/category/* ./
mkdir product
cd product
cp -r /var/www/html/magento8pm/pub/media/catalog/product/* ./
重新安排圖片位置
mv /var/www/html/pwpic/items /var/www/html/pwpic/webimg/items
mv /var/www/html/pwpic/catalog/images/* /var/www/html/pwpic/import/*
圖片根位置:
/var/www/html/pwpic/ ->
/catalog/category/ (系統目錄圖片位置) -> ln -s /var/www/html/pwpic/catalog/ /var/www/html/magento8pm/pub/media/
/catalog/product/ (系統產品圖片位置) -> ln -s /var/www/html/pwpic/catalog/ /var/www/html/magento8pm/pub/media/
/wysiwyg/ (自建目錄頁圖片位置url media)-> ln -s /var/www/html/pwpic/wysiwyg/ /var/www/html/magento8pm/pub/media/
/themeimg/ (Theme使用logo-背景圖片位置)-> ln -s /var/www/html/pwpic/themeimg/images/ /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/
/import/ (後台import上傳產品csv圖片位置)
/webimg/ (pwc產品說明頁img src圖片位置)
修改aws.wg-1.com 指向+對應 AWS /var/www/html/pwpic/webimg
cd /etc/apache2/sites-available
joe aws-wg-1.conf ->
DocumentRoot /var/www/html/pwpic -> DocumentRoot /var/www/html/pwpic/webimg
service apache2 restart
測試上傳產品csv圖片成功
sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,related_position,crosssell_skus,crosssell_position,upsell_skus,upsell_position,additional_images,additional_image_labels,hide_from_product_page,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,bundle_shipment_type,associated_skus
ADA-TEST,,b4_bag,simple,"Default Category/PWC,Default Category/PWC/Parts & Tools,Default Category/PWC/Parts & Tools/Feeders,Default Category/PWC/Parts & Tools/Fittings",base,ADA-TEST,,,1,1,0,"Catalog, Search",0.1,,,,ada-test,,,,"/import/22-103.jpg",,"/import/22-08.jpg",,"/import/22-08.jpg",,"/import/22-08.jpg",,"2/3/20, 5:23 PM","2/18/20, 8:08 PM",,,Block after Info Column,,,,No,,,,,,,Use config,,"b4_free_shipping=Yes,featured=Yes,free_shipping=Yes,new=No",999,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,,,,,,,,,,,,,,,,
2.)改原系統位置名稱 + 搬離至pwpic-0
mv /var/www/html/magento8pm/pub/media/catalog /var/www/html/magento8pm/pub/media/catalog-0
mv /var/www/html/magento8pm/pub/media/wysiwyg /var/www/html/magento8pm/pub/media/wysiwyg-0
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/
mv images/ images-0
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/
mv images/ images-0
mv /var/www/html/magento8pm/pub/media/catalog-0 /var/www/html/pwpic-0/
mv /var/www/html/magento8pm/pub/media/wysiwyg-0 /var/www/html/pwpic-0/
3.)建catalog,wysiwyg連結
ln -s /var/www/html/pwpic/catalog/ /var/www/html/magento8pm/pub/media/(產品圖片)
ln -s /var/www/html/pwpic/wysiwyg/ /var/www/html/magento8pm/pub/media/(系統使用圖片路徑 url media)
ln -s /var/www/html/pwpic/themeimg/images/ /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/(Theme使用logo-背景圖片位置)
ln -s /var/www/html/pwpic/themeimg/images/ /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/(Theme使用logo-背景圖片位置)
--- 20200222-23 整理aws所有圖片 + 新位置連結 -> /var/www/html/pwpic/
=========================================================================================================================
1.) shipping: 現在新RO站(包括將來的1元店)的shipping有3種
a.) 原本舊RO站的free-shipping->只要是同一order有買正常單價的item,就可以整單都free
b.) 新增1元站(b4_free_shippint)->只要買了1元店站b4_free_shipping的item加起來滿$25(金額可隨時修改),就整單都free
c.) 如果以上2個條件都沒有,就收$5(金額可隨時修改,也可以改成按zone,重量計算)
2.) ebay: 因為QT2進了很多包裝材料,所以請先從包裝材料開始上架ebay和1元站的銷售
a.) 請把ebay的cutiepetinc帳號改成 buck4u*com
b.) 請先參考以下1元站我已經上架的poly bubble mailers(珠光膜氣泡信封),
http://www.buck4all.com/index.php/poly-bubble-mailer.html
其中表上的Qty/Set是我用成本價小於等於US$0.3(人民幣2元)倒算出來的1元的數量,是按之前計劃好的(產品成本30%,locat運費30%,利潤30%,其他10%計算),
實際應該出的數量,要請你仔細估算成本運費後,再通知我要如何修正,另外你也可以不用賣1元的方式,直接上架ebay,請你自己決定,以下是ebay的熱門seller和ULINE的參考
https://www.uline.com/BL_1255/Uline-Bubble-Lined-Poly-Mailers
https://www.ebay.com/itm/100-50-Poly-Mailer-Bubble-Mailers-Padded-Envelopes-6x9-8-5x11-9x12-5x7-3x5-4x6/272820340492
(這一家在wulnat,可以好好參考一下)
https://www.ebay.com/itm/50-000-4x8-Poly-Bubble-Padded-Envelopes-Mailer/321898703486
https://www.ebay.com/itm/Wholesale-10Pcs-Poly-Bubble-Mailers-Padded-Envelopes-Shipping-Bags-Self-Seal/232374230866
https://www.ebay.com/itm/25-0-Glamour-Metallic-Pink-Poly-Bubble-Mailers-Envelopes-Bags-6x10-DVD-Wide-CD/292602069600?epid=5020360655
c.) 請先在試一下在ebay用cutiepetinc和purewaterclub*com帳號分別上架poly bubble mailers(珠光膜氣泡信封),
附件有name(101.c.txt) + 說明(101.c.html) + 產品主圖組 (101.c.jpg.zip) + 原始圖片(101-0.jpg.zip) + 標示文字圖片(101.jpg.zip) + photoshop工作檔案(101.c.psd)請SC教你如何操作
d.) 101.c->代表(101.01-101.11)的configute product (讓客人用來挑選不同尺寸規格的虛擬產品,將來1元站會大量使用), 客人挑選後下單的是(101.01x16~101.11x3)共11種產品組合中的一種
--- 20200221 交接 poly bubble mailer to ebay
=========================================================================================================================
修改Store View buck4u.com home page->b4u_home
cd /etc/apache2/sites-available
joe buck4u.conf ->
joe buck4u-ssl.conf ->
SetEnv MAGE_RUN_CODE "b4u_home" -> 原為 "demo2"
service apache2 restart
find . -name "101.c*"
目錄圖片的位置
/var/www/html/magento8pm/pub/media/catalog/category/100-GDP.png
(20200222)改連結到/var/www/html/pwpic/catalog/category/100-GDP.png
產品圖片的位置
/var/www/html/magento8pm/pub/media/catalog/product/1/0/101.c-5.jpg
(20200222)改連結到/var/www/html/pwpic/catalog/product/1/0/101.c-5.jpg
/1/0/->取圖片名的前2字母
/cache/->分5子目錄->image,small_image,swatch_image,swatch_thumb,thumbnail->其下再分不同尺寸圖片目錄,為cache的圖片最後位置
導入產品圖片的位置
/var/www/html/pwpic/
/catalog/images/->產品主圖
/items/->產品說明插圖片
/wysiwyg/pwc/->子目錄連結用圖片->ln -s /var/www/html/pwpic/wysiwyg/pwc/ /var/www/html/magento8pm/pub/media/wysiwyg/(系統使用圖片路徑)
(20200222)刪除pwc連結,改直接連結上一層到/var/www/html/pwpic/wysiwyg
/pwpic/->link to /var/www/html/pwpic/(為了導入產品時填Images File Directory用?)
(20200222)刪除pwpic連結
成功->(20200222)改連結到/var/www/html/pwpic/
放棄->改產品圖片的位置->b4pic:
cd /var/www/html/b4pic/
mkdir catalog/product
cd catalog/product
cp -r /var/www/html/magento8pm/pub/media/catalog/product/* ./
apt-get install zip
apt-get install unzip
zip -r b4pic.zip ./
http://aws.wg-1.com/ -> 指向 /var/www/html/pwpic/
cd /var/www/html/pwpic/
mv /var/www/html/b4pic/catalog/product/b4pic.zip ./
zip -r pwpic.zip ./(x->無限遁環立即占滿所有空間)
--- 20200220 修改 buck4u.com home page + 整理圖片位置 + 下載備份圖片
=========================================================================================================================
1.)RO free_shipping->如果單內有一件free_shipping item->整單free shipping
2.)B4 free_shipping $25+ ->如果單內所有b4_free_shipping合計金額大於等於$25->整單free shipping
3.)Configued product在Cart Price Rules判斷中會以Configure product的attribute為主,而不是以各別的simple product
改PWC->dollar sale->b4_free_shipping
$1->SP-CRT,SP-6044Q,SP-Y,SP-7044Q,SP-7042Q,SP-6044Q,SP-0404Q,SP-4041Q,SP-1044,SP-C clip,SP-aerator-M,SP-aerator-p
$1+->SP-132Q,SP-Q34A,SP-FV
--- 20200218-20 buck4u free shipping
=========================================================================================================================
刪Catalog
A total of 72(disable)+19(qq%) have been deleted.
362 records found + ADA-TEST-Metal aerator faucet adapter SP-aerator-M
刪Attribute Set
Bag,Bottom,Downloadable,Gear,ro-qq-003,Sprite Stasis Ball,Sprite Yoga Strap,Top
The attribute set has been removed.(8 record)
修改Attribute Set:default
增加Product Attributes
free_shipping,b4_free_shipping
刪Product Attributes 舊的8pm() + ro-qq
activity,Category Gear,Climate,Collar,eco_collection,erin_recommends,features_bags,format,gender,pattern,performance_fabric,size,
sleeve,strap_bags,style_bags,style_bottom,style_general
ro_qq_003_size
You deleted the product attribute.
53 records found
140e8587c46ea4afc679cb70bae56341:70:0->aa223344-osc-v.1
$P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:0->aa223344-osc-v.2
關閉wysiwyg editer
STORES->Configuration->General->Content Management->WYSIWYG Options->Enable WYSIWYG Editor->Disabled Completely
--- 20200216 清Catalog + Attribute Set + Product Attributes + 關閉wysiwyg editer
=========================================================================================================================
extension disable compare
Access Keys
Public Key: 0c2e51e0297016e62e864f5effe625c7
Private Key: 38410b35ec042696d687ee7c90436d88
Click install extension
Once you redirected to Keys page copy private and public access key
Login to your store admin panel
Go to System > Configurations
Add your public and private key
Save & refresh your page
Web Setup Wizard->404
registration.php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Bss_DisableCompare',
__DIR__
aws: cd /var/www/html/magento8pm/app/code/
mkdir Bss/DisableCompare
cd Bss/DisableCompare
wget http://www.purewaterclub.com/aws-ext-20200215.zip -> unzip aws-ext-20200215.zip
cd /var/www/html/magento8pm
/usr/bin/php bin/magento module:status
-->
List of enabled modules:
Magento_Store
Magento_AdvancedPricingImportExport
Magento_Directory
Magento_Theme
Magento_Backend
Magento_Backup
Magento_Eav
Magento_Customer
Magento_BundleImportExport
Magento_CacheInvalidate
Magento_AdminNotification
Magento_Indexer
Magento_CatalogImportExport
Magento_Cms
Magento_Rule
Magento_Catalog
Magento_Search
Magento_CatalogUrlRewrite
Magento_Widget
Magento_Quote
Magento_CheckoutAgreements
Magento_SalesSequence
Magento_CmsUrlRewrite
Magento_Config
Magento_ConfigurableImportExport
Magento_Msrp
Magento_Contact
Magento_Cookie
Magento_Cron
Magento_CurrencySymbol
Magento_Bundle
Magento_CustomerImportExport
Magento_Deploy
Magento_Developer
Magento_Dhl
Magento_Authorization
Magento_Downloadable
Magento_ImportExport
Magento_Payment
Magento_Email
Magento_User
Magento_Fedex
Magento_Sales
Magento_CatalogInventory
Magento_GoogleAnalytics
Magento_Ui
Magento_GroupedImportExport
Magento_GroupedProduct
Magento_DownloadableImportExport
Magento_Checkout
Magento_Security
Magento_LayeredNavigation
Magento_Marketplace
Magento_MediaStorage
Magento_CatalogRule
Magento_Multishipping
Magento_ConfigurableProduct
Magento_Newsletter
Magento_OfflinePayments
Magento_SalesRule
Magento_PageCache
Magento_Captcha
Magento_Vault
Magento_Persistent
Magento_ProductAlert
Magento_ProductVideo
Magento_Authorizenet
Magento_Reports
Magento_RequireJs
Magento_Review
Magento_Rss
Magento_CatalogRuleConfigurable
Magento_Paypal
Magento_SalesInventory
Magento_OfflineShipping
Magento_GoogleAdwords
Magento_SampleData
Magento_CatalogSearch
Magento_Integration
Magento_SendFriend
Magento_Shipping
Magento_Sitemap
Magento_NewRelicReporting
Magento_Swagger
Magento_Swatches
Magento_SwatchesLayeredNavigation
Magento_Tax
Magento_TaxImportExport
Magento_GiftMessage
Magento_Translation
Magento_GoogleOptimizer
Magento_Ups
Magento_UrlRewrite
Magento_EncryptionKey
Magento_Usps
Magento_Variable
Magento_Braintree
Magento_Version
Magento_Webapi
Magento_WebapiSecurity
Magento_Weee
Magento_CatalogWidget
Magento_Wishlist
Ves_All
Ves_BaseWidget
Ves_Blog
Ves_Brand
Ves_Megamenu
Ves_PageBuilder
Ves_Productlist
Ves_Setup
Ves_Testimonial
Ves_Themesettings
List of disabled modules:
Bss_DisableCompare
/usr/bin/php bin/magento module:enable --clear-static-content Bss_DisableCompare
/usr/bin/php bin/magento setup:upgrade
/usr/bin/php bin/magento setup:di:compile
/usr/bin/php bin/magento setup:upgrade->出現error
[Exception]
Notice: Use of undefined constant MCRYPT_RIJNDAEL_256 - assumed 'MCRYPT_RIJ
NDAEL_256' in /var/www/html/magento8pm/vendor/magento/framework/Encryption/
Encryptor.php on line 454
x->裝mcrypt->沒用(而且mcrypt版本錯誤導致舊RO-account login失敗)
sudo apt-get install mcrypt php7.0-mcrypt
sudo service apache2 restart
---------------
重新安裝mcrypt新版本+改用舊SQL-magento8pm-20200210才解決舊RO-account login成功
sudo apt-get install mcrypt php7.1-mcrypt
sudo service apache2 restart
---------------
加直接改Encryptor.php->return null;->不會出現報錯
joe /var/www/html/magento8pm/vendor/magento/framework/Encryption/Encryptor.php
protected function getCrypt($key = null, $cipherVersion = null, $initVector = true)
{
return null;
/*
return new Crypt($key, $cipher, $mode, $initVector);
*/
}
-----------------
後台設disable compare
STORES->Configuration->BSS COMMERCE->Disable Compare Configuration->YES
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
-----------------
禁用Ves_Brand
/usr/bin/php bin/magento module:disable --clear-static-content Ves_Brand
The following modules have been disabled:
- Ves_Brand
Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Generated static view files cleared successfully.
-----------------
496ccbf39792a0aa94cbec4840bee1c526c1c53cbb18445df8692135624fc9cf:ABN45WVliJG7OXcRboPpHhH01usqfRdd:1
df7cde40bc6922f8a885a21ebe8fd4b0:70:0->??+alberto.jany@woodgroup.com
140e8587c46ea4afc679cb70bae56341:70:0->aa223344-osc-v.1
$P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:0->aa223344-osc-v.2
08ed410c41d46dff63fc73c41aa8df1c3025e0397ece2ae59ebcaaed191c0ae3:kJ17CNzHgKZsKbbmWakPvzEFzFCaWCzw:1->??
--- 20200215 安裝插件 Extension DisableCompare + 禁用Ves_Brand
=========================================================================================================================
改8pm media url->pwpic:
cd /var/www/html/pwpic/
mkdir wysiwyg/pwc
cd wysiwyg/pwc
cp /var/www/html/magento8pm/pub/media/wysiwyg/pwc/*.jpg ./
ln -s /var/www/html/pwpic/wysiwyg/pwc/ /var/www/html/magento8pm/pub/media/wysiwyg/
pwpic圖片目錄:
aws: cd /var/www/html/pwpic/
ls -l
drwxr-xr-x 3 root root 4096 Dec 4 13:00 catalog -> /images/ -> 放RO站主圖
drwxr-xr-x 5 root root 4096 Dec 4 13:00 items -> /Driver /PW-Pic /Pic -> 放RO站產品說明連結圖
lrwxrwxrwx 1 root root 19 Jan 30 10:12 pwpic -> /var/www/html/pwpic -> import product csv,填 Images File Directory -> pwpic link指向/var/www/html/pwpic
drwxr-xr-x 4 root root 4096 Dec 13 04:23 simplehtmldom -> 分析html結構的PHP Lib
drwxr-xr-x 3 root root 4096 Feb 14 04:37 wysiwyg -> /wysiwyg/pwc/ -> 8pm media url -> 子目錄圖片
aws: cd /var/www/html/pwpic/catalog/images/
wget http://www.purewaterclub.com/aws-20200127.zip -> unzip aws-20200127.zip
attribute_set_code
configurable_variations
sku=RO-QQ-003-2cmx100M-Black,ro_qq_003_size=2cmx100M,color=Black|
sku=RO-QQ-003-2cmx100M-Blue,ro_qq_003_size=2cmx100M,color=Blue|
sku=RO-QQ-003-2cmx100M-Brown,ro_qq_003_size=2cmx100M,color=Brown|
sku=RO-QQ-003-2.5cmx100M-Black,ro_qq_003_size=2.5cmx100M,color=Black|
sku=RO-QQ-003-2.5cmx100M-Blue,ro_qq_003_size=2.5cmx100M,color=Blue|
sku=RO-QQ-003-2.5cmx100M-Brown,ro_qq_003_size=2.5cmx100M,color=Brown|
sku=RO-QQ-003-3cmx200M-Black,ro_qq_003_size=3cmx200M,color=Black|
sku=RO-QQ-003-3cmx200M-Blue,ro_qq_003_size=3cmx200M,color=Blue|
sku=RO-QQ-003-3cmx200M-Brown,ro_qq_003_size=3cmx200M,color=Brown
|sku=RO-QQ-003-Brown,ro_qq_003_size=3cmx2000M,color=Brown
新增attribute要加manage tile才會出現在configure product的Select Attributes
BUG->新增attribute-option-text swatch(dropdown只能改一次,就改不回去)-要重新copy-paste-否則default空白不會出現
VENUSTHEME->General,Header點進去空白已不可考,除非選pws-xxx page-OK
--- 20200214-15 configure product
=========================================================================================================================
ADMIN dv4mlmag ; $ML5477ml dv4ml@dacomputing.com
改目錄背景圖:bg_brc.jpg
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/images/
mv bg_brc.jpg bg_brc-8pm.jpg
wget http://www.purewaterclub.com/bg_brc.jpg
Everything's $1. What will you find?
Sign In or Create an Account
Track Orders
0
Home Shop By Business
Shop By Business
Florists & Gift Shops
Weddings, Catering & Events
Restaurants, Bars & Hospitality
Care Facilities
Religious & Nonprofit Organizations
Cleaning Services
--- 20200212 mag2 開帳號給ML + 改目錄背景圖
=========================================================================================================================
手工刪除黑客注冊垃圾帳號
DELETE FROM address_book WHERE entry_street_address LIKE '%minsk%' AND entry_city LIKE '%minsk%' -> 29 record
DELETE FROM address_book WHERE entry_country_id<>'223' AND entry_street_address LIKE '%?%' -> 1 record
DELETE FROM address_book WHERE entry_country_id='147' -> 2 record (NA Navibia)
DELETE FROM address_book WHERE entry_country_id='17' -> 4 record (BH Bahrain)
DELETE FROM address_book WHERE entry_country_id='1' -> 141 record (AF Afghanistan)
DELETE FROM address_book WHERE entry_country_id='14' -> 1 record (AT Austria)
DELETE FROM address_book WHERE entry_country_id='193' -> 3 record (ZA South Africa)
DELETE FROM address_book WHERE entry_country_id='229' -> 2 record (VE Venezuela)
DELETE FROM address_book WHERE entry_country_id='220' -> 3 record (UA Ukiain)
DELETE FROM address_book WHERE entry_country_id='184' -> 3 record (SA Saudi Arabia)
DELETE FROM address_book WHERE entry_country_id='166' -> 1 record (PY Paraguay)
DELETE FROM address_book WHERE entry_country_id='168' -> 4 record (PH Philippines)
DELETE FROM address_book WHERE entry_country_id='167' -> 7 record (PE Peru)
DELETE FROM address_book WHERE entry_country_id='44' -> 1 record (CN China)
DELETE FROM address_book WHERE entry_country_id='21' -> 1 record (BE Belgium)
DELETE FROM address_book WHERE entry_country_id='24' -> 1 record (BM Bermuda)
DELETE FROM address_book WHERE entry_country_id='32' -> 1 record (BN Brunei Darussalam)
DELETE FROM address_book WHERE entry_country_id='83' -> 1 record (GI Gibraltar)
DELETE FROM address_book WHERE entry_country_id='84' -> 7 record (GR Greece)
DELETE FROM address_book WHERE entry_country_id='96' -> 3 record (HK Hong Kong)
DELETE FROM address_book WHERE entry_country_id='53' -> 3 record (HR Croatia)
DELETE FROM address_book WHERE entry_country_id='97' -> 5 record (HU Hungary)
DELETE FROM address_book WHERE entry_country_id='100' -> 2 record (ID Indonesia)
DELETE FROM address_book WHERE entry_country_id='103' -> 3 record (IE Ireland)
DELETE FROM address_book WHERE entry_country_id='104' -> 9 record (IL Israel)
DELETE FROM address_book WHERE entry_country_id='99' -> 10 record (IN India)
DELETE FROM address_book WHERE entry_country_id='101' -> 2 record (IR Iran)
DELETE FROM address_book WHERE entry_country_id='105' -> 5 record (IT Italy)
DELETE FROM address_book WHERE entry_country_id='113' -> 1 record (KR Korea)
DELETE FROM address_book WHERE entry_country_id='114' -> 1 record (KW kuwait)
DELETE FROM address_book WHERE entry_country_id='118' -> 1 record (LB Lebanon)
DELETE FROM address_book WHERE entry_country_id='126' -> 1 record (MK Macedonia)
DELETE FROM address_book WHERE entry_country_id='132' -> 1 record (MT Malta)
DELETE FROM address_book WHERE entry_country_id='136' -> 1 record (MU Mauritius)
DELETE FROM address_book WHERE entry_country_id='130' -> 1 record (MV Maldives)
DELETE FROM address_book WHERE entry_country_id='129' -> 6 record (MY Malaysia)
DELETE FROM address_book WHERE entry_country_id='150' -> 1 record (NL Netherlands)
DELETE FROM address_book WHERE entry_country_id='55' -> 2 record (CY Cyprus)
DELETE FROM address_book WHERE entry_country_id='60' -> 1 record (DO Dominica)
DELETE FROM address_book WHERE entry_country_id='195' -> 2 record (ES Spain)
DELETE FROM address_book WHERE entry_country_id='203' -> 4 record (SE Sweden)
DELETE FROM address_book WHERE entry_country_id='188' -> 9 record (SG Singapore)
DELETE FROM address_book WHERE entry_country_id='209' -> 2 record (TH Thailand)
DELETE FROM address_book WHERE entry_country_id='215' -> 2 record (TR Turkey)
DELETE FROM address_book WHERE customers_id=9100 -> 1 record ->亂填
Last->手工刪除表:customers->無地址address_book
UPDATE customers LEFT JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id SET customers_email_memo='xxxxx' WHERE address_book_id IS NULL -> 129 record
DELETE FROM customers WHERE customers_email_memo='xxxxx' -> 129 record
_address_fax -> 1-2 -> {fax} -> 放舊RO站"付款" - "未付款"次數
Checked rows: 9108, checked entities: 18216, invalid rows: 0, total errors: 0
COPY SQL magento8pm -> magento8pm20200210: ERROR
ALTER TABLE `catalog_eav_attribute` ADD CONSTRAINT `CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE;
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:01
Customer Grid index has been rebuilt successfully in 00:00:09
Category Products index has been rebuilt successfully in 00:00:02
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:01
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:01
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:11
->9110 records found
last->customers_id9958(Joshua-Peterson)+address_book_id=12859
--- 20200211 old-RO customer 資料 -> mag2
=========================================================================================================================
1.)請你先檢查一下新的RO站的所有細節, 目前只剩老客人的資料還沒有轉過去, 其他都轉好了, 看看還有有什麼問題或建議, 尤其是手機請多試一下
http://www.buck4all.com/
2.) 附件的excel表有QT2的裝箱明細和產品編號表, QT2到貨後,因為這一批貨有1千多款,而且都是新貨又非常複雜,所以請一定要按表上的明細拆箱,一一對照後把貨先歸好,不然萬一混在一起後,將來很難分辨
3.) QT2的貨目前發現有以下4個失誤,請你幫忙修改
3-a.)第116箱的地毯膠帶(209.01-209.10)漏了秤單品重量,請幫忙秤
3-b.)第134箱的10,000個(100小包)10絲白邊PE自封袋3cm*4cm編號錯記為107.02,請修改為正確107.20
3-c.)第134箱的500個(5小包) 10絲白邊PE自封袋13cm*18cm編號錯記為107.10,請修改為正確107.19
3-d.)第129箱的5個(1小袋) RJ45接頭-母轉2母編號錯記為322.06,請合併到同一箱的另一小袋相同款式的322.05
4.) QT2和將來一元站的貨號規則如下:
1.) BSKU - Basic SKU: 單品最小實際庫存, 依不同尺寸, 顏色, 款式編不同貨號
編碼規則為 aaa.bb -> aaa為分類編號, bb為分類下的產品號
Ex1: 101為珠光膜氣泡信封, 101.01為11cm*11cm+4cm, 101.09為20cm*25cm+4cm
Ex2: 212為美紋紙手撕膠帶, 202.01為6mm*12m-黑色, 212.30為12mm*12m-淺藍色
1-a.) 數量直接可數的->例如: 1個, 1條, 1捲, 1片
1-b.) 需要裁剪長度的->例如: 大捲的魔術貼1米, 大捲熱縮管1米, 大捲反光織帶1米
1-c.) 低單價需要配對使用的合併編號->例如: , 迷你鰐魚夾測試線5色套, 汽車電源端子公母1對, 小鱷魚夾正負1對, 雙絞線傳輸器左右1對, POE分離器左右1對, 香蕉頭插座黑紅1對
1-d.) 高單價需要配對使用的分開編號->例如: 大鱷魚夾正極黑色, 大鱷魚夾負極紅色, 香蕉頭純銅鍍金直針型黑色, 香蕉頭純銅鍍金直針型紅色
1-e.) 超低單價不容易數的預包裝好的整包編號->例如: 金屬紮絲400pcs, 紙紮絲100pcs, 蝴蝶結紮絲20pcs, 尼龍紮帶*100pcs, 背膠圓點魔術貼15mm*30對
1-f.) 客戶不可挑選顏色的編相同貨號->例如: 彩色帶透明蓋彈簧U型剪刀, 彩色長柄洗杯刷, 彩色轉換插座, 彩色RJ45直通接頭, 彩色殼鍍金頭音頻線
2.) SKU - Stock Keeping Unit: 實際銷售單位, 由同一種BSKU數量一個以上或數個BSKU組成
編碼規則為 BSKU + qqq -> aaa.bb + qqq-> aaa.bb 為BSKU+ qqq為數量或附加碼
2-a.) 數量為100個的倍數直接加h,200個加h2->例如: 100個自粘OPP袋為105.01h, 200個水晶頭為321.02h2
2-b.) 數量為不是100個整數先加(x) 再加數量->例如: 10個珠光膜氣泡信封為101.07x10, 25個白快遞袋為104.01x25
2-c.) 不同bsku組成挑主要產品的bsku先加附加碼(s) 再加不重覆流水號(1~99)->例如: 100個水晶頭配100個護套321.01s1
2-d.) 數量為1000個的倍數直接加k,2000個加k2->例如: 目前沒有
--- 20200210 QT2 packing detail + BSKU + SKU 規則
=========================================================================================================================
增加新Store View
1.)STORES->All Stores->Create Store View->pwc:pwc_buck4aqua
2.)STORES->Configuration->選Store View(pwc:pwc_buck4aqua)->GENERAL:Web->Base URLs + Secure Base URL + CMS Home Page
3.)DNS A buck4aqua.buck4all.com -> 18.218.158.219
4.)cd /etc/apache2/sites-available
cp buck4u.conf pwc_buck4aqua.conf ->
joe pwc_buck4aqua.conf ->
ServerName buck4aqua.buck4all.com
SetEnv MAGE_RUN_CODE "pwc_buck4aqua"
SetEnv MAGE_RUN_TYPE "store"
cd /etc/apache2/sites-available
ln -s /etc/apache2/sites-available/pwc_buck4aqua.conf /etc/apache2/sites-enabled/pwc_buck4aqua.conf
service apache2 restart
(20200209)修改
joe buck4all.conf
SetEnv MAGE_RUN_CODE "demo3" -> SetEnv MAGE_RUN_CODE "pwc_ro"
--- 20200209 增加 Store View + New Arrival + Feature Product + Our Service
=========================================================================================================================
Manage Elements->pwc-footer
/var/www/html/magento8pm/vendor/magento/module-theme/view/frontend/layout/default.xml
wget http://www.purewaterclub.com/default.xml
Shipping and Returns
pwc-shipping-returns
Privacy Notice
pwc-privacy-notice
RO FAQ
pwc-faq
My Account
customer/account
Membrane Rejection Chart
membrane-rejection-chart
Contact Us
pwc-contact-us
/var/www/html/magento8pm/vendor/magento/module-newsletter/view/frontend/layout/default.xml
/var/www/html/magento8pm/vendor/magento/module-cms/view/frontend/layout/default.xml
/var/www/html/magento8pm/vendor/magento/module-search/view/frontend/layout/default.xml
/var/www/html/magento8pm/vendor/magento/module-contact/view/frontend/layout/default.xml
/var/www/html/magento8pm/vendor/magento/module-sales/view/frontend/layout/default.xml
/var/www/html/magento8pm/vendor/magento/module-catalog-search/view/frontend/layout/default.xml
Contact表:
/var/www/html/magento8pm/vendor/magento/module-contact/view/frontend/layout/contact_index_index.xml
/var/www/html/magento8pm/vendor/magento/module-contact/view/frontend/templates/form.phtml
--- 20200206-08 Footer + Link + Contact
=========================================================================================================================
設定全站Theme:
CONTENT->Design Configuration->選Store Views(pwc English)->Edit->Default Theme->Applied Theme->Magento Blank(x-全站用Blank)
(20200208 改用Venustheme - 8pm,因為contact,my account,cart的form 字白色看不到 label:color #000)
CONTENT->Design Configuration->選Store Views(pwc English)->Edit->Default Theme->Applied Theme->Venustheme - 8pm(全站用8pm)
->設定首頁Logo:
Other Settings->Header->Logo Image
Logo Image Width->495
->設定首頁Footer:
Other Settings->Footer->Copyright
Copyright (C) 2020 all rights reserved.
加另外改manage element->PWC Footer->Design Elemment
設定首頁Page:
1.)STORES->Configuration->Store Views:選(pwc English)->Web->Default Pages->CMS Home Page->purewaterclub.com
2.)CONTENS->Pages->purewaterclub.com->Content->Widget Type->Ves Page Builder : Generate a page builder profile->Page Id->purewaterclub.com
->改首頁Theme:
Custom Design Update->New Theme->Venustheme - 8pm(x-只有首頁用8pm)
(20200208 不用改了)
首頁Page加子目錄圖片:
VENUSTHEME->Manage Page Profile->挑選page(purewaterclub.com)->Desgin Block->加(pwc-dir-47)
目錄頁設定:
PRODUCTS->Categories->Default Category->Design->Theme->Magento Blank(blank手機版可維持2排產品)
PRODUCTS->Catagories->挑選目錄(Filtration System)->Content->Add CMS Block->Block(dir_50)
CONTENS->Blocks->挑選Block(dir_50)->Widget Type->Ves Page Builder: Generate Element Profile->Element Id->(pwc-dir-50)
VENUSTHEME->Manage Element->挑選element(pwc-dir-50)->Design->widget->6 x (single image + heading tag)
子目錄圖片+連結:
VENUSTHEME->Manage Element->挑選element(pwc-dir-47)->Design widget->加4 x (single image + heading tag)
1.)Filtration System
Image File->wysiwyg/pwc/dir_50.jpg
Link->http://www.buck4all.com/index.php/ro/filtration-system.html
2.)Replacement
wysiwyg/pwc/dir_65.jpg
http://www.buck4all.com/index.php/ro/replacement.html
3.)Parts & Tools
wysiwyg/pwc/dir_68.jpg
http://www.buck4all.com/index.php/ro/parts-tool.html
4.)Buck4RO
wysiwyg/pwc/b4ro.jpg
http://www.buck4u.com
1.)Revese Osmosis
wysiwyg/pwc/dir_51.jpg
http://www.buck4all.com/index.php/ro/filtration-system/revese-osmosis.html
2.)Portable RO
wysiwyg/pwc/dir_55.jpg
http://www.buck4all.com/index.php/ro/filtration-system/portable-ro.html
3.)Whole House
wysiwyg/pwc/dir_59.jpg
http://www.buck4all.com/index.php/ro/filtration-system/whole-house.html
4.)Drinking Water
wysiwyg/pwc/dir_62.jpg
http://www.buck4all.com/index.php/ro/filtration-system/drinking-water.html
5.)Aquarium
wysiwyg/pwc/dir_63.jpg
http://www.buck4all.com/index.php/ro/filtration-system/aquarium.html
6.)Ultra Violet
wysiwyg/pwc/dir_64.jpg
http://www.buck4all.com/index.php/ro/filtration-system/ultra-violet.html
1.)Housing
wysiwyg/pwc/dir_66.jpg
http://www.buck4all.com/index.php/ro/parts-tools/housing.html
2.)Feeders
wysiwyg/pwc/dir_67.jpg
http://www.buck4all.com/index.php/ro/parts-tools/feeders.html
3.)Fittings
wysiwyg/pwc/dir_79.jpg
http://www.buck4all.com/index.php/ro/parts-tools/fittings.html
4.)Valves
wysiwyg/pwc/dir_80.jpg
http://www.buck4all.com/index.php/ro/parts-tools/valves.html
5.)Faucet-Tank-Tubes
wysiwyg/pwc/dir_81.jpg
http://www.buck4all.com/index.php/ro/parts-tools/faucet-tank-tubes.html
6.)Utilityes
wysiwyg/pwc/dir_82jpg
http://www.buck4all.com/index.php/ro/parts-tools/utilityes.html
cd /var/www/html/magento8pm/pub/media/wysiwyg/pwc/
wget http://www.purewaterclub.com/aws-20200209.zip -> unzip aws-20200209.zip
1.)Combo Set
wysiwyg/pwc/dir_70.jpg
http://www.buck4all.com/index.php/ro/replacement/combo-set.html
2.)Filters
wysiwyg/pwc/dir_71.jpg
http://www.buck4all.com/index.php/ro/replacement/filters.html
3.)Menbranes
wysiwyg/pwc/dir_72.jpg
http://www.buck4all.com/index.php/ro/replacement/menbranes.html
4.)Resin
wysiwyg/pwc/dir_73.jpg
http://www.buck4all.com/index.php/ro/replacement/resin.html
5.)Ultra Violet
wysiwyg/pwc/dir_74.jpg
http://www.buck4all.com/index.php/ro/replacement/ultra-violet.html
目錄頁子目錄圖片:dir 47,50,65,68
Catagory->block(dir_50)->element(pwc-dir-50)->widget(6 x pic + 6 x text)
調整圖片為(2x3,3x2,6x1行)
Widget:image collect->phone尺寸圖片位置為4+2
Bug->第3-Text如果打Fittings會一直亂碼->改Connecters Fittings
Ves Generate->Page Builder Profile->Ves Element->Widget
CONTENS->Pages->Ves Generate Page Builder Profile->Ves Element->Widget
Ves Generate Page Builder Profile->Ves Element->Widget
--- 20200203-05 首頁+目錄頁
=========================================================================================================================
設定首頁+目錄頁Theme->
CONTENT->Design Configuration->Edit->Default Theme->Applied Theme->
Magento Blank: 首頁第一行自動出現Ves Brand(可全部disable後消失) + Ves Menu在header下方整行 + 手機Ves Menu不會縮小左上角 + 產品列表自動適應成2~4行
Magento Luma: 首頁第一行自動出現Ves Brand(可全部disable後消失) + Ves Menu在header下方整行 + 手機Ves Menu不會縮小左上角 + 中間所有內容消失
Venustheme - 8pm/7pm: 首頁Ves Menu在header 正上方logo右側 + 產品列表PC 3行-手機 1行
關閉首頁(Blank/Luma)的Ves Brand:
1.)將brand中全部都disable or
2.)STORES->Configuration->VENUS - VENUSTHEME.COM->Brand->General Settings->Disabled
設定首頁的Page->STORES->Configuration->Store View:pwc English->GENERAL->Default Pages->CMS Home Page->Home Page(in CONTENTS->Pages)
Page Title->Home Page
Content->Content Heading->Home Page-dv
Homepage Pencil
Design->Layout Update XML
block-slideshow-bannertop
block-banner-center
new-products-carousel
banner-mass-bottom
product-tabs
banner-mass-bottom2
--- 20200202 product-list
=========================================================================================================================
Base URL for User Media Files:/var/www/html/magento8pm/pub/media/
8pm Slider dv
Look Book
Autums Collection For
Shop Now
Product2->New Arrival2
Product1->Product
Product->Product
Product3->Feature Items3
8pm image collection->Collection 2017
--- 20200201 8pm slider
=========================================================================================================================
www.buck4all.com->pwc
Stores->All Stores->pwc English
Stores->Configuration->Store View:>pwc English->Web->Default Pages->CMS Home Page->purewaterclub.com
VenusTheme->Page Builder->Block:purewaterclub.com->PAGE INFORMATION->Desgin Block->Elemment:8pm categories->Design Elemment->Widget:Show Categories information and subcategories
目錄頁加子目錄跑馬燈icon:
Products->Catagories->目錄->Content->Add CMS Block->dv-block
目錄頁左半列出子目錄
Display Settings->Anchor->No
目錄頁不要出現目錄圖
Configuration->VES THEMESETTINGS->General Settings->Category Image->No
目錄頁下方出現翻頁功能
Configuration->VES THEMESETTINGS->General Settings->Bottom Toolbar->Yes
產品對應目錄list表:catagory-list-20200129-1.csv
產生產品目錄csv->http://www.purewaterclub.com/gen-product-catagory-csv.php
->product-catagory-20200131-4.csv
->Import->Behavior:Add/Update
轉檔URL不可以有+ -> -pl-
strtolower(str_replace("+","%20",$tmpurl))
General system exception happened
Additional data: URL key for specified store already exists.
Checked rows: 362, checked entities: 362, invalid rows: 0, total errors: 0 -> Import successfully done
同步產品說明+名稱->http://aws.wg-1.com/gen-product-desc-name.php->
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
/usr/bin/php bin/magento cache:flush
//--- bug picture (圖片怪,不能用,需要重新抓圖上傳?)---------------
1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 37, 39
FS-5BM150 /catalog/images/FS-5BM150.JPG
FS-4M100 /catalog/images/4PM100.jpg
1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 25
PT-TANK02UG /catalog/images/tank.jpg
1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 69, 72, 75, 98
POQ-5BB-50 /catalog/images/POQ-5BB.JPG
POQ-5BB-150 /catalog/images/POQ-5BB.JPG
SP-Y /catalog/images/SP-Y.JPG
UG-50G No Pic1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 19, 35, 89, 91, 93
General system exception happened
Additional data: URL key for specified store already exists.
RQ-5-100+4 UG-100-200 SO-002 FT-M200 RQ5-5T-50
1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 260, 281, 297, 351, 353, 355
-----------------//
手工添加主圖表:products->products_image
576>>>UG-50G->no pic -> UG-50G.jpg
629>>>UG-100-200->no pic -> UG-100-200.jpg
606>>>RQ-5-100+4->no pic -> RQ-5-100-pl-4.jpg
699>>>SO-002->no pic -> SO-002.jpg
手工上傳 jpg -> aws (DV已上傳-20200131)
cd /var/www/html/pwpic/catalog/images/
576>>>UG-50G->no pic -> wget http://www.purewaterclub.com/UG-50G.jpg
629>>>UG-100-200->no pic -> wget http://www.purewaterclub.com/UG-100-200.jpg
606>>>RQ-5-100+4->no pic -> wget http://www.purewaterclub.com/RQ-5-100-pl-4.jpg
699>>>SO-002->no pic -> wget http://www.purewaterclub.com/SO-002.jpg
701>>>FT-M200->no pic -> wget http://www.purewaterclub.com/FT-M200.jpg
704>>>RQ5-5T-50->no pic -> wget http://www.purewaterclub.com/RQ5-5T-50.jpg
wget http://www.purewaterclub.com/4PM100.jpg
wget http://www.purewaterclub.com/tank.jpg
wget http://www.purewaterclub.com/POQ-5BB.JPG
wget http://www.purewaterclub.com/SP-Y.JPG
osc 舊RO站後台:(一定要用IE)
https://www.purewaterclub.com/catalog/admin/index.php -> admin + admin1234!
更新產品基本資料必要欄位
sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,configurable_variations,configurable_variation_labels,associated_skus
PT-12-1,,,,,,PT-12-1,,,,,,,1.1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,304,0,1,0,0,1,1,0,0,1,1,,1,0,1,1,0,1,0,0,1,,,,,,,,,,,,,,
--- 20200130-0201 目錄頁 + import product-catagory
=========================================================================================================================
目錄名稱表:catalog_category_entity_varchar->
attribute_id=42
entity_id=50
value=Filtration System
目錄結構表:catalog_category_entity->
entity_id=50
path=1/2/47/50
level=3
children_count=14
產品查目錄表:catalog_category_product_index->
目錄查產品表:catalog_category_product->category_id + product_id + position(default 1)
手工修改表:products->
products_id=616 (PT-Qfaucet)->products_status=0 (與617重覆)
products_id=592 (PT-3W2)->products_status=0 (與594重覆)
目錄List
$catidx=array(0,0,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,79,80,81,82,84);
目錄名稱不可以有, /
$d[50]="Filtration System";
$d[51]="Filtration System/Revese Osmosis";
$d[52]="Filtration System/Revese Osmosis/Standard Flow 100 GPD";
$d[53]="Filtration System/Revese Osmosis/High Flow 150+ GPD";
$d[54]="Filtration System/Revese Osmosis/Low Flow 50 GPD";
$d[55]="Filtration System/Portable RO";
$d[56]="Filtration System/Portable RO/Standard Flow 100 GPD";
$d[57]="Filtration System/Portable RO/High Flow 150+ GPD";
$d[58]="Filtration System/Portable RO/Low Flow 50 GPD";
$d[59]="Filtration System/Whole House";
$d[60]="Filtration System/Whole House/Standard";
$d[61]="Filtration System/Whole House/Ecnomical";
$d[62]="Filtration System/Drinking Water";
$d[63]="Filtration System/Aquarium";
$d[64]="Filtration System/Ultra Violet";
$d[68]="Replacement";
$d[70]="Replacement/Combo Set";
$d[71]="Replacement/Filters";
$d[72]="Replacement/Menbranes";
$d[73]="Replacement/Resin";
$d[74]="Replacement/Ultra Violet";
$d[65]="Parts & Tools";
$d[66]="Parts & Tools/Housing";
$d[75]="Parts & Tools/Housing/0.25~0.375 inch";
$d[76]="Parts & Tools/Housing/0.75 inch";
$d[77]="Parts & Tools/Housing/0.5 inch";
$d[67]="Parts & Tools/Feeders";
$d[79]="Parts & Tools/Fittings";
$d[80]="Parts & Tools/Valves";
$d[81]="Parts & Tools/Faucet-Tank-Tubes";
$d[82]="Parts & Tools/Utilityes";
$d[84]="Parts & Tools/Shipping";
--- 20200127-29 整理 old-RO product目錄
=========================================================================================================================
gen-product-csv.php
$tmppic=$row["products_image"];
$tmppic=str_replace(" ","-sp-",$tmppic,$i);
$tmppic=str_replace("+","-pl-",$tmppic,$i2);
$tmppic=str_replace("[1]","-1-",$tmppic,$i3);
收集+改產品主圖片名稱(含空格,+,[1]) -> copy to ./tmp/ -> ftp下載整理 -> 手工zip為aws-20200127.zip -> ftp上傳ro站
aws: cd /var/www/html/pwpic/catalog/images/
wget http://www.purewaterclub.com/aws-20200127.zip -> unzip aws-20200127.zip
缺主圖
576>>>UG-50G->no pic
606>>>RQ-5-100+4->no pic
629>>>UG-100-200->no pic
699>>>SO-002->no pic
701>>>FT-M200->no pic
704>>>RQ5-5T-50->no pic
mag2->import->product+pwpic->w
Checked rows: 364, checked entities: 364, invalid rows: 0, total errors: 0
--- 20200127 整理 old-RO product special file name pic -> mag2
=========================================================================================================================
53dfeff4e5225395344f4e917893e8ff3762a0e12080f11da0d57b21fdbc97f8:aFtZhhXDAihazGkpXyPFbBWEf32oxHsL:1
dv4ml@dacomputing.com + aa223344
osc 表customers -> customers_id=9660 + 1@aa.com + $P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/
alberto.jany@woodgroup.com + (aa223344) $P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:0
SELECT * FROM customers INNER JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id LIMIT 100
SELECT countries_id,countries_name,countries_iso_code_3 FROM (customers INNER JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id) LEFT JOIN countries ON address_book.entry_country_id=countries.countries_id LIMIT 100
SELECT * FROM (customers INNER JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id) LEFT JOIN countries ON address_book.entry_country_id=countries.countries_id LIMIT 100
手工刪除黑客注冊垃圾帳號
DELETE FROM address_book WHERE entry_street_address LIKE '%minsk%' AND entry_city LIKE '%minsk%' -> 627 record
DELETE FROM address_book WHERE entry_country_id<>'223' AND entry_street_address LIKE '%?%' -> 20 record
DELETE FROM address_book WHERE entry_country_id<>'223' AND entry_street_address=entry_city -> 23 record
DELETE FROM address_book WHERE entry_state like '%?%' -> 1 record
DELETE FROM address_book WHERE customers_id=3953 -> 2 record (YU)->南斯拉夫已不存在
DELETE FROM address_book WHERE customers_id=5505 -> 1 record (YU)->南斯拉夫已不存在
DELETE FROM address_book WHERE customers_id=776 -> 1 record (dd@dd.com)->亂碼
?? if osc的state空白->mag2自動根據地址判斷
手工刪除表:address_book->不常國家 + state/region 錯誤(無法上傳mag2) + 未成交帳號
DELETE FROM address_book WHERE entry_country_id='123' (LT Lithuania) -> 7 record
DELETE FROM address_book WHERE entry_country_id='175' (RO Romania) -> 2 record
DELETE FROM address_book WHERE entry_country_id='117' (LV Latvia) -> 2 record (含customers_id=2073 -> mike.pelletier@wanadoo.fr)
DELETE FROM address_book WHERE entry_country_id='73' (FR France) -> 3 record (含customers_id=3123 -> asd@jp.co.jp)
DELETE FROM address_book WHERE entry_country_id='107' AND customers_id<>6476(JP Japan) -> 7 record
手工刪除表:address_book->(BR Brazil)+ 未成交帳號
UPDATE address_book LEFT JOIN orders ON address_book.customers_id=orders.customers_id SET entry_suburb='xxxxx' WHERE orders_id IS NULL AND entry_country_id='30' (BR Brazil) -> 44 record
DELETE FROM address_book WHERE entry_suburb='xxxxx' -> 44 record
Last->手工刪除表:customers->無地址address_book
UPDATE customers LEFT JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id SET customers_email_memo='xxxxx' WHERE address_book_id IS NULL -> 730 record
DELETE FROM customers WHERE customers_email_memo='xxxxx' -> 730 record
手工修改表:address_book->state
UPDATE address_book SET entry_state='Puerto Rico' WHERE entry_state='san juan' (US PR)-> 7 record
UPDATE address_book SET entry_state='Puerto Rico' WHERE entry_state='Comerio' (US PR)-> 2 record
UPDATE address_book SET entry_state='Puerto Rico' WHERE entry_state='aguadilla' (US PR)-> 1 record
UPDATE address_book SET entry_state='Puerto Rico' WHERE entry_state='P.R.' (US PR)-> 3 record
UPDATE address_book SET entry_state='Paraíba' WHERE entry_state='paraiba' (BR)-> 3 record
UPDATE address_book SET entry_state='S?o Paulo' WHERE entry_state='SAO PAULO' (BR)-> 5 record
UPDATE address_book SET entry_state='Goiás' WHERE entry_state='Goias' (BR)-> 3 record
手工修改表:customers->customers_id=8277 (978)?412-6426->去掉中間亂碼
手工修改表:address_book->customers_id=603 2314\->23140
手工修改表:address_book->customers_id=1470 cahoon77@yahoo.com->
手工修改表:customers->root@localhost->root@localhost.com
手工修改表:customers->richter@ccs.fau.du->richter@ccs.fau.du.com
http://www.purewaterclub.com/gen-customer-csv.php
各種拉丁文亂碼Bogotá(例表:customerscustomers_id=1420(alberto.jany@woodgroup.com)
$tmps=str_replace("{fname}",iconv("ISO-8859-1","UTF-8",$row["customers_firstname"]),$tmps);
$tmps=str_replace("{lname}",iconv("ISO-8859-1","UTF-8",$row["customers_lastname"]),$tmps);
$tmps=str_replace("{city}",iconv("ISO-8859-1","UTF-8",$row["entry_city"]),$tmps);
$tmps=str_replace("{fname2}",iconv("ISO-8859-1","UTF-8",$row["entry_firstname"]),$tmps);
$tmps=str_replace("{lname2}",iconv("ISO-8859-1","UTF-8",$row["entry_lastname"]),$tmps);
$tmps=str_replace("{state}",iconv("ISO-8859-1","UTF-8",$row["entry_state"]),$tmps);
$tmps=str_replace("{street}",iconv("ISO-8859-1","UTF-8",$row["entry_street_address"]),$tmps);
migrate osc to mag2
v.1 -> osc + : + 0
df7cde40bc6922f8a885a21ebe8fd4b0:70 -> df7cde40bc6922f8a885a21ebe8fd4b0:70:0
v.2 -> osc + : + osc去掉首位$ + : + 0
利用mag2的salt位置傳遞存檔hash,新增程式判斷若為osc v.2,則字首加上$後依v.2規則產生hash,比對若正確後回送hash (aa223344)
$P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/ -> $P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:0
$P$DYd3TBSaZT6C85hm5amzC8RwGcu3Pf. -> $P$DYd3TBSaZT6C85hm5amzC8RwGcu3Pf.:P$DYd3TBSaZT6C85hm5amzC8RwGcu3Pf.:0
--- 20200124-25-26 整理 old-RO customer 資料 -> mag2
=========================================================================================================================
添加新theme 7pm
cd /var/www/html/magento8pm/app/design/frontend/Venustheme/
cp 8pm 7pm -r
joe registration.php
joe theme.xml
直接改不同的default.xml可改變Ves header使用MegaMenu的名稱
1.)pwc
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Megamenu/layout/default.xml
menu-top
2.)b4u
/var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Megamenu/layout/default.xml
menu-top-b4u
失敗->添加新theme zou-被Ves Extend搶走header
cd /var/www/html/magento8pm/app/design/frontend/Zou/demo/
wget http://www.purewaterclub.com/zou-20200121.zip -> unzip zou-20200121.zip
DNS A zou.wg-1.com -> 18.218.158.219
cd /etc/apache2/sites-available
cp buck4u.conf zou-wg-1.conf
joe zou-wg-1.conf ->
ServerName zou.wg-1.com
SetEnv MAGE_RUN_CODE "zou"
cd /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/zou-wg-1.conf /etc/apache2/sites-enabled/zou-wg-1.conf
service apache2 restart
失敗->增加Ves header的layout: copy default.phtml default-b4u.phtml
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Themesettings/templates/header/default.phtml
getChildHtml('catalog.topnav_b4u') ?>
/var/www/html/magento8pm/app/code/Ves/Megamenu/view/frontend/layout/default.xml
原始默認Ves header使用MegaMenu的名稱
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Megamenu/layout/default.xml
/var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/Ves_Megamenu/layout/default.xml
可改變Ves header使用MegaMenu的名稱
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Themesettings/layout/default.xml
--- 20200121 mag2 設定不同 store 配不同 Mega Menu
=========================================================================================================================
Bug->Ves ->同一頁只會出現第一種MegaMenu
MegaMenu從正上方下移至Top Bar下方:
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Themesettings/layout/default.xml
Bug->Ves MegaMenu management->必須改第一個 or 只移動位置,只要按了select就save無效
x-SELECT * FROM address_book LEFT JOIN customers ON address_book.customers_id=customers.customers_id WHERE 1
SELECT * FROM customers INNER JOIN address_book ON customers.customers_default_address_id=address_book.address_book_id WHERE customers.customers_id<>address_book.customers_id
改ves megamenu alias
cd /var/www/html/magento8pm
app/code/Ves/Megamenu/view/frontend/layout/default.xml
menu-top
catagary背景圖:
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/images/bg_brc.jpg
/var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/images/bg_brc.jpg
menu背景圖:
Add class “menu-bg” to insert background in dropdown, change background in the path: /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/images/menu-bg.jpg
cp /var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/web/images/bg_brc.jpg /var/www/html/magento8pm/app/design/frontend/Venustheme/7pm/web/images/bg_brc.jpg
--- 20200119-20 增刪修 Mega Menu
=========================================================================================================================
缺主圖片
x318>>>6BT-150->no pic
x332>>>USPS-20->no pic
x444>>>SO-003->no pic
x477>>>SP-004->no pic
576>>>UG-50G->no pic
606>>>RQ-5-100+4->no pic
629>>>UG-100-200->no pic
x681>>>UG-50-150->no pic
699>>>SO-002->no pic
x717>>>SO-003->no pic
圖片不存在
701>>>FT-M200.jpg
704>>>RQ5-5T-50.jpg
!BkJeFJQB2k~$(KGrHqUH-CkEs+T,q!(EBLWTm-zWz!~~_12.JPG->FT-PP-25.jpg
q-2.csv
Images File Directory -> pwpic
copy sale:desc+name -> magento8pm
上傳 gen-product-desc-name.php -> pwc gen-product-desc-name.phpx
cd /var/www/html/pwpic
wget http://www.purewaterclub.com/gen-product-desc-name.phpx -O /var/www/html/pwpic/gen-product-desc-name.php
http://aws.wg-1.com/gen-product-desc-name.php
產品基本資料->表:catalog_product_entity
entity_id=1824
sku='RO-QQ-101'
產品說明->表:catalog_product_entity_text
attribute_id=72(Desc)
attribute_id=73(short Desc)
entity_id=1824
value=Desc-331(原sale product_id)
產品名稱->表:catalog_product_entity_varchar
attribute_id=70
entity_id=1824
value=Name-331(原sale product_id)
產品圖片->表:catalog_product_entity_varchar
attribute_id=84(base_image)
attribute_id=85(small_image)
attribute_id=86(thumbnail_image)
attribute_id=150(swatch_image)
entity_id=1824
value=/2/2/22-28.jpg
產品庫存->表:cataloginventory_stock_item(各種數量max,min..)
product_id=1824
qty=919818.0000
->表:cataloginventory_stock_status
product_id=1824
qty=919818.0000
stock_status=1
產品價格->表:catalog_product_entity_decimal
entity_id=1824
attribute_id=74
value=123.4500
->?表:catalog_product_index_price
entity_id=1824
gen-product-csv.php
收集產品主圖片->../aws/catalog/images/->ftp下載整理->手工zip aws-20200118.zip->ftp上傳ro站
aws:
cd /var/www/html/pwpic/catalog/images/
wget http://www.purewaterclub.com/aws-20200118.zip -> unzip aws-20200118.zip
--- 20200118 mag2 product 產品主圖 + 補缺圖
=========================================================================================================================
Marketing->Cart Price Rules->滿$50包郵->Conditions
->Subtotal equals or greater than 50
x->借用屬性 Eco_Collect 成為 Free Shipping(false:可以排除不包郵的item)
(20200216 改不借用Eco_Collect,新增Free Shipping屬性 + Attribute Code->free_shipping + Attribute Properties->Scope->Global + Storefront Properties->Use for Promo Rule Conditions->YES)
Actions->Apply the rule only to cart items matching the following conditions (leave blank for all items).
->Free Shipping is Yes
cart rule->if Free Shipping is TRUE
--- 20191225 mag2 shipping rule
=========================================================================================================================
Configuration->VES THEMESETTINGS->Product View Page->Tab By Product Attribute Code->Add Attribute Code
Configuration->VES THEMESETTINGS->Product View Page->Tab By CMS Block->Add Attribute Code
不可以Add 空白否則產品頁500錯誤
koofficecn 2019/12/20 14:40:25
http://18.218.158.219/magento8pm/ada.php
koofficecn 2019/12/20 14:40:33
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.1.1c 28 May 2019
OpenSSL Header Version OpenSSL 1.1.1c 28 May 2019
Openssl default config /usr/lib/ssl/openssl.cnf
ADA 22:26:13
root@ip-172-31-32-158:/var/www/html/magento8pm# /usr/bin/php bin/magento cache:clean
Cleaned cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
full_page
config_integration
config_integration_api
translate
config_webservice
要用 /usr/bin/php 不能只用 php
root@ip-172-31-32-158:/var/www/html/magento8pm# /usr/bin/php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:01
Customer Grid index has been rebuilt successfully in 00:00:01
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:03
不過 root@ip-172-31-32-158:/var/www/html/magento8pm# /usr/bin/php bin/magento cache:clean 可以,
但 root@ip-172-31-32-158:/var/www/html/magento8pm# /usr/bin/php bin/magento cache:flush 會出錯,
所以我是回後台, 用後台 admin 作 cache management , 然後才去用命令列,
執行 root@ip-172-31-32-158:/var/www/html/magento8pm# /usr/bin/php bin/magento indexer:reindex
cd /var/www/html/magento8pm
/usr/bin/php bin/magento indexer:reindex
--- 20191222 mag2 import product + reindex
=========================================================================================================================
root@ip-172-31-32-158:/var/www/html/magento8pm# /usr/bin/php bin/magento cache:clean
Cleaned cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
full_page
config_integration
config_integration_api
translate
config_webservi
cd /var/www/html/magento8pm
find . -type f -exec chmod 644 {} /; && find . -type d -exec chmod 755 {} /; && chmod 777 var/ -R && find pub/media -type d -exec chmod 777 {} /; && find pub/static -type d -exec chmod 777 {} /; && chmod 777 app/etc && chmod 644 app/etc/*.xml && chmod u+x bin/magento
adduser zou
passwd zou
joe /etc/sudoers -> zou ALL=(ALL:ALL) ALL
usermod -a -G www-data zou
groups www-data
cd /var/www/html/magento8pm
chown -R www-data:www-data .
cd /var/www/html/magento8pm
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} /;
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} /;
find . -type f -exec chmod 644 {} /;
find . -type d -exec chmod 755 {} /;
find ./var -type d -exec chmod 777 {} /;
chmod 777 var/ -R
find ./pub/media -type d -exec chmod 777 {} /;
find ./pub/static -type d -exec chmod 777 {} /;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
xxxx-> chown zou:zou . -hR <--- xxx
chmod u+x bin/magento
chmod -R g+rwxs .
ls -la
joe /etc/php/7.0/fpm/pool.d/www.conf
chmod u+x qq
cd /var/www/html/magento8pm
sudo php bin/magento indexer:reindex
php /var/www/html/magento8pm/bin/magento indexer:reindex
The openssl extension is required for SSL/TLS protection but is not available.
If you can not enable the openssl extension, you can disable this error, at your own risk,
by setting the 'disable-tls' option to true.
#0 /var/www/html/magento8pm/vendor/composer/composer/src/Composer/Factory.php(306): Composer/Factory::createRemoteFilesystem(Object(Composer/IO/BufferIO), Object(Composer/Config))
#1 /var/www/html/magento8pm/vendor/composer/composer/src/Composer/Factory.php(532): Composer/Factory->createComposer(Object(Composer/IO/BufferIO), Array, false)
#2 /var/www/html/magento8pm/vendor/magento/framework/Composer/ComposerFactory.php(47): Composer/Factory::create(Object(Composer/IO/BufferIO), '/var/www/html/m...')
#3 /var/www/html/magento8pm/vendor/magento/framework/Composer/ComposerInformation.php(362): Magento/Framework/Composer/ComposerFactory->create()
#4 /var/www/html/magento8pm/vendor/magento/framework/Composer/ComposerInformation.php(375): Magento/Framework/Composer/ComposerInformation->getComposer()
#5 /var/www/html/magento8pm/vendor/magento/framework/Composer/ComposerInformation.php(242): Magento/Framework/Composer/ComposerInformation->getLocker()
#6 /var/www/html/magento8pm/vendor/magento/framework/App/ProductMetadata.php(104): Magento/Framework/Composer/ComposerInformation->getSystemPackages()
#7 /var/www/html/magento8pm/vendor/magento/framework/App/ProductMetadata.php(65): Magento/Framework/App/ProductMetadata->getSystemPackageVersion()
#8 /var/www/html/magento8pm/vendor/magento/framework/Console/Cli.php(81): Magento/Framework/App/ProductMetadata->getVersion()
#9 /var/www/html/magento8pm/bin/magento(22): Magento/Framework/Console/Cli->__construct('Magento CLI')
#10 {main}
Fatal error: Uncaught Error: Class 'Cli' not found in /var/www/html/magento8pm/bin/magento:31
Stack trace:
#0 {main}
thrown in /var/www/html/magento8pm/bin/magento on line 31
不可用sudo
composer config -g -- disable-tls true
service apache2 restart
ln -s /var/www/html/pwpic /var/www/html/magento8pm/pwpic
Images File Directory -> pwpic
catalog_product_20191216_044905
/catalog/images/22-28.jpg
url -> atomic-endurance-running-tee-v-neck-s-blue
35138564
cd /var/www/html/magento8pm
php bin/magento indexer:reindex
php bin/magento cache:clean && php bin/magento cache:flush
Table eav_entity_type.entity_type_id=4(catalog_product)
->Table eav_attribute.attribute_id=72(catalog_product-description-text)
->Table catalog_product_entity.entity_id=1792(sku=RQ-6B2W-100)
->Table catalog_product_entity_text.attribute_id=72 + .entity_id=1792(value=description html)
sale.products.products_model->sku
--- 20191213 AWS mySQL Table
=========================================================================================================================
cd /var/www/html/pwpic
wget http://www.purewaterclub.com/pid.phpx -O /var/www/html/pwpic/pid.php
http://www.purewaterclub.com/pid.php?p=264 -> http://aws.wg-1.com/pid.php?p=264
2434
72
0
1792
->去掉height
UPDATE catalog_product_entity_text SET value='$tmphtm' WHERE value_id='2434' AND attribute_id='72' AND entity_id='1792'
STORES->Configuration->VES THEMESETTINGS->Profuct View Page->Tab
--- 20191213 AWS PHP + mySQL
=========================================================================================================================
cd /var/www/html/pwpic
wget http://www.purewaterclub.com/aws-20191205.zip -> 解壓zip
ro.wg-1.com 指向+對應 59.124.16.10 /home/httpd/www/aws
aws.wg-1.com 指向+對應 AWS /var/www/html/pwpic
更新所有連結
59.124.16.10 -> aws.wg-1.com
www.purewaterclub.com -> aws.wg-1.com
products_description_wk copy to products_description
%20 -> /
http://aws.wg-1.com/items/Pic/PO/2way%20switch.jpg -> 2way/ switch.jpg
http://aws.wg-1.com/items/Pic/SP/Collet%20release%20tool.JPG -> Collet/ release/ tool.JPG
http://aws.wg-1.com/items/Pic/SP/Collet%20release%20tool-1.JPG -> Collet/ release/ tool-1.JPG
http://aws.wg-1.com/items/Pic/SP/SP-Collet%20release%20tool.JPG -> SP-Collet/ release/ tool.JPG
http://aws.wg-1.com/items/Pic/SP/SP-Collet%20release%20tool-1.JPG -> SP-Collet/ release/ tool-1.JPG
http://aws.wg-1.com/items/Pic/000/install/tube%20remove.jpg -> tube/ remove.jpg
http://aws.wg-1.com/items/Pic/000/First-Class%20Mail.jpg -> First-Class/ Mail.jpg
http://aws.wg-1.com/items/Pic/PT/bracket%20-size.JPG -> bracket -size.JPG
http://aws.wg-1.com/items/Pic/000/FS/FS20-PPx25-2.JPG ->換圖
wget http://www.purewaterclub.com/items/Pic/000/parts/B38.jpg -O /var/www/html/pwpic/items/Pic/000/parts/B38.jpg
wget http://www.purewaterclub.com/items/Pic/000/parts/B38-1.JPG -O /var/www/html/pwpic/items/Pic/000/parts/B38-1.JPG
wget http://www.purewaterclub.com/items/Pic/000/parts/B38-2.JPG -O /var/www/html/pwpic/items/Pic/000/parts/B38-2.JPG
wget http://www.purewaterclub.com/items/Pic/000/parts/B38-3.jpg -O /var/www/html/pwpic/items/Pic/000/parts/B38-3.jpg
--- 20191205 舊RO站所有pic -> AWS
=========================================================================================================================
www.purewaterclub.com -> /home/httpd/www/sale copy -> /home/httpd/www/aws
59.124.16.10 -> /home/httpd/www/ksoffice copy -> /home/httpd/www/aws
通知 ML
http://www.purewaterclub.com/catalog/product_info.php?products_id=709 -> 5破圖
取消所有超連結
未來新產品儘量使用全圖片
--- 20191204 集中舊RO站所有產品說明的pic
=========================================================================================================================
1.) copy products_description-20191128 -> products_description_20191203_0
2.) products_description_20191203_0 新增 products_description_0
3.) UPDATE products_description_20191203_0 SET products_description_0=products_description
4.) copy products_description_20191203_0 -> products_description_wk
5.) php 去除所有 href + 修正所有 img 後同時寫回 mySQL language_id=1,2
6.) 手工改/加圖檔
--- 20191203 修改舊RO站產品說明 去除所有href + 修正 img
=========================================================================================================================
www.purewaterclub.com -> /home/httpd/www/sale , 59.124.16.10 -> /home/httpd/www/ksoffice
1.) 去除 (112 + 128 + 104 + 130 + 46 + 44 records)
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
2.) 去除 .. (92 + 90 + 86 + 76 + 22 + 42 records)
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
3.) 去除 .. (18 + 60 + 60 + 56 + 20 + 20 records)
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
4.) 去除 .. (4 + 98 + 58 + 46 + 10 + 8 records)
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
5.) 去除 (4 + 2 + 8 + 4 + 20 + 20 records)
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
6.) 去除 Instructions menu (6 records)
SELECT * FROM products_description WHERE products_description LIKE '%Instructions menu %'
UPDATE products_description SET products_description=REPLACE(products_description,'Instructions menu ','') WHERE products_description LIKE '%Instructions menu %';
7.) 去除 Instructions menu (2 records)
UPDATE products_description SET products_description=REPLACE(products_description,'Instructions menu ','') WHERE products_description LIKE '%Instructions menu %';
8.) 去除 Instructions menu (2 records)
UPDATE products_description SET products_description=REPLACE(products_description,'Instructions menu ','') WHERE products_description LIKE '%Instructions menu %';
9.) 去除 nstructions menu (2 records)
UPDATE products_description SET products_description=REPLACE(products_description,'nstructions menu ','') WHERE products_description LIKE '%nstructions menu %';
11.) 手工去除 增加 (products_id=305,307,308,312,355)
12.) 手工去除 ..
13.) remove whole
--- 20191202 修改舊RO站產品說明 去除href
=========================================================================================================================
1.) 去除 ?€€ ?€€ (76 records)
SELECT * FROM products_description WHERE products_description LIKE '%?€€%'
UPDATE products_description SET products_description=REPLACE(products_description,'?€€','') WHERE products_description LIKE '%?€€%'
2.) 去除 (Please Click Picture to enlarge the picture) (324 + 94 + 52 records)
SELECT * FROM products_description WHERE products_description LIKE '%(Please Click Picture to enlarge the picture)%'
UPDATE products_description SET products_description=REPLACE(products_description,'(Please Click Picture to enlarge the picture)','') WHERE products_description LIKE '%(Please Click Picture to enlarge the picture)%'
UPDATE products_description SET products_description=REPLACE(products_description,'(Please Click ','') WHERE products_description LIKE '%(Please Click %'
UPDATE products_description SET products_description=REPLACE(products_description,'Picture to enlarge the','') WHERE products_description LIKE '%Picture to enlarge the%'
UPDATE products_description SET products_description=REPLACE(products_description,'picture)','') WHERE products_description LIKE '%picture)%'
UPDATE products_description SET products_description=REPLACE(products_description,'Picture to','') WHERE products_description LIKE '%Picture to%'
UPDATE products_description SET products_description=REPLACE(products_description,'enlarge the picture)','') WHERE products_description LIKE '%enlarge the picture)%'
UPDATE products_description SET products_description=REPLACE(products_description,'the picture)','') WHERE products_description LIKE '%the picture)%'
UPDATE products_description SET products_description=REPLACE(products_description,'enlarge','') WHERE products_description LIKE '%enlarge%'
UPDATE products_description SET products_description=REPLACE(products_description,'PW- PW-Picture)','') WHERE products_description LIKE '%PW- PW-Picture)%'
UPDATE products_description SET products_description=REPLACE(products_description,'Picture)','') WHERE products_description LIKE '%Picture)%'
10.) 去除
(82 + 128 records)
SELECT * FROM products_description WHERE products_description LIKE '%
%'
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%';
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%';
11.) 去除
(38 + 48 records)
SELECT * FROM products_description WHERE products_description LIKE '%
%'
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%';
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%';
12.) 去除 (102 + 98 records)
SELECT * FROM products_description WHERE products_description LIKE '% %'
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
13.) 去除
(180 + 102 records)
SELECT * FROM products_description WHERE products_description LIKE '%
%'
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%';
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%';
14.) 去除 (150 records)
SELECT * FROM products_description WHERE products_description LIKE '% %'
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %';
SELECT * FROM products_description WHERE products_description LIKE '%
%'
--- 20191201 修改舊RO站產品說明內容 + href
=========================================================================================================================
1.) http://61.220.188.82/items/Pic/Public/US-I.bmp -> http://59.124.16.10/items/Pic/Public/US-I.jpg
SELECT * FROM products_description WHERE products_description LIKE '%http://61.220.188.82/items/Pic/Public/US-I.bmp%'
UPDATE products_description SET products_description=REPLACE(products_description,'http://61.220.188.82/items/Pic/Public/US-I.bmp','http://59.124.16.10/items/Pic/Public/US-I.jpg') WHERE products_description LIKE '%http://61.220.188.82/items/Pic/Public/US-I.bmp%'
2.) http://59.124.16.10/items/Pic/FT/DIQ-1.JPG -> http://59.124.16.10/items/Pic/FT/DIQ-2.JPG
SELECT * FROM products_description WHERE products_description LIKE '%http://59.124.16.10/items/Pic/FT/DIQ-1.JPG%'
UPDATE products_description SET products_description=REPLACE(products_description,'http://59.124.16.10/items/Pic/FT/DIQ-1.JPG','http://59.124.16.10/items/Pic/FT/DIQ-2.JPG') WHERE products_description LIKE '%http://59.124.16.10/items/Pic/FT/DIQ-1.JPG%'
3.) http://59.124.16.10/items/Pic/22-4114/22-4 /r 114.jpg -> http://59.124.16.10/items/Pic/22-4114/22-4114.jpg (products_id=191)
4.) hhttp://59.124.16.10/items/Pic/000/FT/FT-PH.jpg -> hhttp://59.124.16.10/items/Pic/000/FT/FT-PH.jpg (products_id=308)
5.) http://59.124.16.10/items/Pic/000/1042Q-1.jpg -> IMG rmoved (products_id=340)
6.) http://sm7.sitemeter.com/meter.asp?site=sm7purewaterclub -> IMG rmoved (products_id=414)
7.) (products_id=490)
http://59.124.16.10/items/Pic/22-10/22-10- /r F5-I-1.jpg -> http://59.124.16.10/items/Pic/22-10/22-10-F5-I-1.jpg
http://59.124.16.10/items/PW-Pic/PW-22- /r 82/PW-22-82-F5-I.jpg -> http://59.124.16.10/items/PW-Pic/PW-22-82/PW-22-82-F5-I.jpg
http://59.124.16.10/items/PW- /r Pic/PW-22-82/PW-22-82-F1.jpg -> http://59.124.16.10/items/PW-Pic/PW-22-82/PW-22-82- F6.jpg
http://59.124.16.10/items/PW-Pic/PW-22- 82/PW-22-82- /r F6.jpg -> http://59.124.16.10/items/PW-Pic/PW-22-82/PW-22-82- F6.jpg
8.) -> IMG rmoved (products_id=542)
SELECT * FROM `products_description` WHERE `products_description` like '% %'
UPDATE products_description SET products_description=REPLACE(products_description,' ','') WHERE products_description LIKE '% %'
9.)
http://59.124.16.10/items/Pic/000/FT/FT-PP05_2.JPG -> http://59.124.16.10/items/Pic/000/FT/FT-PP05_2.JPG (products_id=595,597,637)
SELECT * FROM `products_description` WHERE products_description LIKE '%
%' AND (products_id='595' OR products_id='597' OR products_id='637')
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%' AND (products_id='595' OR products_id='597' OR products_id='637')
10.) (products_id=632,633,658,661)
http://59.124.16.10/items/Pic/22-309/22-115-F1.jpg -> http://59.124.16.10/items/Pic/22-309/22-115-F1.jpg
http://59.124.16.10/items/Pic/22-309/22-115-F3.jpg -> http://59.124.16.10/items/Pic/22-309/22-115-F3.jpg
http://59.124.16.10/items/Pic/FT/T33.JPG -> http://59.124.16.10/items/Pic/FT/T33.JPG
http://59.124.16.10/items/Pic/22-36/22-36-F3.jpg -> http://59.124.16.10/items/Pic/22-36/22-36-F3.jpg
http://59.124.16.10/items/Pic/22-36/22-36-P4.jpg -> http://59.124.16.10/items/Pic/22-36/22-36-P4.jpg
http://59.124.16.10/items/Pic/22-36/22-36-P6.jpg -> http://59.124.16.10/items/Pic/22-36/22-36-P6.jpg
SELECT * FROM `products_description` WHERE products_description LIKE '%
%' AND (products_id='632' OR products_id='633' OR products_id='658' OR products_id='661')
UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%' AND (products_id='632' OR products_id='633' OR products_id='658' OR products_id='661')
11.) http://59.124.16.10/items/Pic/000/FS/FS20-PPx25-1.JPG -> http://59.124.16.10/items/Pic/000/FS/FS20-PPx24-1.JPG (products_id=675)
12.) https: -> http: (products_id=709,716)
SELECT * FROM `products_description` WHERE products_description LIKE '%https:%' AND (products_id='709' OR products_id='716')
UPDATE products_description SET products_description=REPLACE(products_description,'https:','http:') WHERE products_description LIKE '%https:%' AND (products_id='709' OR products_id='716')
?? http://www.purewaterclub.com/catalog/images/Psi-1.jpg -> http://59.124.16.10/catalog/images/Psi-1.jpg 不顯現 30 pic
?? http://i.ebayimg.com/00/s/NDgwWDY0MA==/z/29MAAMXQ3kNTiBiu/$_12.JPG -> href ? 15 pic
http://www.purewaterclub.com/catalog/product_info.php?products_id=709 -> Miss 5 Pic
http://www.purewaterclub.com/catalog/product_info.php?products_id=711 -> Miss 1 Pic
http://www.purewaterclub.com/catalog/product_info.php?products_id=712 -> Miss 1 Pic
----------------> total 52 pic
--- 20191130 修改舊RO站產品圖片連結
=========================================================================================================================
UPDATE products_description SET products_description_0=REPLACE(products_description_0,'?€€','') WHERE products_id='169' AND language_id='1'
http://www.purewaterclub.com/catalog/product_info.php?cPath=88_87&products_id=158
舊RO站table products_description->products_description 1114 records
Logo Max 218 x 70
1.)改圖片 IP->?? AWS domain + 去掉目錄?
http://59.124.16.10/items/Pic/22-57/22-57-F5-2.jpg
2.)改file:// 244 records
file:///E:/Documents%20and%20Settings/Administrator/Local%20Settings/Temporary%20Internet%20Files/FrontPageTempDir/pvwA.htm#RO-P1
3.)去掉亂碼 76 records
?€€
4.)去掉ebay hyper link 656 records
http://cgi5.ebay.com/ws/eBayISAPI.dll?SimilarListing&itemid=110389038550#RO-P1
http://stores.ebay.com/purewaterclub_Water-Filter-System_W0QQcolZ4QQdirZ1QQfclZ4QQfsubZ231976010QQftidZ2QQtZkmQQ_trksidZp1742.m154.l1264
5.)去掉無效說明
a.) (Please Click Picture to enlarge the picture) -> 324 records
b.)Great Gift!
We Could Ship This Item To Your Friend Within US Continatal!
Good For Your Family And Friends! -> 328 records
6.)去掉破圖 ??
http://59.124.16.10/items/Driver/driver.jpg
7.)去掉下載Download Manual hyper link 32 records
http://59.124.16.10/items/Driver/Protable%20RO%20instruction.doc
8.)去掉Buy It Now價格 194 records
Buy It Now is Just US$108.99 and 2-7 days* you will GET IT at HOME within US!!
9.)去掉Retail Price價格 256 records
(Retail Price:US$320)
SELECT * FROM `products_description` WHERE `products_description` LIKE '%file:%'
--- 20191110 修改舊RO站產品說明
=========================================================================================================================
magento2 table customer_entity->password_hash:
format -> hash(md5/sha256) : salt (max 32digit) : version (0/1) (md5/sha256) ?->: convet to version (1/2?)
b7de469740dc4f7edf08fe26c4e3ee5a53bf03c5467ff2f02a831c94b707d455:mCIgmxGBoZBGKgL6vkc7xIcZcKUwYQvd:1
v.0登入成功後將主動升級v.1用sha256重寫password_hash
osCommerce 2.4.3.1 table customers->customers_password:
format v.1 -> hash(md5) : salt (2digit)
df7cde40bc6922f8a885a21ebe8fd4b0:70
format v.2 -> $P$ + D(重複作md5次數 D=2^13=8192次) + salt (64進位 8digit) + hash (64進位 21+1digit 最後1位2bit=21*6+2=128=32*4=16進位 32digit)
$P$ D NVAIbn8k ZQQop6d3QAg2lFVkSG2o2 /
./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz (64進位) -> 0123456789abcdef (16進位)
migrate osc to mag2
v.1 -> osc + : + 0
df7cde40bc6922f8a885a21ebe8fd4b0:70 -> df7cde40bc6922f8a885a21ebe8fd4b0:70:0
v.2 -> osc + : + osc去掉首位$ + : + 0
利用mag2的salt位置傳遞存檔hash,新增程式判斷若為osc v.2,則字首加上$後依v.2規則產生hash,比對若正確後回送hash
$P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/ -> $P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:P$DNVAIbn8kZQQop6d3QAg2lFVkSG2o2/:0
$P$DYd3TBSaZT6C85hm5amzC8RwGcu3Pf. -> $P$DYd3TBSaZT6C85hm5amzC8RwGcu3Pf.:P$DYd3TBSaZT6C85hm5amzC8RwGcu3Pf.:0
joe /var/www/html/magento8pm/vendor/magento/framework/Encryption/Encryptor.php
1.)新增產生osc v.2的password hash
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;
}
2.)修改原有的isValidHash(),加入判斷利用salt位置傳遞的hash值是否為osc v.2,並比對由GenPasswordHash()產生的v.2 hash是否正確
public function isValidHash($password, $hash)
{
$this->explodePasswordHash($hash);
foreach ($this->getPasswordVersion() as $hashVersion) {
// $password = $this->hash($this->getPasswordSalt() . $password, $hashVersion);
//----- 20191109 DV -------
//--- check if RO Site 2nd password hash ($P$D... 33 digit)->(P$D... 32 digit)
$tmpsalt=$this->getPasswordSalt();
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
$password=$tmpsalt;
}
}
else{
$password=$this->hash($tmpsalt.$password,$hashVersion);
}
//-----
}
return Security::compareStrings(
$password,
$this->getPasswordHash()
);
}
magento2 核心密碼比對程式
01.)D:/Temp-Downloads/AWS/8pm-zip/vendor/zendframework/zend-crypt/src/Utils.php -> public static function compareStrings($expected, $actual) -> 逐ord()比對產生Hash vs SQLHash -> return true
02.)D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/Encryption/Helper/Security.php -> public static function compareStrings($expected, $actual) -> by pass call (01) -> return true
03.)D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/Encryption/Encryptor.php -> public function isValidHash($password, $hash) ->展開SQLHash成passwordHashMap array,根據不同$hashVersion()+getPasswordSalt()+password產生Hash -> 比對SQLHash+getPasswordHash() call (02) -> return true
03-1.)D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/zendframework1/library/Zend/Crypt.php -> public static function hash($algorithm, $data, $binaryOutput = false)實際產生Hash for (03)
研究用only
/var/www/html/magento8pm/vendor/magento/module-customer/Model/AccountManagement.php
cd /var/www/html/magento8pm/vendor/magento/module-customer/Model/
mv AccountManagement.php-x AccountManagement.php
wget http://61.220.188.84/dv-2019-tmp/AccountManagement.php
wget http://61.220.188.84/dv-2019-tmp/PasswordHash.x
----------------
https://blog.csdn.net/chengfei112233/article/details/6939144/
密码生成方式
> 随机产生一个salt 并将salt和password相加
> 进行了count次md5 然后和encode64的hash数值累加
> 最后得到一个以$P$开头的密码,这个密码每次产生的结果都不一样C:/Users/dv-10/Desktop/catalog/includes/classes/passwordhash.php
系统:MD5(WordPress)
例子:$P$B123456780BhGFYSlUqGyE6ErKErL01
说明:WordPress使用的md5
长度:34个字符
描述:$P$表示加密类型,然后跟着一位字符,经常是字符‘B’,后面是8位salt,后面是就是hash
加密算法:8192次md5循环加密 -> 2的(8+5=13)次方=8192
--- 20191107 遷移舊RO站客戶資料 -> 一元站
=========================================================================================================================
/var/www/html/magento8pm/app/design/frontend/Zou/demo/
x->joe /usr/local/apache/conf/httpd.conf
x->joe /etc/apache2/apache2.conf
ServerName www.buck4u.com
DocumentRoot /var/www/html/magento8pm/pub/
SetEnv MAGE_MODE "developer"
ServerName www.buck4all.com
DocumentRoot /var/www/html/magento8pm/pub/
SetEnv MAGE_MODE "developer"
SetEnv MAGE_RUN_CODE "demo3"
SetEnv MAGE_RUN_TYPE "website"
service apache2 restart
/etc/apache2/sites-enabled/mag-wg-1.conf /etc/apache2/sites-available/mag-wg-1.conf
/etc/apache2/sites-enabled/000-default.conf
/etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/buck4u.conf
/etc/apache2/sites-enabled/buck4u.conf
ls -al /etc/apache2/sites-enabled/
是 /etc/apache2/sites-available / buck4u.conf 這個, documentroot 對應 magento8pm/pub , 那個 setenv 才有效
在 magneto8pm 和 magneto8pm/pub 下 都各有一個 .htaccess 裡面有指定 index.php
RO站後台入口
https://www.purewaterclub.com/catalog/admin/
admin + admin1234!
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-downloadable/view/frontend/layout/downloadable_customer_products.xml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-customer/Model/Customer/Attribute/Backend/Password.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/Exception/InvalidEmailOrPasswordException.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-customer/Model/AuthenticationInterface.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-captcha/Observer/CheckUserLoginObserver.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-captcha/Test/Unit/Observer/CheckUserEditObserverTest.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-captcha/Test/Unit/Observer/CheckUserLoginObserverTest.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-customer/Controller/Account/EditPost.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-customer/Model/Authentication.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-customer/Observer/CustomerLoginSuccessObserver.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/Encryption/Encryptor.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/Encryption/PasswordHash.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/Encryption/CheckOscPswHash.php
----------------------------------------------------------------------------------------------------------
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-theme/view/frontend/layout/default.xml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-theme/view/frontend/page_layout/1column.xml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-theme/view/base/page_layout/empty.xml
D:/Temp-Downloads/AWS/8pm-zip/app/design/frontend/Venustheme/8pm/Ves_Themesettings/layout/default.xml
D:/Temp-Downloads/AWS/8pm-zip/app/code/Ves/Themesettings/Block/Html/Header.php
D:/Temp-Downloads/AWS/8pm-zip/app/design/frontend/Venustheme/8pm/Ves_Themesettings/templates/header/default.phtml
D:/Temp-Downloads/AWS/8pm-zip/app/code/Ves/Themesettings/Block/Html/Links.php
D:/Temp-Downloads/AWS/8pm-zip/app/design/frontend/Venustheme/8pm/Ves_Themesettings/templates/html/links.phtml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/View/Element/Html/Links.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/View/Element/Template.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/framework/View/Element/AbstractBlock.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-catalog/view/frontend/layout/default.xml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-catalog/view/frontend/templates/product/compare/link.phtml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-theme/Block/Html/Header.php
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-theme/view/frontend/templates/html/header.phtml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-customer/view/frontend/layout/default.xml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-wishlist/view/frontend/layout/default.xml
D:/Temp-Downloads/AWS/8pm-zip/vendor/magento/module-wishlist/view/frontend/templates/link.phtml
table: catalog_product_entity_text
entity_id: item id -> attribute_id, value
table: eav_attribute
attribute_id: 72 -> attribute_code: description
attribute_id: 73 -> attribute_code: short_description
attribute_id: 82 -> attribute_code: meta_keyword
Atomic Endurance Running Tee (V-neck)-S-Blue
修改footer2 背景顏色:
8pm Footer 2 -> Design Elemment -> Prefix Class -> 去掉footer2(黑變白)
修改shipping:
STORES -> Configuration -> SALES -> Shipping Methods
修改payment:
STORES -> Configuration -> SALES -> Payment Methods
修改注冊設定:
Configuration -> CUSTOMERS -> Customer Configuration -> Password Options -> Number of Required Character Classes: 3 -> 2
(20191026)
Element Builder -> 8pm categories -> Design -> (Widget) Categories Info And Subcategories -> Edit
首頁目錄element改長寬:
(Toggle Code) limit_subcategory=/"3/" limit=/"3/" columns=/"3/"
首頁目錄element改目錄類別:
(Toggle Code) catsid=/"20,11,13,3/"
/var/www/html/magento8pm/pub/media/catalog/category/cat6.jpg
----------------------- Ref -----------------------------------------------
app/code/Magento/Xxx/
vendor/magento/module-xxx/
app/design/frontend/Venustheme/8pm/
vendor/magento/theme-frontend-blank/
Base layouts:
/view/frontend/layout
/view/frontend/page_layout
Theme layouts:
/_/layout
/_/page_layout
All layouts:
/var/www/html/magento8pm/vendor/magento/module-theme/view/frontend/layouts.xml
----------------------- OK Used -----------------------------------------
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/theme.xml
A.) Base Page configuration:
/var/www/html/magento8pm/vendor/magento/module-theme/view/frontend/layout/default.xml
A-1.) Base Page layout: -> container page-header
/var/www/html/magento8pm/vendor/magento/module-theme/view/frontend/page_layout/3columns.xml
A-2.) -> 2columns-right -> 1column -> -> container page-wrapper
/var/www/html/magento8pm/vendor/magento/module-
theme/view/base/page_layout/empty.xml
B.) Main Customer (Ves) Theme Page configuration:
/var/www/html/magento8pm/app/design/frontend/Venustheme/8pm/Ves_Themesettings/layout/default.xml
B-1.)