Post by codex73 » Fri May 06, 2011 5:36 am

Version 1.4.9.4

I've happen to come across this odd behaviur:

I changed under SYSTEM/SETTINGS/OPTION/

Download Order Status:

from 'Completed' to 'Pending'

Reason is because digital downloads could be allowed download when order is mark pending.

The bug i belive of confusion comes because I would have guess the code looked at status 'pending' or higher based on text description of option "Set the order status the customers order must reach before they are allowed to access their downloadable products.".

It's not this way, so if this option set to 'pending' the downloads will be only available on that status type not above, let's say when order was marked shipped or completed (multiple items).

Is there an easy fix for this or solution in the mix?

New member

Posts

Joined
Wed Oct 28, 2009 1:53 am

Post by Daniel » Fri May 06, 2011 11:52 pm

this is not a bug. just the way you think something should work.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by fido-x » Sat May 07, 2011 12:05 am

For digital downloads, set your "Order Status" to "Pending", set your "Download Order Status" to "Complete" and set your payment method's "Order Status Completed" (eg. in PayPal Standard) to "Complete". When the return from PayPal (or whichever payment gateway you're using) returns a "Completed" value, your customers can access their downloads.

Your problem occurs because your payment gateway is returning a "Completed" value which does not match the value you have set for your "Download Order Status". Make sure that the are set to the same value.

Giving your customers the ability to download your product before the payment is completed, allows them the opportunity to cancel the payment after getting their download.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by codex73 » Sat May 07, 2011 12:34 am

Thank You Fido for the helpful answer. Now the problem maybe I'm not explaining. I agree with Daniel, it might not be a bug but possibly an issue to consider, being the reason I bring it to attention.

I understand how it works; I’ll try to explain differently the issue.

We mark orders pending on all payment types as we like to confirm funds availability and or process first. That being said the download is available as long as the option in question is set to 'Pending', that it's not a problem.

The problem is that once the staff manually changes a order to 'Completed' the download disappears (no longer available) for the client.

To counter Daniel's comment: "Wouldn’t it be of logical sense NOT remove the download from an order when the status is changed manually a higher value :: "Completed, Shipped, and Processed"?

Fido's comments make sense, now the issue is more of a status priority one. I also agree with Fido's on not allowing download until payment is completed, but in this case it's needed and low risk.

Thoughts?

New member

Posts

Joined
Wed Oct 28, 2009 1:53 am

Post by Daniel » Sat May 07, 2011 12:50 am

there should be one order status that all orders eventually become which is complete.

I'm not messing around implementing a sort order system for order statuses.

A digital download will be pending and then complete. I can not see any other situation. digital downloads do not need to be shipped and even if you allowed a digital download to be downloaded and sent a cd ou they you would allow the download to download while the status was set to shipped.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by codex73 » Sat May 07, 2011 1:38 am

Daniel, You still haven't understood the point or needs.

Here's it goes again.

The cart option you included says this:
Download Order Status:
"Set the order status the customers order must reach before they are allowed to access their downloadable products."

IF the above option is set to "Pending" to meet the seller policy and needs, it works good with the minor problem that when the order get's updated to 'Completed' the download get's removed from their account.

IF that is not a BUG, what is it? Why remove the download from an order when it's completed? Doesn't make any sense.

A very simple solution and suggestion will be to allow multiple statuses download availabilities, this will patch the problem instead of changing it's intended functionality.

Download Order Status:
"Set the order statuses the customers order must reach before they are allowed to access their downloadable products."

Otherwise, the above option makes not sense in having as only a status of 'Complete' will make sense having.

An order can contain multiple products, some of them being digital but maybe not all. In this particular sample:

**We need to allow Downloads upon Pending, but mark orders 'completed' manually.***

One more time problem:: ""Download disapears from oders if the above option is set to 'Pending' and order is then changed to 'Completed'....

As a clarification, your not wasting time, your trying to understand user needs and why all the above makes sense.

I'm a developer myself and I will love to have the same type of critizizimg on my projects.

Fantastic work you do. Hope it makes sense now. It's an easy fix.

New member

Posts

Joined
Wed Oct 28, 2009 1:53 am

Post by Qphoria » Sat May 07, 2011 3:49 am

I disagree with Daniel on this one.

This is a long time limitation that I plan on fixing.

The way it is now, you cannot sell both tangible and downloadable products from your store at the same time because they have different statuses.

If I sell ONLY digital products on my site, I would have my default status in the payment module as "Complete"

If I sell ONLY tangible products on my site, I still have to ship it. So I would set my default order status to "Processing", then after shipping it set it to "Shipped" or "Complete"

