
內容簡介
將強大的電子商務解決方案Magento 2與WordPress的優秀CMS功能結合。Magento 2 WordPress Integration外掛將Magento 2與WordPress集成,讓使用者享受統一的用戶體驗。使用shortcode或function來共享session/cart數據、導航菜單、頁眉、頁腳、產品、佈局元素和靜態區塊。
此外掛程式並不是用來取代Magento 2,而是允許你通過整合Magento和WordPress的設計來為訪問者創建無縫的用戶體驗。
特點
在WordPress主題中包含Magento 2塊
使用shortcode將產品、購物車、佈局塊和靜態塊包含到WordPress編輯器中(“添加Magento2 Shortcode”按鈕)
在Magento 2和WordPress之間共享session和cart數據
在WordPress編輯器中包含產品信息
將你的Magento 2和WordPress主題無縫地集成在一起
使用session數據顯示購物車/迷你購物車
有4個小工具可以顯示靜態區塊、產品滑塊、單個產品或購物車
滑塊和單個產品範本可以在當前主題中被覆蓋
如果你的主題使用HTML5方法,就可以自動添加頭部和底部來源於你的Magento 2
基本用法
你可以在你的主題文件中使用以下函數:
獲取頭文件的HTML內容(作為字符串):m2i_get_header()
獲取底部文件的HTML內容(作為字符串):m2i_get_footer()
獲取CSS文件的HTML內容(作為字符串):m2i_get_links_css_tags()
獲取JS文件的HTML內容(作為字符串):m2i_get_scripts_from_head()或m2i_get_scripts_from_body()
根據CSS選擇器獲取網站部分(元素)的HTML內容(作為字符串):m2i_get_els_by_css_selector($css_selector)
根據CSS選擇器獲取網站部分(元素)的HTML內容(作為字符串):m2i_get_el_by_css_selector($css_selector)
將產品數據作為數組獲取:m2i_get_product($sku_or_id, $by_id = false)
作為數組獲取類別列表:m2i_get_cat_collection($is_active = true, $level = false, $sort_by = false, $page_size = false)
作為數組獲取商店視圖列表:m2i_get_stores()
作為數組獲取區塊列表:m2i_get_blocks()
作為數組獲取客戶信息:m2i_get_customer_info()
獲取CMS區塊的HTML內容(作為字符串):m2i_get_cms_block($attrs),其中$attrs ['name']是您的Magento2中CMS區塊的名稱
獲取購物車的HTML內容(作為字符串):m2i_get_cart($attrs),如果在$attrs中設置了“hide_if_empty”關鍵字,將會在空時隱藏它。
你可以在WordPress編輯器中使用以下shortcode:
顯示區塊:[m2i_cms_block name=”name_in_layout”]
顯示滑塊:[m2i_category_slider dom_id=”unique-id” cats_ids=”categories_ids_separated_by_comas” qty=”quantity_of_products” margin=”in_number”]
顯示單個產品:[m2i_product_block id=”product id”]或[m2i_product_block sku=”product sku”]
顯示購物車:[m2i_cart]或[m2i_cart hide_if_empty]
你可以在你當前的主題目錄下覆蓋滑塊和單個產品模板
CURRENT_THEME_DIR/m2i-templates/product-view.php或slider.php
外掛標籤
開發者團隊
原文外掛簡介
Combine the powerful e-commerce solution Magento 2 with the excellent CMS capabilities of WordPress. The Magento 2 WordPress Integration Plugin integrates Magento 2 with WordPress so users will have an unified user experience. Share session/cart data, navigation menus, header, footer, products, layout elements and static blocks by using shortcodes or functions.
This plugin is not meant to replace Magento 2, instead it will allow you to create a seamless user experience for your visitors by integrating the design of Magento and WordPress.
Features
Include Magento 2 blocks in your WordPress theme
Use shortcodes to include products, cart, layout blocks, and static blocks in the WordPress editor (“Add Magento2 Shortcode” button)
Share session and cart data between Magento 2 and WordPress
Include product information in your WordPress editor
Seamlessly integrate your Magento 2 and WordPress theme
Display cart/mini cart with session data
4 Widgets to display static blocks, product slider, single product or cart
Slider and Single Product templates can be overridden in current theme
Auto adding possibility of header and footer from your Magento 2 (only if your theme is using HTML5 approach)
Basic Usage
You can use the following functions in your theme files:
Get HTML content (as string) of the header: m2i_get_header()
Get HTML content (as string) of the footer: m2i_get_footer()
Get HTML content (as string) for CSS files: m2i_get_links_css_tags()
Get HTML content (as string) for JS files: m2i_get_scripts_from_head() or m2i_get_scripts_from_body()
Get HTML content (as string) of the parts (elements) of the site by CSS selector: m2i_get_els_by_css_selector($css_selector)
Get HTML content (as string) of the part (element) of the site by CSS selector: m2i_get_el_by_css_selector($css_selector)
Get Product Data as array: m2i_get_product($sku_or_id, $by_id = false)
Get Categories List as array: m2i_get_cat_collection($is_active = true, $level = false, $sort_by = false, $page_size = false)
Get Store Views List as array: m2i_get_stores()
Get Store Views List as array: m2i_get_blocks()
Get Customer Info as array: m2i_get_customer_info()
Get HTML content (as string) of the CMS block : m2i_get_cms_block($attrs), where $attrs[‘name’] – name of the CMS block in your Magento2
Get HTML content (as string) of the Cart: m2i_get_cart($attrs), if in $attrs is set key ‘hide_if_empty’ it will be hidden if empty.
You can use the following shortcodes in your WordPress editor:
Show Block: [m2i_cms_block name=”name_in_layout”]
Show Slider: [m2i_category_slider dom_id=”unique-id” cats_ids=”categories_ids_separated_by_comas” qty=”quantity_of_products” margin=”in_number”]
Show Single Product: [m2i_product_block id=”product id”] or [m2i_product_block sku=”product sku”]
Show Cart: [m2i_cart] or [m2i_cart hide_if_empty]
You can override Slider and Single Product templates in your current theme directory
CURRENT_THEME_DIR/m2i-templates/product-view.php or slider.php
