Linux 软件免费装
Banner图

Magento 2 WP Integration

开发者 yaroslav0yachmenov
ayachmenev
maximtkachuk
modernminds
更新时间 2025年10月31日 03:14
捐献地址: 去捐款
PHP版本: 7.3 及以上
WordPress版本: 6.8
版权: GPLv3 or later
版权网址: 版权信息

标签

shop integration e-commerce magento magento2

下载

1.2.7 1.4.2 1.4.2.1 1.1.2 1.1.3 1.2 1.2.5.1 1.2.6 1.3 1.3.0.1 1.3.1 1.4 1.4.1

详情介绍:

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 Basic Usage You can use the following functions in your theme files: You can use the following shortcodes in your WordPress editor: You can override Slider and Single Product templates in your current theme directory CURRENT_THEME_DIR/m2i-templates/product-view.php or slider.php

安装:

You can only use this plugin if your WordPress installation is on the same server as your Magento installation. This plugin requires several Magento store files to be included using PHP, this means it needs to be on the same server as your WordPress Installation. In addition, session data is stored per server and thus only available if both platforms are installed on the same server. Nevertheless, in most setups you can use different subdomains with this plugin.
  1. Download the WordPress plugin
  2. Upload the contents of the zip to your plugin directory
  3. Enable the plugin in your WordPress admin
  4. Complete the settings in the plugin settings page
Session sharing additional setup If you want to be sure about session sharing (especially when a user is logged in) between Magento and WordPress, you need to add the next code to Magento index.php file before Bootstrap line: if ( isset( $_COOKIE['PHPSESSID'] ) ) { /* To share logged in user session with WP frontend */ setcookie( 'PHPSESSID', $_COOKIE['PHPSESSID'], time() + 3600, '/', '.local.wordpress', 0 ); /* To share logged in user session with WP backend */ setcookie( 'PHPSESSID', $_COOKIE['PHPSESSID'], time() + 3600, '/wp-admin', '.local.wordpress', 0 ); } Custom replacement of translation function If for some reasons our new automatic replacement functionality doesn't work, you have to replace WordPress translation function in your own (it conflicts with Magento, so modified version is required). Apply the following patch to WordPress to avoid conflicts between WordPress and Magento 2: File: WORDPRESS_ROOT/wp-includes/l10n.php WordPress __() function is used for translation but is in conflict with Magento 2. Therefore, please find this function at around line 296 and REPLACE function __( $text, $domain = 'default' ) { return translate( $text, $domain ); } WITH function __( $text, $domain = 'default' ) { if ( defined( 'M2I_MAGE_DIR' ) && class_exists( 'M2I_External' ) && M2I_External::$needs_mage_translate ) { return M2I_External::translate( func_get_args() ); } else { return translate( $text, $domain ); } }

屏幕截图:

  • Advanced settings
  • Magento 2 WordPress Integration

升级注意事项:

1.4 We replaced free limited version with the full premium, so be ready to review all the options. You also need to remove your premium version and replace it fully with the free one in order to allow automatic updates and custom update from WP screen. 1.2.6 We have fixed some fatal errors when the object cache is enabled for the WP side. We kindly recommend to upgrade the plugin. 1.2.5.1 User can select by his/her own the Magento 2 running from the "pub" directory or base one (root). Errors verbosity increased and a couple of fatal errors fixed. Translations domain fixed to m2wp.

常见问题:

How could I disable automatic translation function replacement?

You have to add the next code snippet to your wp-config.php file: define( 'M2I_DISABLE_TRANSLATION_FUNC_MODIFY', true );

What should be the absolute path of my Magento directory?

An example could be: /data/web/magento2/ It should go the main directory of your Magento 2 installation

Does it support Magento 1?

No, for support of Magento 1 there are several other plugins available

Does it support Magento 2.3 or 2.4?

Yes, since 1.3 plugin version

What are the server requirements?

Magento 2 and WordPress should be able to read each other location. Therefore, it does not matter if you use a subdirectory for example, as long as they are on the same server and can be accessed by the same user.

更新日志:

1.4.2.1 1.4.2 1.4.1 1.4 1.3.1 1.3.0.1 1.3 1.2.7 1.2.6 1.2.5.1 1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2 1.1.3 1.1.1 1.1 1.0.6