产品和报价项目之间的概念区别是什么 [英] What is the conceptual difference between a Product and a Quote Item

查看:177
本文介绍了产品和报价项目之间的概念区别是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

涉及的类: Mage_Sales_Model_Quote_Item Mage_Catalog_Model_Product .

我都是通过听事件(在购物车中添加)获得了它们.我正在尝试从外部来源更新产品的数量信息.

I get both of them as a result of listening an event ( on cart add ). I am trying to update the quantity information for a product from an external source.

到目前为止,我的代码仅基于产品信息,我不确定这是否正确.

So far I based my code only on the product information and I am not sure if this is correct.

报价项目的目的是什么? 捆绑的可配置产品怎么样?您对如何从捆绑产品中获取单个物品有任何建议吗?

What is the purpose of Quote Items? How about an bundled of configurable product? Do you have any recommendation on how to get the individual items from a bundle product?

谢谢

推荐答案

到目前为止,我要感谢两位响应者所做的努力,但是他们的响应与我的问题相去甚远.我将根据我所学到的东西尝试做出回应.

I want to thank both responders so far for their effort but their responses are pretty far from my question. I'll try to respond myself based on the things that I've learned.

报价是与订单相关的概念,仅在Magento中的工作流程之前.现实世界中的概念就像 preorder 之类的东西,如postIt,您可以在其中将要问的菜肴放在餐厅中,而无需下订单或账单.

A quote is a concept related to the order, only that is previous to that in terms of work flow in Magento. A real world concept is something like a preorder, like a postIt on which you place your asked dishes in a restaurant without being an order or a bill.

我正在监视一个向我发送$ product和$ orderItem的事件(checkout_cart_product_add_after).我现在了解到,发送邮件既是为了获取有关产品的信息,又是有关计费的信息以及该产品在将来的订单中的表示形式.

I was monitoring an event (checkout_cart_product_add_after) that is sending me the $product and the $orderItem. I understand now that is sending both in order to get information about the product and information about billing and the representation of that product in the future order.

例如,对于分组产品,其中$ product是具有各种相关尺寸的Tshirt,则$ product将包含主要分组产品的SKU,而$ orderItem将包含所选Tshirt的实例(中型SKU).

In the case of the grouped products for example where the $product is Tshirt with various associated sizes, the $product will contain the SKU of the main grouped product and the $orderItem will contain the instance of the Tshirt that was selected ( medium size SKU ).

仅供参考:因此,如果是复杂类型(捆绑,可配置或分组),则最好在$ item上更新商品信息,最好从$ item获取商品信息.

FYI: So in order to update the information of a product at cart update you have is better to get the product info from the $item if is a complex type ( bundle, configurable or grouped )

这篇关于产品和报价项目之间的概念区别是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