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
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
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.johnp wrote: ↑Tue Dec 11, 2018 6:52 amAre you confusing transactions with order history?
viewtopic.php?t=39175
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
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
Ernie
---
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.
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
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
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
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>
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.
Users browsing this forum: No registered users and 312 guests