Shopping cart pass specific file in sale

Developer Networks
Developer Networks
@developer-networks
5 years ago
566 posts
I have items in my module with three different download options. Small medium and large files to download. I am able to pass the prices to the shopping cart but how do I pass the individual downloadable file during the sale?

well call this module coffee with small medium and large cups available for download.

   <a href="" onclick="jrPayment_add_to_cart('myCoffee','{$item._item_id}','coffee_small_price')">{jrCore_icon icon="cart"}{$item.coffee_small_price}</a>

I need to allow only the small coffee file in this item during this sale.

How would I pass that to the shopping cart as well?

small_coffee.zip
medium_coffee.zip
large_coffee.zip are all uploaded to the item.

During this sale I am trying to pass small_coffee.zip file only and contain the sale to only allow small_coffee.zip download.


updated by @developer-networks: 11/20/19 04:27:11AM
brian
@brian
5 years ago
10,148 posts
This isn't how you want to go about this - you would want 3 items - one for small/medium/large. Each can then have its own file and price.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 08/07/19 11:34:59AM
Developer Networks
Developer Networks
@developer-networks
5 years ago
566 posts
I see what your saying but not really because if my module was selling Tshirts lets say and depending on the size selected the end user would pay a different price for size and also would recieve a different downloadable file based on selection then quickly run in to this problem.

Since my module has multiple different downloadable files uploaded to the item and depending on the sale there is a problem if I followed your example. It would plague the shopping catalog list with different versions of the same item.

If i had to upload an item of the same Tshirt for every single different size for each file download the end users would have to sort the list through 25 different versions of the same shirt. To simplify their shopping experience I need to be able to just pass specific files related to the item sold to deliver the variable file options for the item just like other online markets do.

I was hoping you would say passing something like this would do it.

<a href="" onclick="jrPayment_add_to_cart('myCoffee','{$item._item_id}','coffee_small_price','small_coffee.zip', )">{jrCore_icon icon="cart"}{$item.coffee_small_price}</a>


Im able to get the shopping cart sale to show the small coffee in the sale or large coffee based on selection with my module during sale but how can I associate that properly so the right downloadable file is passed or included in the sale here. All three files are uploaded to the item and based on the version purchased i am trying to allow only the end user only access to the correct downloadable file.
updated by @developer-networks: 08/07/19 10:44:38PM
paul
@paul
5 years ago
4,331 posts
Actually, there is the means within the Product module to set up product variations such as tee-shirt or coffee sizes, but that module is for selling 'tangible' items and not downloads.
What you might need to do for downloads is to create each downloadable variable as seperate items, then customise the detail template to group them all (maybe by a custom form field with a group ID in it) to show all options on the same page.
hth


--
Paul Asher - JR Developer and System Import Specialist

Tags