Attachments
4.JPG (15.48 KiB) Viewed 4851 times
3.JPG (38.22 KiB) Viewed 4851 times
2.JPG (59 KiB) Viewed 4851 times
https://github.com/opencart/opencart/bl ... hp#L21-L45
Code: Select all
$order_statuses = $this->config->get('config_complete_status');
In other words, its looking to only show downloads when a order status is "complete".
Check your payment module settings and see if the order status is set to the complete status you have set in the store settings. If it's not then they most likely won't show up.
Might be the issue or might not.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Thanks a lot for your help and I did find it set to canceled and I have changed it to complete like you recommended but I keep getting nothing.sw!tch wrote: ↑Sun May 20, 2018 10:01 amIf you look at the model for download.php.
https://github.com/opencart/opencart/bl ... hp#L21-L45
^ Note this line.Code: Select all
$order_statuses = $this->config->get('config_complete_status');
In other words, its looking to only show downloads when a order status is "complete".
Check your payment module settings and see if the order status is set to the complete status you have set in the store settings. If it's not then they most likely won't show up.
Might be the issue or might not.
and this is my code in the download.php
Code: Select all
<?php
class ModelAccountDownload extends Model {
public function getDownload($download_id) {
$implode = array();
$order_statuses = $this->config->get('config_complete_status');
foreach ($order_statuses as $order_status_id) {
$implode[] = "o.order_status_id = '" . (int)$order_status_id . "'";
}
if ($implode) {
$query = $this->db->query("SELECT d.filename, d.mask FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "order_product op ON (o.order_id = op.order_id) LEFT JOIN " . DB_PREFIX . "product_to_download p2d ON (op.product_id = p2d.product_id) LEFT JOIN " . DB_PREFIX . "download d ON (p2d.download_id = d.download_id) WHERE o.customer_id = '" . (int)$this->customer->getId() . "' AND (" . implode(" OR ", $implode) . ") AND d.download_id = '" . (int)$download_id . "'");
return $query->row;
} else {
return;
}
}
public function getDownloads($start = 0, $limit = 20) {
if ($start < 0) {
$start = 0;
}
if ($limit < 1) {
$limit = 20;
}
$implode = array();
$order_statuses = $this->config->get('config_complete_status');
foreach ($order_statuses as $order_status_id) {
$implode[] = "o.order_status_id = '" . (int)$order_status_id . "'";
}
if ($implode) {
$query = $this->db->query("SELECT DISTINCT d.download_id, o.order_id, o.date_added, dd.name, d.filename FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "order_product op ON (o.order_id = op.order_id) LEFT JOIN " . DB_PREFIX . "product_to_download p2d ON (op.product_id = p2d.product_id) LEFT JOIN " . DB_PREFIX . "download d ON (p2d.download_id = d.download_id) LEFT JOIN " . DB_PREFIX . "download_description dd ON (d.download_id = dd.download_id) WHERE o.customer_id = '" . (int)$this->customer->getId() . "' AND dd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND (" . implode(" OR ", $implode) . ") ORDER BY o.date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
return $query->rows;
} else {
return array();
}
}
public function getTotalDownloads() {
$implode = array();
$order_statuses = $this->config->get('config_complete_status');
foreach ($order_statuses as $order_status_id) {
$implode[] = "o.order_status_id = '" . (int)$order_status_id . "'";
}
if ($implode) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "order_product op ON (o.order_id = op.order_id) LEFT JOIN " . DB_PREFIX . "product_to_download p2d ON (op.product_id = p2d.product_id) WHERE o.customer_id = '" . (int)$this->customer->getId() . "' AND (" . implode(" OR ", $implode) . ")");
return $query->row['total'];
} else {
return 0;
}
}
}
If you updated the payment module to a complete status, that won't actually do anything to existing orders. You would need to run through with another test order.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Hi sw!tch it did work thanks for you support . But this is not going to solve the problem going to the admin page and adding free download.sw!tch wrote: ↑Mon May 21, 2018 12:58 amThe only thing I can suggest is going to one of your free orders and add an order history of complete. Then login to the account and see if the download shows.
If you updated the payment module to a complete status, that won't actually do anything to existing orders. You would need to run through with another test order.
As I posted above - as long as you properly link a download (like @cyclops12 has shown ) and set your payment module to a complete status, it should work fine. Thats what the code says, so something on your end isn't setup correct.
Edit:
Looking at the code for the free checkout module it looks like it has some bugs on the variables, so this may be your problem.
catalog....free_checkout.php
Code: Select all
$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('payment_free_checkout_order_status_id'));
Apparently there is already a fix for this, you may want to try below.
viewtopic.php?t=192113
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
i have also this problem , i enable the free checkout module and it works on website but the download file don't go to download page of user.
i checked my module and understand when i setting the status of that to "Complete" and save it , it doesn't set on complete and again it back to "canceled "
many times i change the status to "Complete" and save it but when i check it again it going back to "canceled"
Can some help me about this ?
Did you read what I posted above?S.M.T.F wrote: ↑Sat May 26, 2018 1:00 amhello everyone
i have also this problem , i enable the free checkout module and it works on website but the download file don't go to download page of user.
i checked my module and understand when i setting the status of that to "Complete" and save it , it doesn't set on complete and again it back to "canceled "
many times i change the status to "Complete" and save it but when i check it again it going back to "canceled"
Can some help me about this ?
Apparently there is already a fix for this, you may want to try below.
viewtopic.php?t=192113
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
yeah i said there i can't understand what i must to do exactly in second actionsw!tch wrote: ↑Sat May 26, 2018 1:09 amDid you read what I posted above?S.M.T.F wrote: ↑Sat May 26, 2018 1:00 amhello everyone
i have also this problem , i enable the free checkout module and it works on website but the download file don't go to download page of user.
i checked my module and understand when i setting the status of that to "Complete" and save it , it doesn't set on complete and again it back to "canceled "
many times i change the status to "Complete" and save it but when i check it again it going back to "canceled"
Can some help me about this ?
Apparently there is already a fix for this, you may want to try below.
viewtopic.php?t=192113
i did the first edits in first post on topic but still not working .
but unfortunately i can't understand second action they said there.
Make sure you Uninstall the free checkout payment module first.
Clear the OC cache when done.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Hello againsw!tch wrote: ↑Sat May 26, 2018 2:09 amJust follow the instructions on the first post - viewtopic.php?f=201&t=192113#p692020
Make sure you Uninstall the free checkout payment module first.
Clear the OC cache when done.
first i uninstall the free checkout and after that , i reload in the modification and also i did the clean the cache and also i open my admin page with "CTRL+F5"
after that i edit those 2 "free_checkout.php" and "free_checkout.twig" files.
and after that i install free checkout again but nothing changed
can you please tell what i do wrong in my steps ?
thanks
Did you clear the cache in the dashboard? You have to click the COG icon. Are the order statutes saving in the backend under free checkout? If not you didn't do something correct.S.M.T.F wrote: ↑Sat May 26, 2018 12:06 pmHello again
first i uninstall the free checkout and after that , i reload in the modification and also i did the clean the cache and also i open my admin page with "CTRL+F5"
after that i edit those 2 "free_checkout.php" and "free_checkout.twig" files.
and after that i install free checkout again but nothing changed
can you please tell what i do wrong in my steps ?
thanks
I just tested the fix with a downloadable file and having a completed status. it works fine.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
hello dear againsw!tch wrote: ↑Sat May 26, 2018 1:20 pmDid you clear the cache in the dashboard? You have to click the COG icon. Are the order statutes saving in the backend under free checkout? If not you didn't do something correct.S.M.T.F wrote: ↑Sat May 26, 2018 12:06 pmHello again
first i uninstall the free checkout and after that , i reload in the modification and also i did the clean the cache and also i open my admin page with "CTRL+F5"
after that i edit those 2 "free_checkout.php" and "free_checkout.twig" files.
and after that i install free checkout again but nothing changed
can you please tell what i do wrong in my steps ?
thanks
I just tested the fix with a downloadable file and having a completed status. it works fine.
can you please tell me how can clean the cache files ?
i try many many way but still not working.
sorry to bothering you.
To clear Twig cache:
In Admin panel dashboard there's a blue button with a cog icon (bellow Logout link), click on this button and then click on refresh button.
Users browsing this forum: Bing [Bot] and 78 guests