[英]New field on shipping address
I'm building a store with Rails and Spree Commerce. 我正在用Rails和Spree Commerce建立一家商店。 The products are basically personalised kits that will be send as a gift to another person.
这些产品基本上是个性化的套件,将作为礼物发送给其他人。
So, when you do the ckeckout you need to use the form "shipping address" and put your friend's address. 因此,当您完成退出时,您需要使用“收货地址”表格并输入您朋友的地址。
But, there is no "message" field. 但是,没有“消息”字段。
The people how send these gift want to send with it a card with some text like "Happy birthday John!" 寄送这些礼物的人想随身携带一张卡片,上面写着“约翰生日快乐!”之类的文字。 or something like that.
或类似的东西。
I don't know how to handle this, is there any extension to do that? 我不知道该如何处理,是否可以扩展? Or I have to modify the core code of Spree?
还是我必须修改Spree的核心代码?
I'm not sure I can give you the exact code but I think I can point you in the right direction. 我不确定我能否给您准确的代码,但我想我可以为您指明正确的方向。 So a user browsers your site, adds a few items to the cart and proceeds to the checkout page where they enter their friends shipping address.
因此,用户浏览您的站点,将一些商品添加到购物车,然后进入结帐页面,在该页面中输入朋友的送货地址。
rails generate Order name:string friends_name:string shipping_address:text email:string attatched_message:text
attatched_message would be the personalized message. attatched_message将是个性化消息。 Then all you need to do is add the order to the model used to pass items from the shopping cart to the order form.
然后,您需要做的就是将订单添加到用于将商品从购物车传递到订单的模型中。 ex.
例如
rails generate migration add_order_to_line_item order:references
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.