Cart Made SImple - Add billing info

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Bert
New Member
New Member
Posts: 6
Joined: Fri Jun 09, 2006 7:36 pm

Cart Made SImple - Add billing info

Post by Bert »

Hello,

I've been using CMS for a few years now, and recently developped a website using Shop made Simple, Cart Made Simple and Payment Made Simple.

I'm having the following problem.

I would like to add 2 variables to the Billing info:
-$billname: billing name (name of the company to be invoiced)
-$billvat: billing VAT (VAT number of the company to be invoiced)

I added the following code to action.orderaddress.php:

Code: Select all

		if (isset($params['billname']) && $params['billname'] == '')
		{
			$billname = $params['lastname'];
		} else {
			$billname = $params['billname'];
		}
		
		if (isset($params['billvat']) && $params['billvat'] == '')
		{
			$billvat = 'pas de TVA';
		} else {
			$billvat = $params['billvat'];
		}
and

Code: Select all

$this->smarty->assign('billname_label', $this->Lang('billname_label'));
$this->smarty->assign('billname_input', $this->CreateInputText($id, 'billname', $billname, 40, 40));
$this->smarty->assign('billvat_label', $this->Lang('billvat_label'));
$this->smarty->assign('billvat_input', $this->CreateInputText($id, 'billvat', $billvat, 40, 40));
I added the following code to action.orderconfirm.php and to action.ordershowdetail.php:

Code: Select all

$this->smarty->assign('billtoname', $shipto['billname']);
$this->smarty->assign('billtovat', $shipto['billvat']);
In the language file I added:

Code: Select all

$lang['billname_label'] = 'Nom';
$lang['billvat_label'] = 'Numéro TVA';
Cart templates changed accordingly:
fe_shipping_info:

Code: Select all

<table id="billinfo" cellspacing="0" class="pagetable">
	<tr>
		<td class="shiplabel">{$billname_label}:</td>
		<td class="shipinput">{$billname_input}</td>
	</tr>
	<tr>
		<td class="shiplabel">{$billvat_label}:</td>
		<td class="shipinput">{$billvat_input}</td>
	</tr>
fe_orderconfirm:

Code: Select all

<h4>{$billto_label}</h4>
<p>
{$billtoname}
{$billtovat}
The inputfields appear correctly in the first step of the orderform, but the two variables don't show the entered information in the order confirm step nor do they show up in the order detail view in the admin.

Am I missing something here? It seems the variables are not correctly saved, causing them not to show up in the confirmation and the detail view.

Thank you in advance fo any feedback.
Bert
Duketown

Re: Cart Made SImple - Add billing info

Post by Duketown »

Bert,

Nice to know that you are using 'my' modules.
I take it that you use the latest versions of the modules. Especially with regards to the bill to information. That is included in Cart Made Simple.
You have not described, that you made changes to the database. As a result, the entered information is not save and can not be retrieved from the order header information.

Is the intention of billname the name of the person who will get the bill? And is the billvat to hold the name of the vat company?

Duketown
Bert
New Member
New Member
Posts: 6
Joined: Fri Jun 09, 2006 7:36 pm

Re: Cart Made SImple - Add billing info

Post by Bert »

Hello Duketown,

Thank you for the reply.

I did not make any changes to the database. Could you tell me which table I have to change in order to have the data stored correctly?

For Cart Made Simple I'm not running the latest version. I'm running 0.2.5.

If I upgrade, won't this affect the changes I made already to some of the php files?

-billname is intended to hold the name of the person or more likely the company that has to be invoiced for the order
-billvat holds the VAT number for that person/company

If no billname is entered, the lastname of the shipto adress is used. If no billvat is entered that variable gets a predefined value such as 'no VAT number' (This works fine already, because of the changes to the action.orderaddress.php file )

The main reason for this addition is that I'm going to change the template that is send to alert the owner of the site a new order has been placed , to be an HTML invoice that can be printed and send together with the order. So that needs to have the name of the company/person and the VAT number.

Thanks in advance for your help.

Brgds,
Bert
Last edited by Bert on Wed Jan 13, 2010 9:13 pm, edited 1 time in total.
Duketown

Re: Cart Made SImple - Add billing info

Post by Duketown »

Bert,

Sorry when you change PHP you are on your 'own'. By that I mean, you knew that making changes would make automatic updates impossible. You will have to reapply the changes that I made with a svn program that is not all that hard. While you are updating etc. Please check the class orders.api.php. This file contains all definitions of tables. Another way would be to open phpMyAdmin.

Succes,

Duketown
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Cart Made SImple - Add billing info

Post by thomahawk »

Bert, did you solve this problem? I have the same thing - need to add Billing name in ShopMadeSimple 0.2.6. Where in mySQL did you change/add the necessary entry? I have done all the php changes, but missing the database change.

Thomas
Post Reply

Return to “Modules/Add-Ons”