But if I sell both digital and tangible, I have to set my default payment module order status to "Processing" since complete wouldn't make sense for tangible items. Then I would have to set the "allowed download" status as "Processing". But then I can never change my digital order to "Completed" because it only supports a single status. So reporting is difficult since I can't filter on one order state. (Technically the report also needs to support multiple filter states)

There are 2 possible fixes...
Option One, update every single payment extension to have its own digital order status. That's not going to happen unless we properly move the order status to the extension controller instead of each individual payment.

Option Two, update the setting for download status to be a multiselect so that more than one state can be used for allowed download status. Then you can have downloads allowed for "Processing" AND "Completed". This is the fix I plan on making.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by paul133 » Sat May 28, 2011 7:22 pm

Hi.

We have the same issue.
We have a physical product that also has downloads.
So when payment is complete it works.
We have a label manager that sets the order status to Shipped once product have been sent but this then makes the downloads disappear.
I think the problem is more of a conceptual one. That is to say the Order PAYMENT status is a separate thing to the ITEM delivery status.

As a workaround we have modified a bit of code in catalog/model/account/download.php

All the code that read:
AND o.order_status_id = '" . (int)$this->config->get('config_download_status') . "'

NOW READS
AND ( o.order_status_id = '" . (int)$this->config->get('config_download_status') . "' OR o.order_status_id = '3' )

Not a very elegant solution to hard code the status like this!

Regards
Paul

Newbie

Posts

Joined
Wed Apr 13, 2011 9:52 pm

Post by codex73 » Tue Jun 21, 2011 8:59 am

Paul,

Your workaround did the trick. I appreciate it a lot!

Thank You

New member

Posts

Joined
Wed Oct 28, 2009 1:53 am

Post by amdev » Tue Jun 21, 2011 6:53 pm

paul133 wrote:Hi.

We have the same issue.
We have a physical product that also has downloads.
So when payment is complete it works.
We have a label manager that sets the order status to Shipped once product have been sent but this then makes the downloads disappear.
I think the problem is more of a conceptual one. That is to say the Order PAYMENT status is a separate thing to the ITEM delivery status.

As a workaround we have modified a bit of code in catalog/model/account/download.php

All the code that read:
AND o.order_status_id = '" . (int)$this->config->get('config_download_status') . "'

NOW READS
AND ( o.order_status_id = '" . (int)$this->config->get('config_download_status') . "' OR o.order_status_id = '3' )

Not a very elegant solution to hard code the status like this!

Regards
Paul
Many Thanks.

ร้านค้าออนไลน์
OpenCart Thailand Support Forum
How to Upgrade oc1.5 to 2.0.1.1
Upgrading OpenCart From v.1.4 or v.1.5 to V.2.2 Step by step


User avatar
Active Member

Posts

Joined
Fri Nov 27, 2009 3:40 pm
Location - Bangkok - Thailand

Post by lair12 » Mon Jul 04, 2011 12:13 pm

I just sell dwonload sheet music. My issue is that the completed download do NOT seem to go away from the Account->Download screen, even when there are none remaining. What setting will cause these to go away? It shows zero remaining and the download button does not do anything, but I want these to just go away when the last remaining download is done.

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by allenshea » Mon Jul 04, 2011 12:29 pm

Qphoria wrote: Option Two, update the setting for download status to be a multiselect so that more than one state can be used for allowed download status. Then you can have downloads allowed for "Processing" AND "Completed". This is the fix I plan on making.

Really happy to hear that, hope can release it soon.

Best Regards!

Allen

I know nothing about PHP and SQL, but I still try my best to understand it.


Active Member

Posts

Joined
Mon Dec 14, 2009 10:01 pm

Post by lair12 » Mon Jul 04, 2011 1:16 pm

I don't understand why this is needed, but putting ... AND od.remaining > '0' ... in the code below seems to make this function as it should. I still feel that I am missing something and that this process should already be automatically excluding completed downloads from the download list, otherwise it is very confusing to the buyer.

Code: Select all

$query = $this->db->query("SELECT o.order_id, o.date_added, od.order_download_id, od.name, od.filename, od.remaining FROM " . DB_PREFIX . "order_download od LEFT JOIN `" . DB_PREFIX . "order` o ON (od.order_id = o.order_id) WHERE o.customer_id = '" . (int)$this->customer->getId() . "' AND o.order_status_id > '0'                  AND od.remaining > '0'              AND o.order_status_id = '" . (int)$this->config->get('config_complete_status_id') . "' ORDER BY o.date_added DESC LIMIT " . (int)$start . "," . (int)$limit);

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by tyjthomas » Tue Mar 27, 2012 7:25 am

paul133 wrote: As a workaround we have modified a bit of code in catalog/model/account/download.php

All the code that read:
AND o.order_status_id = '" . (int)$this->config->get('config_download_status') . "'

