简体   繁体   English

收货地址上的新字段

[英]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.

相关问题 Rails中带有条纹的收货地址 - Shipping Address with Stripe in Rails Rails + AJAX:如何将text_field输入中的文本更改为@ shipping_address.name的值? - Rails + AJAX: How do I change the text in a text_field input to the value of @shipping_address.name? 设计添加用户送货地址 - Devise adding User shipping address 电子商务运输和账单地址放入Rails的一张桌子中 - Ecommerce shipping and billing address into one table in rails 在Paypal上设置送货地址(红宝石在铁路上) - Set shipping address on paypal (ruby on rails) 验证送货地址的存在,除非与帐单地址相同 - Validate presence of shipping address unless it's same as billing address 如何在rails中订购送货地址和帐单邮寄地址 - How to give an order a shipping address and a billing address in rails 具有许多地址,但该用户具有主要帐单,送货和资料地址的用户 - A User with many Addresses, but User has a primary billing, shipping, and profile Address 使用自适应付款时,付款地址在贝宝屏幕中不可见 - shipping address is not visible in paypal screen while using adaptive payment 在devise模型中的新字段上进行自定义验证,并使用相同的电子邮件地址创建多个用户 - Custom validation on new field in devise model and creating multiple users with same email address
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM