magepal / magento2-ajax-newsletter-subscribe
Ajax Newsletter Subscription
1.2.1
2020-12-25 19:07 UTC
Requires
- magento/framework: *
This package is auto-updated.
Last update: 2024-08-26 03:10:01 UTC
README
Magento 2 的 Ajax Newsletter Subscription
安装
步骤 1
使用 Composer(推荐)
composer require magepal/magento2-ajax-newsletter-subscribe
手动
- 下载扩展
- 解压文件
- 在 {Magento 2 根目录}/app/code/MagePal/AjaxNewsletterSubscribe 创建一个文件夹
- 从解压文件夹中复制内容
步骤 2 - 启用扩展 ("cd" 到 {Magento 根目录} 文件夹)
php -f bin/magento module:enable --clear-static-content MagePal_AjaxNewsletterSubscribe
php -f bin/magento setup:upgrade
用法
$('#newsletter-validate-detail').submit(function (e) { if ($(this).valid()) { var url = $form.attr('action'); var postData = $form.serializeArray(); try { $.ajax({ url: url, dataType: 'json', type: 'POST', showLoader: true, data: $.param(postData), complete: function (data) { if (typeof data === 'object') { data = data.responseJSON; //json object } else { //Unknown Error } } }); } catch (e) { //check for errors } } return false; });
返回 JSON
$response = [ 'status' => 1, 'msg' => __('The confirmation request has been sent.'), ]; $response = [ 'status' => 0, 'msg' => __('There was a problem with the subscription: %1', $e->getMessage()), ];
- 自定义 SMTP
- Magento 的目录悬停图像
- Magento 2 的增强成功页面
- Magento 2 的增强事务性电子邮件
- Google Tag Manager
- 增强电子商务
- 重建索引
- 自定义配送方式
- 预览订单确认
- 访客到客户
- 管理员表单字段管理器
- 客户仪表板链接管理器
- 懒加载
- 订单确认页面其他脚本
- Magento2 的 HTML 压缩器
© MagePal LLC. | www.magepal.com