Re: Re: cart links

Posts: 1314
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Hiding the Add to Cart button you can do using Contemplate and creating a new Template for the Product node type.

For the page to buy multiple items, I like this idea - but I think it'll require some custom coding. You'll probably need to use CCK also, to add a Checkbox to your Product edit forms - something like "Purchase via multiple" or something to that effect, so you can flag which products to include on this page. (There are other ways but I think that's easiest).

Then, in the custom module create a form which contains a loop that finds all flagged products and adds the checkboxes to the page. You'll probably need to use TAPIr for that, or just outputting a themed table, whatever suits you best. (You can really use any layout you like).

So utilizing hook_form_alter in your custom code, loop through all the products and add them to the form, and then when they are done looping, add your Submit button which during hook_form_submit uses the hook_add_to_cart to add those items.

Sounds more complicated than it is, I think. I know what you're trying to do and more questions might be "do you want multiple pages to allow different categories, or just one page listing all products?" etc which might bring you into more complex territory.

Hope this helps!

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com