如何在 modx 中向属于不同组(网络)的用户显示信息
我使用 modx evolution v1.0.2 创建了一个网站。
我开发的网站有 12 种不同类型的用户(按组分类)。每个用户将根据其所属的组显示不同的价格。
到目前为止,我已经能够获取当前登录用户的组名(为此创建了一个片段),但是如何实现上述功能,以便每个用户应该只能看到我根据编码编码的价格到他的小组。
例如:
如果用户与“偶尔”组相关联,那么他应该看到价格,例如 50 美元 如果用户与“常规”组相关联,那么应该向他显示价格,例如 40 美元。
我可以通过为每个产品的变体编写一个片段来轻松地做到这一点,但是有很多变体(超过 100 种并且还在不断增加)。
我为每个产品及其变体创建了一个资源(页面)。每个变体都有一个价格。我想根据登录的用户组成员身份显示这个价格。
我希望我能够清楚地解释我的疑问。
请帮我实现这个功能。
谢谢
I have created a website using modx evolution v1.0.2.
The website that I have developed has 12 different types of users (categorized in groups). Each user will be shown a different price depending on the group to which he belongs.
Till now I have been able to fetch the group name of current logged in user (created a snippet for that), but how can I achieve the above mentioned functionality so that each user should be able to see only the price that I have coded according to his group.
For example:
If a user is associated with the 'ocassional' group then he should be shown the price as , say, 50 bucks
and if a user is associated with the 'regular' group then he should be shown the price as, say, 40 bucks
I can easily do this by coding a single snippet for every product's variant, but there are a lot of variants (more than 100 and growing).
I have created a resource(page) for every product and it's variant. Every variant has a price. It is this price that I want to be shown according to the logged in user group membership.
I hope I am able to explain my query clearly.
Please help me do this functionality.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太相信 modx(尽管我很喜欢它)是电子商务网站的一个很好的解决方案。
然而,最好的解决方案可能是使用数据库来存储每个用户组的变体价格,并使用代码片段自行检索它们。
I'm not really convinced that modx (as much as i love it) is a great solution for e-commerce sites.
However, the best solution might be to use the database to store the prices of variants per user group and retrieve them yourself using a snippet.