in the _afterLoad function of the quote item collection entity, the quote item’s values are being overridden with default settings from the product. This seems backwards. If you’ve quoted someone something, and you are loading it up from the DB to turn it into an order, why should default products settings force themselves over what you’ve quoted.
This is going to be a huge stumbling block for anyone who wants to change the default behavior.
Mark_Kimsal - This is a bit misleading. The quote is an internal quote. So the shopping cart and order are updated with the updated values for the product. We have on our to-do list implementation of a quote system with more complex functionality in the future. I guess the choice of naming is a bit confusing.
Mark_Kimsal - This is a bit misleading. The quote is an internal quote. So the shopping cart and order are updated with the updated values for the product.
Both dsgnfred and I need some sort of functionality to flag extra parameters with an order. Would you recommend attaching values directly to the quote instead of the product? I’m not sure how to find the entity ID of the product if I attach directly to the quote and not to a sales_quote_item.
I *can* work around the problem now by changing my “$item->setConfigid( $product->getConfigid() ) “ line to check if there is a value for getConfigid(). If there is not, then the system is trying to set an empty value from the default product.
I’m wondering if this behavior is desirable under any circumstances. Why should the quote be repeatedly initialized with fresh values from the product ID from the database (especially when it’s only being loaded just to convert to a sales_order and be saved right away)? Can this whole thing be solved (changed) by throwing in an “if isLoaded()” into the collection’s _afterLoad() method? If it’s loaded from the DB, then the attributes can be assumed to be correct, no?
YoavKutner - 17 December 2007 07:58 PM
We have on our to-do list implementation of a quote system with more complex functionality in the future.
Cool, I’m keeping track of all these changes in a Magento group wiki page, so I’m ready for changes to the sales quote system. I’m trying to get a feel for the *best* solution and keep updating that solution as magento gets closer to 1.0.
I need to let customers specify how many full time employees they have when they buy a membership and multiply that number by 4, then add that to the total. You and I worked on this sort of thing in the past. I did all the code changes you called for but I need this to let me use a text field and parse that number entered