duananyu9231 2015-04-24 23:15
浏览 30
已采纳

重写Drupal产品标题选择列表

I run a popular Drupal website that caters for the clubbing market. I retail events on my site using Drupal Commerce

To create an event(product) I have set up these fields :

  • Event Title
  • Event Date
  • Event Price

When creating events, each event is a separate product with a different date.

Now on the node that lists that particular event, I title my products in a way so when select the event from the drop down select list it reads;

Product Title(Event Name) -- Event date

eg

  • Boat Party - 12/07/15
  • Boat Party - 13/07/15
  • Boat Party - 14/07/15
  • Boat Party - 15/07/15
  • Boat Party - 16/07/15

What I need is rewrite function:

Instead of adding the date in the product title every time, is the correct function to rewrite the product title in the drop down as to include the date variable and price like as follows;

Day,Month -- Product Title(event title) -- Price

eg;

  • 14th, May -- Boat Party -- £10
  • 15th, May -- Boat Party -- £10
  • 16th, May -- Boat Party -- £10
  • 17th, May -- Boat Party -- £10
  • 18th, May -- Boat Party -- £10

Thank you.

  • 写回答

1条回答 默认 最新

  • dousi2553 2015-04-25 15:31
    关注

    You can try Automatic Entity Label module. It can be used to automatically generate, for example, node title, or product title, using tokens. You will need Token module as well.

    You will need to use something like that as a pattern for product title (pseudocode):

    [product:event_date] -- [product:event_title] -- [product:price]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