4takte/oxid-gender

为 OXID eShop 添加其他性别选项。

安装: 11

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

语言:Smarty

类型:oxideshop-module

v1.0.1 2020-12-14 21:15 UTC

This package is auto-updated.

Last update: 2024-09-15 18:07:46 UTC


README

如果在在线商店中,用户的问候语或性别选择是可选的,或者甚至作为一个箭头字段提供,则必须为用户提供另一个选项,以避免对第三性别的歧视。

功能

  • 向主题中的问候语模板添加另一个性别选项
  • 在管理员中扩展问候语字段
  • 您可以将新选项的数据库值定义为模块配置参数
  • 可选的cronjob控制器以修复/设置损坏的用户问候语条目

安装

1 - 使用 composer 安装

composer require 4takte/oxid-gender:"dev-main"

2 - 将缺少的块添加到您的主题中

目前有开放请求要求将此块集成到 flow 和 wave 主题中。
目前您必须自己集成它们。

theme > form > fieldset > salutation.tpl 添加 "salutation_options" 块

<select name="[{$name}]"
        [{if $class}]class="[{$class}]"[{/if}]
        [{if $id}]id="[{$id}]"[{/if}]
        [{if $required}]required="required"[{/if}]>
        [{block name="salutation_options"}]
                <option value="" [{if empty($value)}]SELECTED[{/if}]>[{oxmultilang ident="DD_CONTACT_SELECT_SALUTATION"}]</option>
                <option value="MRS" [{if $value|lower  == "mrs" or $value2|lower == "mrs"}]SELECTED[{/if}]>[{oxmultilang ident="MRS"}]</option>
                <option value="MR"  [{if $value|lower  == "mr"  or $value2|lower == "mr"}]SELECTED[{/if}]>[{oxmultilang ident="MR" }]</option>
        [{/block}]
</select>

3 - 在 Oxid eShop 管理员中激活模块

4 - 清除 smarty 模板缓存

Cronjob(可选)

像 PayPal、AmazonPay 这样的即时支付方式以及其他外部系统可能在结账或订单导入时插入地址和用户数据。正如我们所注意到的,一小部分用户没有被正确格式化为 OXID eShop 标准问候语。

Cronjob 在 oxuser 和 oxaddress 中执行 sql 查询以修复这些问题。

  • 空值更新为新性别数据库值(配置选项)
  • 非标准和明显可归类的值更新为 oxid 标准值
  • 您可以轻松更改 cron 以满足您的需求

首先检查此 db 查询

此查询输出分组问候语值。在本地 docker 环境中执行,耗时 0.539 秒(约 500,000 个用户)
分析查询输出,并根据需要更改 \Viertakte\OxidGender\Application\Controller\CronController 的属性。在 oxaddress 中可能也存在有问题的条目。在我们的测试中我们没有发现,因此目前还没有为 oxaddress 实现查询。

select distinct oxsal, count(oxsal) from oxuser group by oxsal having oxsal NOT IN ('MR','MRS', '');

Cronjob URL

https://your-shop-url.com/index.php?cl=viergendercron&cronkey=vS8jcd5QwrZ4aKsA

附加信息/地区法院的判断

法兰克福高等地区法院 - Az. 2-13 O 131/20 - 2020年12月3日
lto.de | onlinehaendler-news.de

许可证

Copyright (c) 2020 Markus Schröder <ms@4takte.de>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

版权

(c) 2020 4takte