Closed (fixed)
Project:
e-Commerce
Version:
master
Component:
other
Priority:
Critical
Category:
Feature request
Assigned:
Reporter:
Created:
13 Feb 2006 at 06:14 UTC
Updated:
25 Apr 2006 at 00:30 UTC
Jump to comment: Most recent file
I've updated the gordon's patch to work with the HEAD branch of the e-commerce module. I'm working to update nedjo's subproducts (the subproducts generation wizard and the "add to cart" functionality are done and tested) and apparel (100% done, I think) modules to help test this patch. I hope didn't made duplicated work.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | ecommerce-subproducts_5.patch | 8.4 KB | recidive |
| #17 | ecommerce-subproducts_4.patch | 6.65 KB | recidive |
| #15 | ecommerce-subproducts_3.patch | 4.88 KB | recidive |
| #12 | ecommerce-subproducts_2.patch | 7.86 KB | recidive |
| #10 | ecommerce-subproducts_1.patch | 6.1 KB | recidive |
Comments
Comment #1
recidive commentedI missed the table definition stuff.
Comment #2
nedjoThanks for digging into this!
I'm also working this week on completing the subproducts integration into 4.7/HEAD. Let's coordinate so we can take on distinct parts. There are a few changes we need to make to Gordon's patch (rename parent field to pparent to avoid conflict with book module, drop children field and instead dynamically load the ->children array, etc.)
Maybe I should take on Gordon's patch from where you've taken it, and you could focus on an upgrade to subproducts.module. Does that make sense?
Comment #3
recidive commentedChanged parent to pparent and added the dynamically load of the children array. Some test is still nedded, but I think that we are almost there. This patch was made to work with Nedjo's subproducts.module that for the time being lives in his sandbox.
Comment #4
nedjoThanks recidive. I've moved the (not yet finalized, but getting there) subproducts module to the main ecommerce directory. I'll test and report back on this latest patch.
One question is, should we be moving everything we can to subproducts.module? I.e., should we be limiting the changes to product.module to the absolute minimum, and do everything else in subproducts.module?
Comment #5
nedjoI'm working on stripping down this patch to the absolute minimum and doing everything else in subproducts.module. Recidive and I have been updating subproducts.module to 4.7 (it was initially written for 4.6, sponsored by GoodStorm). It's not done yet, but can be used for basic testing. We've also added HEAD/4.7 versions of two GoodStorm-sponsored modules to the /contrib directory that use subproducts: apparel.module and custom.module.
Attached is an interim version of the enabling patch. It's not ready to apply yet as we need to do more testing.
Note re changes from the previous patch draft:
I've removed the proposed subproduct-specific cart call, and instead changed
cart_get_items()to use $node->nid rather than $nid. The idea is that, when needed, subproducts.module can reset the object reference from the parent to the child product.I've drafted a documentation page on subproducts, http://drupal.org/node/52743, and will add a developer version as soon as I get a chance.
Comment #6
gordon commentedIs this the full patch, It doesn't look like much. If it is please commit it.
Comment #7
recidive commentedI've just updated the patch to reflect recent updates in ecommerce package and to add the table definition (tested) and the update (not tested) stuffs. In my view it is ready to be commited.
Comment #8
nedjoI want to have a fully tested and working version of subproducts module before applying this patch, as likely completing the subproducts module updates will require more adjustments to the patch.
The update function should go in product module rather than store. Probably we should we remove the pparent field from the CREATE TABLE call in product.install and instead put the _update function.
Comment #9
gordon commentedThis should be there for new installations, but there also needs to be a product_update_{n}() which includes the creation of the pparent field for existing ecommerce installations.
Comment #10
recidive commentedChanged module_invoke to product_invoke_productapi so the $node really goes as reference and put update function in the right place.
Comment #11
ob3ron commentedAre there plans to add subproduct functionality to other product types as well? I'm setting up a site that sells retreats and has different accommodation options (ie a non-shippable product) -- it would be great to be able to be able to set this up within the e-commerce framework, and it's hard to shoe-horn it in currently.
If I can help with the coding, I'd be happy to -- I'm not that familiar with the Drupal codebase yet, but I'm a fairly decent PHP programmer.
Comment #12
recidive commentedUpdated patch. Solved some conflicts with lastest changes in ecommerce package. Added index for pparent field to improve performance and now the link for a subproduct in the cart points to its parent product.
Yes, We are working to put the stock feature optional by checking if the product return "is_shippable" through the productapi. Currently there are two modules that implements subproducts functionality: apparel (variation-type) and custom (base-type) both generate shippable products because they extends tangible product type. You can start making your own retreats module/product type that will implement variation-type subproducts, I guess.
Cool, you can start by testing this and sending your patches :)
Comment #13
gordon commentedI was just about to commit this patch, and I found that the call to the product_invoke_productapi() in the cart_add_item() is actually returning an array of falses, because product_invoke_productapi() calls all hook_productapi() and merges all the results togethers.
What is meant to happen is that the invoke should just return 1 value which is false to stop the addition to the cart or anything else which is treated as true, and it can be added to the cart.
Is there a reason for the change, or can I just turn this back to the original module_invoke().
Once I have this sorted I will be commiting this.
Comment #14
gordon commentedforgot to change the status's
Comment #15
recidive commentedThe reason is that we need to pass $node as reference to the productapi so we can reset the $node object reference from the parent to the child product. It's seems not to work with module_invoke because $node goes as a copy instead of a reference. There is another way for doing this?
Comment #16
recidive commentedI've found an another way for doing the cart stuff. Please wait, I will send an updated patch as soon as possible.
Comment #17
recidive commentedDone. Just removed the changes in
cart_add_item(). Now the "add to cart" functionality for subproducts is handled bysubproducts_cart_add_item().Comment #18
gordon commentedI do not like this idea, Lets change the cart_add_item() so that it calls the productapi direct without using the module_invoke(), this will be a lot cleaner and be easier to maintain.
Comment #19
recidive commentedOk, I've put back the
cart_add_item()changes in cart.module and 'cart add item' operations in apparel.module and custom.module productapi. Also removed 'subproducts/cart' stuff from subproducts.module.Comment #20
gordon commentedThanks for this I have commited it to cvs.
Comment #21
hadishon commentedThanks for the good work!
This handbook page may need to be updated now:
http://drupal.org/node/52743
Comment #22
hadishon commentedI've been testing the new changes. It seems to work well until I try to edit a product that has variations. When I edit the item and click submit, I get the following errors:
Once this happens, the page gets "lost" and is dramatically changed. The only way I can get it back is to recreate the node from scratch.
Comment #23
hadishon commentedAfter some more testing, this only happens when "Create New Revision" is selected. As long as you're not making a new revision, it seems to work fine to edit product nodes.
I'm using 4.7 rc2 and cvs (current as of today) ecommerce.module.
Comment #24
gordon commentedYou most likely had a problem with the upgrade and the index on nid has not been removed. This has nothing to do with the subproducts.
Comment #25
gordon commentedthis is fixed again.
Comment #26
(not verified) commented