Post by alex067 » Thu Sep 07, 2017 1:08 pm

Heya guys. I have a problem where on the account > download page, it will show every product the user bought (they are downloadable products) instead of only showing 10 per page!

On the bottom right, it will successfully calculate how many pages there should be, but the limiter is not working.

I've attached my account > download.php script, since that's the only one that I've changed. the model & template file remains the same from the default.

I know the issue is in the pagination somewhere, but I can't figure it out!

New member

Posts

Joined
Wed Jul 12, 2017 9:50 am

Post by DigitCart » Thu Sep 07, 2017 2:09 pm

Hello,
Which OpenCart version do you use?

My Extensions / DigitCart


User avatar
Active Member
Online

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by alex067 » Thu Sep 07, 2017 2:21 pm

Version 3! thanks

New member

Posts

Joined
Wed Jul 12, 2017 9:50 am

Post by DigitCart » Thu Sep 07, 2017 3:17 pm

You didn't use getDownloads function.
Try this:

Code: Select all

$start = ($page - 1) * $this->config->get('theme_' . $this->config->get('config_theme') . '_product_limit');
$limit = $this->config->get('theme_' . $this->config->get('config_theme') . '_product_limit');
$query = $this->db->query("SELECT * FROM oc_customer_ohistory WHERE CID = '$id' ORDER BY OID DESC  LIMIT " . (int)$start . "," . (int)$limit);
Instead of your own query:

Code: Select all

$query = $this->db->query("SELECT * FROM oc_customer_ohistory WHERE CID = '$id' ORDER BY OID DESC");

My Extensions / DigitCart


User avatar
Active Member
Online

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by alex067 » Thu Sep 07, 2017 3:39 pm

ahh thank you man, youre awesome

New member

Posts

Joined
Wed Jul 12, 2017 9:50 am

Post by DigitCart » Thu Sep 07, 2017 3:42 pm

You're welcome.

My Extensions / DigitCart


User avatar
Active Member
Online

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by mazlie » Sat Dec 07, 2019 6:05 pm

Can you share the changed file? Because I'm facing the same issue

Newbie

Posts

Joined
Tue Apr 09, 2013 11:17 am
Who is online

Users browsing this forum: No registered users and 13 guests