I needed a sub-product solution for file product (ec3), so i hacked the subproduct and file module. Attached please find the needed patches (minor changes).

Comments

esadot’s picture

StatusFileSize
new4.69 KB
new4.81 KB

After playing with it for a while I realized that a few features, that are currently missing, could have made my life much easier. So I decided to give it a try, and incorporate those features. All features are configurable (admin/ecsettings/subproducts under advanced), and disabled by default, which means that they do not change the module behavior unless turned on.

1. File Product Friendly: File subproduct, by definition, implies different file per variation, hence I added the ability to change file-subproduct name and price during subproduct creation.
2. Invisible Subproducts: Make subproducts invisible (also unpublished) to the user (i.e. in taxonomy, search results, etc.). Purchased could only be done via parent product.
3. Add Price to Options: Add price to subproduct drop down menu options. Goes hand in hand with Invisible Subproducts.

Hope it helps

esadot’s picture

StatusFileSize
new4.7 KB

Found a petit bug, herein the fix

Phillip Mc’s picture

thanks for posting this.

this patch sounds very interesting. Am I right in thinking that this patch allows you to sell the same video download, for example, in varying formats? for example

iphone/itouch/mobile quality - 0.99
mpeg medium quality - 1.50
high quality mpeg - 1.99

Where the three different files are attached to the same file product?

any chance of posting a link of the module in action?

Phillip Mc’s picture

great patch. thanks.

quick question. how did you get the price for the subproducts showing in your FORMAT drop down list?

http://noonoole.com/content/bee-flower-1

esadot’s picture

Try adding next line to your theme
print_r($node->content['subproduct_options']['#value']);

Phillip Mc’s picture

HI esadot,

thanks but can u be a bit more specific where in my theme I should add that? e.g. is there a theme override I can use?

esadot’s picture

np, in your theme, add it into node.tpl.php or node-<node type, like video, music, etc.>.tpl.php (i.e. node-video.tpl.php)

To get a sense of it you can try garland, for instance, and in node.tpl.php change: <div class="content"> <?php print $content

to: <div class="content"> print_r($node->content['subproduct_options']['#value']); </div>

Phillip Mc’s picture

I noticed a snag with this patch...

When you purchase multiple subproducts, only one shows up on the MY FILES page.

In other words, if there are 10 videos on sale...with different formats for each video and I order the .MOV version of each video...everything works fine until I get to the MY FILES page, where it only displays 1 file for download.

It seems the other purchased files aren't being picked up.

Phillip Mc’s picture

Status: Active » Closed (fixed)

my bad. I must have mucked up my drupal ecommerce installation.

I just tried the patch again with a fresh install of drupal and a fresh install of Drupal eCommerce version 3.-dev with this patch applied and it worked.

It's a great patch esadot. Thanks for sharing it.