Post by mkp007 » Tue Dec 11, 2018 6:48 am

My customers can not see any of their past transactions when the go to their account page. So I looked up the 'customer_transaction' table in the database and it was empty. Can someone tell me which file this table is supposed to be populated from? I imagine this occurs during the order confirmation process.

And why is a separate table needed to store these transactions? couldn't they just get called from the orders table?

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by johnp » Tue Dec 11, 2018 6:52 am

Are you confusing transactions with order history?

viewtopic.php?t=39175

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by mkp007 » Tue Dec 11, 2018 7:05 am

johnp wrote:
Tue Dec 11, 2018 6:52 am
Are you confusing transactions with order history?

viewtopic.php?t=39175
I maybe confusing it yes. So what are transactions. If you are a customer and go to your account page, you will see a "Your Transactions" link taking you to https://www.yoursite.com/account/transaction. I believe this calls the code from /catalog/model/account/transaction.php which queries the table "customer_transaction" and my table is empty. So now I'm confused.

Code: Select all

 <?php
class ModelAccountTransaction extends Model {	
	public function getTransactions($data = array()) {
		$sql = "SELECT * FROM `" . DB_PREFIX . "customer_transaction` WHERE customer_id = '" . (int)$this->customer->getId() . "'";
		   
		$sort_data = array(
			'amount',
			'description',
			'date_added'
		);
	
		if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
			$sql .= " ORDER BY " . $data['sort'];	
		} else {
			$sql .= " ORDER BY date_added";	
		}
			
		if (isset($data['order']) && ($data['order'] == 'DESC')) {
			$sql .= " DESC";

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by johnp » Tue Dec 11, 2018 7:59 am

The link I posted explains. :)

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by IP_CAM » Tue Dec 11, 2018 9:59 am

Good to know ! :)
Ernie
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by mkp007 » Wed Dec 12, 2018 3:08 am

John,

Thanks for the reply. I still don't get why my customer_transaction table would be empty. We have done store credit many many times. I guess I don't get what would be logged in that table anyways. I'll try not to over think this, just trying to close the loop.

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by johnp » Wed Dec 12, 2018 3:14 am

No probs. I'm sure someone will find the problem and post a solution. :)

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by mkp007 » Tue Dec 18, 2018 2:17 am

Anyone else think it is dumb that when you go to Sales -> Customers -> Customers and look up a customer and not be able to see their past orders. You only have a tab for "Transactions" which is stupid because it does not seem to do anything. The "History" tab doesn't seem to do anything either. Here are a few modules that seem to try to tackle this problem.

https://www.opencart.com/index.php?rout ... on_id=3292
https://www.opencart.com/index.php?rout ... n_id=14825
https://www.opencart.com/index.php?rout ... n_id=22923

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by IP_CAM » Tue Dec 18, 2018 4:40 am

Well, I am not sure, what you're talking about, but if you want to see the
Customer Purchases in your Admin, just use the Extension, linked below,
to make it work like shown on the Image below.
But the HISTORY Section is only, to leave internal Comments on an Order.
Good Luck!
Ernie
PS: To make use of all Extensions involved, I needed to implement everything
into the Source Files involved, exept for the Customer Purchases Extension,
just to have this mentioned too ... :-)

[FREE] Customer Purchases OC v.1.5.6.x:
https://www.opencart.com/index.php?rout ... n_id=15131
---
This is my (possibly slightly adapted) VqMod out of it:
admin_customer_purchases.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Customer Purchases]]></id>
<version><![CDATA[OS v.1.5.6.5]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<author><![CDATA[ecomteck.com]]></author>

<file name="admin/controller/sale/customer.php">
<operation error="abort">
<search position="after"><![CDATA[public function update() {]]></search>
<add><![CDATA[
	$this->language->load('eccustomerpurchases/order');
	$this->document->addScript('view/javascript/eccustomerpurchases/jquery.cookie.js');
]]></add>
</operation>
</file>

<file name="admin/view/template/sale/customer_form.tpl">
<operation  error="abort">
<search position="replace"><![CDATA[<a href="#tab-ip"><?php echo $tab_ip; ?></a></div>]]></search>
<add><![CDATA[
	<a href="#tab-ip"><?php echo $tab_ip; ?></a><?php if ($customer_id) { ?><a href="#tab-purchases"><i class="fa fa-sale fa-1x"></i><?php echo $this->language->get("tab_purchases"); ?></a><?php } ?></div>
]]></add>
</operation>

<operation  error="abort">
<search position="before"><![CDATA[<div id="tab-general">]]></search>
<add><![CDATA[
	<?php if($customer_id) { ?>
	<div id="tab-purchases">
	<?php  echo $this->getChild('eccustomerpurchases/order', array("customer_id"=>$customer_id)); ?>
	</div>
	<?php } ?>
]]></add>
</operation>
</file>
</modification>
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 192 guests