Hi Everyone,
Please forgive me if this is posted in the wrong place, I am new to this Forum.
Can anyone tell me if it is possible to display "Points Earned" in a customers account overview page? I cannot seem to find anywhere to show this. I need our customers to be able to see at a glance when they log in, how many points they have earned. OC version 1.5.5.1
TIA
In more recent OC versions, this has been added already. In your catalog/model/account/customer.php file, see if you have this method:
If not, you'll need to add it in.
Then, in your catalog/controller/account/account.php file, you'll need to add this line before the end of the index() method:
Then, in your catalog/language/account/account.php file, add at the bottom:
Then, in your catalog/view/theme/<your_theme>/template/account/account.tpl file,
add:
Where you see fit.
Code: Select all
public function getRewardTotal($customer_id) {
$query = $this->db->query("SELECT SUM(points) AS total FROM " . DB_PREFIX . "customer_reward WHERE customer_id = '" . (int)$customer_id . "'");
return $query->row['total'];
}
Then, in your catalog/controller/account/account.php file, you'll need to add this line before the end of the index() method:
Code: Select all
$this->data['reward'] = $this->url->link('account/reward', '', true);
$this->data['text_reward'] = $this->language->get('text_reward');
Code: Select all
$_['text_reward'] = 'Your Reward Points';
add:
Code: Select all
<?php if ($reward) { ?>
<?php echo $text_reward; ?>: <?php echo $reward; ?>
<?php } ?>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi Straighlight,
Thank you for the reply, I will look into doing this.
Is there any other way,except for upgrading the OC version? Speaking of upgrading, how easy or difficult would it be to upgrade the OC ver? And do you have to do it progressively, or will one upgrade cover all?
Much appreciated.
emanjackson
Thank you for the reply, I will look into doing this.
Is there any other way,except for upgrading the OC version? Speaking of upgrading, how easy or difficult would it be to upgrade the OC ver? And do you have to do it progressively, or will one upgrade cover all?
Much appreciated.
emanjackson
FAQ: viewtopic.php?f=176&p=739789#p730051Is there any other way,except for upgrading the OC version? Speaking of upgrading, how easy or difficult would it be to upgrade the OC ver? And do you have to do it progressively, or will one upgrade cover all?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 3 guests