Post by cloverboy42 » Mon Mar 24, 2014 6:47 am

I want to be able to add a debt to a customer's account like the way I can add a credit (via Transactions under the Customer tab).

I run a service based business and occasionally upgrade the service package in the field. Being able to add a debt to the account would mean I wouldn't have to invoice these small amounts to the customer and they could just pay the difference on there next order.

I have tried just adding a negative Transaction (i.e. -$25.00) but it doesn't reflect in the checkout.

Is there a way to modify the transaction process to make this work, or an extension I can add to be able to accomplish this?

Newbie

Posts

Joined
Wed May 01, 2013 10:05 pm

Post by opcrat » Mon Mar 24, 2014 11:52 pm

For that you need to update line no 16 in catalog/model/total/credit.php file,

Code: Select all

if ($credit > 0) {
with

Code: Select all

if ($credit) {


And incase if you wants to change Credit name with Debit in the shopping cart then need to add one more text variable into catalog/language/total/credit.php

Code: Select all

$_['text_debit']   = 'Store Debit';
And update below lines of code in catalog/model/total/credit.php file,

Code: Select all

if ($credit > 0) {
					$total_data[] = array(
						'code'       => 'credit',
						'title'      => $this->language->get('text_credit'),
						'text'       => $this->currency->format(-$credit),
						'value'      => -$credit,
						'sort_order' => $this->config->get('credit_sort_order')
					);
					
					$total -= $credit;
				}
with

Code: Select all

if ($credit) {	
					if($credit > 0) {
					$title = $this->language->get('text_credit');
					} else {
					$title = $this->language->get('text_debit');	
					}
					$total_data[] = array(
						'code'       => 'credit',
						'title'      => $title,
						'text'       => $this->currency->format(-$credit),
						'value'      => -$credit,
						'sort_order' => $this->config->get('credit_sort_order')
					);
					
					$total -= $credit;
				}

Most Useful Extensions || Most Selling Extensions
Opencart Development || Opencart Designing || eCommerce Project

✔ Join more than 5000 Happy Opencart Store Owners enjoying the extensions designed and developed by Opcrat, Opencart Partner.


User avatar
Active Member

Posts

Joined
Wed Dec 21, 2011 6:54 am

Post by cloverboy42 » Tue Mar 25, 2014 12:22 am

Thanks for the help opcrat!

Newbie

Posts

Joined
Wed May 01, 2013 10:05 pm

Post by opcrat » Tue Mar 25, 2014 11:43 pm

You are welcome. If your issue is solved than please add solved in title of this topic so that others can understand from list that its already solved.

Most Useful Extensions || Most Selling Extensions
Opencart Development || Opencart Designing || eCommerce Project

✔ Join more than 5000 Happy Opencart Store Owners enjoying the extensions designed and developed by Opcrat, Opencart Partner.


User avatar
Active Member

Posts

Joined
Wed Dec 21, 2011 6:54 am
Who is online

Users browsing this forum: No registered users and 7 guests