Re: Re: "add to cart" form with new product-node-type problem

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Re: "add to cart" form with new product-node-type problem

I wouldn't go so far as to say you're going about it the wrong way, it's just that you didn't take into account the completely undocumented "gotcha" with the add to cart form. You can use hook_forms() to emulate uc_product_forms() and add your module's nodes to the list of those that use uc_product_add_to_cart_form(). That would make your module a more complete implementation.

Instead of using hook_product_types(), or uc_product_node_info(), the better thing to do might be to check the node's type's module. If that is uc_product, then it should obviously use uc_product_add_to_cart_form() for its Add to Cart form. In addition, uc_product_product_types() should probably do the same thing, so that modules adding more their own product classes don't have to implement hook_product_types() themselves, either.

Or we could wait until any node type can become a product type and make this entire problem go away. *shrug*