joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig awget 118.163.15.73/bpc/dv/popupop.twig -N joe /var/www/storage/modification/catalog/controller/product/product.php joe /var/www/html/catalog/controller/product/product.php /var/www/html/catalog/view/theme/default/template/product/123.html E:\wg-1-work\opencart-work\0-opencart-work\system\storage\vendor\twig\twig\src\Node/Node.php cd /var/www/storage/modification/catalog/view/theme/default/template/product/ cd /var/www/storage/modification/system/library/template cp /var/www/html/system/library/template/template.php joe /var/www/html/admin/controller/marketplace/install.php joe /var/www/html/admin/controller/marketplace/modification.php joe /var/www/html/catalog/controller/common/header.php joe /var/www/html/catalog/controller/product/product.php joe /var/www/html/catalog/controller/startup/startup.php joe /var/www/html/catalog/view/theme/default/template/common/header.twig joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig joe /var/www/html/system/library/template/twig.php joe /var/www/storage/modification/admin/controller/marketplace/install.php joe /var/www/storage/modification/catalog/controller/extension/module/featured.php joe /var/www/storage/modification/catalog/controller/product/product.php joe /var/www/storage/modification/catalog/view/theme/default/template/common/header.twig joe /var/www/html/catalog/view/theme/default/template/product/product.twig joe /var/www/html/catalog/controller/product/product.php joe /var/www/storage/modification/catalog/controller/product/product.php joe /var/www/storage/modification/catalog/view/theme/default/template/product/product.twig joe /var/www/html/catalog/view/theme/default/stylesheet/stylesheet.css joe /var/www/html/catalog/view/javascript/default/font-awesome/css/font-awesome.css joe /var/www/html/catalog/view/theme/default/template/product/popupop.twig cd /var/www/html/catalog/view/theme/default/template/product/ wget 118.163.15.73/bpc/dv/popupop.twig -N joe /var/www/storage/modification/catalog/controller/product/product.php joe /var/www/html/catalog/controller/product/product.php joe /var/www/html/catalog/model/catalog/product.php /var/www/html/catalog/view/javascript/bootstrap/css/bootstrap.css /var/www/html/catalog/view/javascript/bootstrap/js/bootstrap.js ========================================================================================================================= (!!copy時錯誤: db->oc_product->date_available: default="0000-00-00" 格式不對系統自動改為 default 無) 1.) db->oc_product 增加新欄位 domestic 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...3個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.)