I have created a module that I think is pretty darn nifty.

You can create a product that has two options to chose from. Its a mix between subproduct.module and parcel.module except that the customer can choose the subproduct from a list that you specify.

In order to view the options that the customer has chosen you need to add a couple of lines of code to cart.module and store.module. I should make a patch for this, but you can see what I am talking about in install.txt file.

Please try it out and let me know if it works for you.

alynner

Comments

alynner’s picture

StatusFileSize
new4.32 KB

I have updated this module:

- now you can have one, two or three options
- you can specify if you would like a select list or radios for each option
- you can specify the name of the option

I have included a new database table, so if you tried it already you need to reinstall completely.

The idea with this module is that you can specify 'two for one' or package sales, but the customer can choose options, rather than just having static options as per parcel.module.

alynner

alynner’s picture

StatusFileSize
new4.42 KB

added shippable and stock features, but the stock only applies to the package (parent) item.

alynner’s picture

StatusFileSize
new12.72 KB

UPDATE:

includes out of stock abilities for sub-items

jsydelko’s picture

Great module, I have your last revision up and running! One request, can you have the option to force a selection from your choices. Right now someone can add my dynamic parcel to their cart without selecting any of the products.

Thanks for the great work,
Jeff

alynner’s picture

StatusFileSize
new13.02 KB

this version has the ability to add more quantities to the cart.

Its not great though, I will look into making the ability to change the quantity of the subproducts which, in turn, changes the quantity of the main product.

I put the '#required' => TRUE code on the subproduct fields, but it doesn't seem to validate - it still lets you add to cart. Anyone have any thoughts on this?

cheers
alynner

StevenSokulski’s picture

I downloaded your latest version and installed in. Now it appears nothing has changed. Point me to where the settings/functionality for this module is.

Thanks.

alynner’s picture

there are no settings to configure, it is just a node type essentially.

The last version would only allow you to enter the item once and would switch the "add to cart" button to "remove from cart"; this version allows you to add the (parent) item more than once. It just doesn't show quantities of the subitems, which is on the wishlist. It wasn't a big change.

alynner

coupet’s picture

Great module!

patch status of

add a couple of lines of code to cart.module and store.module
rudolphp’s picture

Hi , Thanks for this module. I am getting the below error when I submit a new product. what am I missing. Its a flexinode that has been transformed to a products using product_transform module

Fatal error: Call to undefined function: currency_api_convert() in /home/omved/public_html/modules/ecommerce/dynamic_parcel/dynamic_parcel.module on line 278

Thanks
Rudy

alynner’s picture

sorry I added functionality to use currency conversion module. I must have forgotten to take that out before I uploaded the latest version. I am away from my office at the moment but when I get back next tuesday I will fix the error.

alynner

alynner’s picture

To fix the currency error, simply delete lines 275 to 283 or you can change line 275 from:
if ($teaser == 0 ){
to:
if ($teaser == 0 AND module_exist('currency')){
which is what I did for my site.

alynner

machead_uk’s picture

Title: New module: dynamic_parcel » Installed dynamic_parcel Now I get weird errors

Hello. I am a newbie but I guess you have to start somewhere.
I am fetting really frustrated with the ecommerce functionality in Drupal 4.7.x.

I have a couple of days max to get this site live and the customer is freaking out.

To give you a clue of what I am trying to achieve the store will be selling clothing items that have to be fitted close to the body and do not stretch much so a size has to be entered when you have chosen your specific item. Then it will use a bit of Javascript to populate various measurements fields based on that clothing size. Those fields are things like "hips", "Bust", "Waist" etc. I have the Javascript to do that. Theese fields that get populated are editable too so the buyer can put in a custom measurement for their bust or waist etc if needed. Now here comes my issue: I can't see how you can add these custom fields to a product so you can successfully send them over to the shopping cart.

I was wondering if dynamic_parcel.module and CCK would be the answer but I really don't know if it will work.

I am also getting warnings when selecting "dynamic collection of products" in the Add Content sub menu.
warning: Invalid argument supplied for foreach() in /my/path/to/drupal/includes/form.inc on line 655

Please could you tell me what might cause this?

I have not made the changes in store.module or cart.module yet as requested by the installation instructions. I didn't think adding new products touched that part of the code when adding products.

I have also tried it with and without parcel.module and subproducts.module enabled (no difference).

Thanks in advance for your help.

Paul

alynner’s picture

I've looked through the code and there are only a couple places that I use foreach (when saving, viewing, or listing in the invoice) so your error isn't really making sense to me. Does it happen when you first open the page to create a product, or does it happen when you submit? I could only see it happening maybe when you submit if you don't enter anything in the options.

This module just requires the tangible module, it doesn't rely on subproducts or parcel.

I'm not sure if this module will fit your needs as is because the options consist of existing products, they aren't quite as dynamic as the javascript that you mentioned, but you may be able to modify it to suit your needs.

Just a note, the existing products used for options don't have to be published - this is how I have done sizes, so they don't show up in the main product page.

If you have any more info or insite into the error you are getting, I'd be happy to see if I can figure out what is going on.

cheers
alynner

darren oh’s picture

Subscribing.

brmassa’s picture

Status: Needs review » Fixed

Guys,

these errors were fixed on eC4.

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)
daddison’s picture

I'm trying to get this to work on an old installation of 4.7 (though I'd rather have it for 5.x). Where are the instructions for creating the tables ec_product_dynamic_parcel and ec_product_dynamic referenced in the module?

And are there any plans to port the code to newer versions of Drupal? I'm willing to help with that.

weedoo’s picture

Trying to convert to 5.34

weedoo’s picture

Status: Closed (fixed) » Active
weedoo’s picture

Assigned: Unassigned » weedoo
BobbyDigital’s picture

Category: task » support

does this work with files? I know the regular parcel module doesn't... I was hoping this might be able to handle that.

oldrobb’s picture

Did you succeed in making a 5.x version? I'd find that very useful as I hadn't realised that Parcel wouldn't fullly support Subproduct...

gordon’s picture

Status: Active » Closed (won't fix)