NOW READS
AND ( o.order_status_id = '" . (int)$this->config->get('config_download_status') . "' OR o.order_status_id = '3' )

Not a very elegant solution to hard code the status like this!
This has done exactly what I needed up until 1.5.2. Download.php has been changed in 1.5.2 - Does anyone by chance have any updated code to work around this issue?

New member

Posts

Joined
Sun Apr 03, 2011 10:15 pm

Post by tyjthomas » Tue Mar 27, 2012 7:33 am

tyjthomas wrote:
paul133 wrote: As a workaround we have modified a bit of code in catalog/model/account/download.php

All the code that read:
AND o.order_status_id = '" . (int)$this->config->get('config_download_status') . "'

NOW READS
AND ( o.order_status_id = '" . (int)$this->config->get('config_download_status') . "' OR o.order_status_id = '3' )

Not a very elegant solution to hard code the status like this!
This has done exactly what I needed up until 1.5.2. Download.php has been changed in 1.5.2 - Does anyone by chance have any updated code to work around this issue?
I actually got it figured out. For others wondering:

All the code that read:
AND o.order_status_id = '" . (int)$this->config->get('config_complete_status_id') . "'

Now reads:
AND ( o.order_status_id = '" . (int)$this->config->get('config_complete_status_id') . "' OR o.order_status_id = '3' )

New member

Posts

Joined
Sun Apr 03, 2011 10:15 pm

Post by esprit1st » Sun Feb 17, 2013 8:09 am

Hi,

I had the same problem and came up with a little different solution. I hate to hardcode things, so I modified the sql-query as well, but used a configurable approach. So here is what I did:

Please note: This has been done in version 1.5.5.1

First I added a new config variable in mysql (use phpmyadmin). The "3,5,15" towards the end indicates the statuses that a download is downloadable with. Find statuses in "oc_order_status" table:

Code: Select all

INSERT INTO `oc_setting` (
`setting_id` ,
`store_id` ,
`group` ,
`key` ,
`value` ,
`serialized`
)
VALUES (
'2330', '0', 'user', 'user_complete_status_id', '3,5,15', '0'
);
then replace in "catalog/model/account/download.php":

Code: Select all

AND o.order_status_id = '" . (int)$this->config->get('config_complete_status_id') . "'
with

Code: Select all

AND FIND_IN_SET(o.order_status_id , '" . $this->config->get('user_complete_status_id') . "')
there should be 3 occurences.

Modifying the core isn't my favorite thing since you have to modify it every time after an update, but I have no idea how to do it otherwise ... :(

Newbie

Posts

Joined
Sun Feb 17, 2013 6:57 am

Post by jackbat » Tue Aug 06, 2013 11:27 pm

Has anyone found a mod for this. I really don't want to hack the code as it is a hassle moving forward remembering all the hacks that were done.

I like others have products which have both downloads and physical products so when it is set to shipped, the downloads go away.

Newbie

Posts

Joined
Wed Feb 13, 2013 4:24 am

Post by jackbat » Thu Oct 24, 2013 11:34 pm

I want to try one more time with this one.

Daniel has apparently taken a hard line on this one, but as I can see from here and other places, I am not the only person with this problem.

It is confusing my customers to have to wait until the physical part of the order is shipped to see their downloads. We obviously use the completed to see the order was paid for and the shipped to see that we have shipped the order. It all seems very logical. What isn't logical is the fact that the downloads dissapear when we mark the order as shipped.

I really hate to hack code as it just gets to be a long list of items to deal with every time you update the software.

Has anyone seen a mod for this?

Thanks,,,,Jack

Newbie

Posts

Joined
Wed Feb 13, 2013 4:24 am

Post by deadlance » Sat Oct 26, 2013 12:27 am

I also am looking for a solution to this problem. I would like to see something to the effect of

order comes in, paid via authorize.net, set order status to "paid - unshipped" if the user wants a physical cd or "paid" if they want download only. The user may download their files with either status.

"paid - unshipped" status order gets shipped and changed to "complete"... the user may still download their files.

"paid" orders get changed to "complete" once an admin takes a look at them.

I actually need "paid", "paid - unshipped", and "completed" all to basically work exactly like "completed" because I have other extensions that rely on a status being set to complete. I just need to be able to discern whether or not we've shipped a product physically or not.

New member

Posts

Joined
Wed Jun 19, 2013 11:36 pm

Post by jackbat » Sat Oct 26, 2013 4:41 am

The logical way to solve this ( and I would imagine simply) is to allow multiple checks for status for download availability so that people can choose whatever combination of statuses they want. This is obviously a problem for anyone who has downloadable materials with a physical product.

Newbie

Posts

Joined
Wed Feb 13, 2013 4:24 am
Who is online

Users browsing this forum: No registered users and 19 guests