Hope I'm in the right section for this
My problem is simply one of aesthetics, I am offering digital downloads in several file formats. For each purchase customers will have the availability of six (6) different file extensions; epub, mobi, pdf etc. That mean if someone purchases 6 items their download list will consist of 36 items, which could be a bit confusing as each download "stacks" one upon the other.
What I was hoping to do would be grouping each download by "ID" in it's own separate "block" (Table).
In the account/download.tpl it currently calls for "foreach ($downloads as $download)" and then it sets out the table structure.
I'm hoping to find a way to call for each download by "ID" so that the end result would be a separate table structure for each "ID".
I comfortable creating/adjusting the table structures, just not sure how (or if it's possible) to call by ID.
Any thoughts would be appreciated
v 2.3.0.2
My problem is simply one of aesthetics, I am offering digital downloads in several file formats. For each purchase customers will have the availability of six (6) different file extensions; epub, mobi, pdf etc. That mean if someone purchases 6 items their download list will consist of 36 items, which could be a bit confusing as each download "stacks" one upon the other.
What I was hoping to do would be grouping each download by "ID" in it's own separate "block" (Table).
In the account/download.tpl it currently calls for "foreach ($downloads as $download)" and then it sets out the table structure.
I'm hoping to find a way to call for each download by "ID" so that the end result would be a separate table structure for each "ID".
I comfortable creating/adjusting the table structures, just not sure how (or if it's possible) to call by ID.
Any thoughts would be appreciated
v 2.3.0.2
Hi,
If bundling them in one zip won't do you could create an array from all the downloads where the keys are the product_id and the downloads an array on each product_id
Now it's a matter of looping and create a new table when a new product_id is coming up; the rows being the downloads on that key.
Hope it makes sense
fake code idea:
$bundles = [];
foreach downloads as download
$bundles[download['product_id'] = download;
unset downloads,download
foreach bundles as product=>downloads
<table>
foreach downloads as download
<tr>
<td>echo download['???']
<td>...
If bundling them in one zip won't do you could create an array from all the downloads where the keys are the product_id and the downloads an array on each product_id
Now it's a matter of looping and create a new table when a new product_id is coming up; the rows being the downloads on that key.
Hope it makes sense
fake code idea:
$bundles = [];
foreach downloads as download
$bundles[download['product_id'] = download;
unset downloads,download
foreach bundles as product=>downloads
<table>
foreach downloads as download
<tr>
<td>echo download['???']
<td>...
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Appreciate the response
Zipping the files together isn't an option as the files are fair sized and theoretically the customer will only need one of them. The idea is of offering options for compatibility with various devices but I don't want them to have to choose prior to purchase so if there is a problem of compatibility they'd have ten days to come back and download a different version.
I believe your idea will answer my needs,
but as php isn't my native language I'm still a little lost ;(
Can anyone refine this for me?
Zipping the files together isn't an option as the files are fair sized and theoretically the customer will only need one of them. The idea is of offering options for compatibility with various devices but I don't want them to have to choose prior to purchase so if there is a problem of compatibility they'd have ten days to come back and download a different version.
I believe your idea will answer my needs,
but as php isn't my native language I'm still a little lost ;(
Can anyone refine this for me?
I understand the need, I happen to be an ebook creator as well.
What's your oc version and what do you want to group on? product or order?
What's your oc version and what do you want to group on? product or order?
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Hello and thank you for the interest in my problem,
I'm using oc v 2.3.0.2
Must admit your question had me thinking
Likely "product" would be the way to go as I have the six file extensions listed under "downloads" in the product listing under the one common name.
I'm using oc v 2.3.0.2
Must admit your question had me thinking
Likely "product" would be the way to go as I have the six file extensions listed under "downloads" in the product listing under the one common name.
Here you go.
Not extensively tested as I don't have too many orders with downloads on my demo. Let me know if all works out.
Group Downloads
Displays a table for all downloads attached to the product(s) in an order.
Change product_id to order_id to group on orders. Find below line in the ocmod.xml to do just that
<add position="replace"><!--[CDATA[$data['downloads'][$result['product_id']][] = array(]]--></add>
Not extensively tested as I don't have too many orders with downloads on my demo. Let me know if all works out.
Group Downloads
Displays a table for all downloads attached to the product(s) in an order.
Change product_id to order_id to group on orders. Find below line in the ocmod.xml to do just that
<add position="replace"><!--[CDATA[$data['downloads'][$result['product_id']][] = array(]]--></add>
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Apologies!
Just after you provided that mod and I installed it then realizing I needed more products to test it properly...
unexpected house guests knocked on the door and stayed for two weeks.
I have just now properly tested it and it works great!
With 7 download options for each product it will help to clean up the very long "downloads" list created by buying multiple products.
Many Thanks!!!
Just after you provided that mod and I installed it then realizing I needed more products to test it properly...
unexpected house guests knocked on the door and stayed for two weeks.
I have just now properly tested it and it works great!
With 7 download options for each product it will help to clean up the very long "downloads" list created by buying multiple products.
Many Thanks!!!
Who is online
Users browsing this forum: No registered users and 48 guests