Additional firelds in order form/lists

Tata55

Avatar: Tata55

2018-05-17 22:16

Because of legislative requirements, it is necessary to have two more details to be added if the customer is a tax paying organisation (not a private person). These details are: OID (organisation identification number) and TPID (Tax Payer ID).
How can I make it working? I mean, what modifications shall be made, in which files?
It is pretty urgent to make it in test environment to get the customer ready to test the eshop and eventually to buy the licence.

» Quick.Cart v6.x

Tata55

openzibi

Avatar: openzibi

2018-05-17 23:03

You must start to do changes in default/order-step-2.php and some changes in core/order.php and database/_field.php and database/translations/en.php and style.css etc., etc.
Look at example on image and... look at Quick.Cart.Ext v6.7 version

https://www.studiostrona.pl/files/company_order_form.png

Zbyszek - StudioStrona.pl

Tata55

Avatar: Tata55

2018-05-18 16:34

Thank you for the hint. I have made MODs in:
1. order-step-2.php

...
<!-- MOD additional fields -->
              <fieldset class="inner">
              <div id="company">
                <label for="oCompany"><?php echo $lang['Company']; ?></label>
                <input type="text" name="sCompanyName" value="" maxlength="100" class="input" onblur="saveUserData( this.name, this.value )" id="oCompany"/>
              </div>
              <div id="company-ids">
                <label for="oCompany-ico"><?php echo $lang['Company-ico']; ?></label>
                <input type="text" name="sCompanyICO" value="" maxlength="20" class="input2" onblur="saveUserData( this.name, this.value )" id="oCompany-ico"/>
                <label for="oCompany-dic"><?php echo $lang['Company-dic']; ?></label>
                <input type="text" name="sCompanyDIC" value="" maxlength="20" class="input2" onblur="saveUserData( this.name, this.value )" id="oCompany-dic"/>
              </div>
              </fieldset>
<!-- MOD END -->
...


2. templates/admin/orders.php

...
            <td class="company"><?php echo $lang['Company']; ?></td>
<!-- MOD additional fields -->
            <td class="company"><?php echo $lang['Company-ico']; ?></td>
            <td class="company"><?php echo $lang['Company-dic']; ?></td>
<!-- MOD END -->
            <td class="date"><?php echo $lang['Date']; ?></td>
...


3. core/_fields.php

...
// /* MOD additional fields */
$aOrdersFields = Array( 'iOrder''sLanguage''iStatus''iTime''sFirstName''sLastName''sCompanyName''sCompanyICO''sCompanyDIC''sStreet''sZipCode''sCity''sPhone''sEmail' );
/* MOD END */
...


4. small adjustments in style.css
...
/* MOD additional fields */
fieldset.inner{
width: 92%;
box-sizing:border-box;
padding: .5rem;
border: 1px solid silver;
background: #fafafa;
}.input2{
width: 40%;
}
...
The result is nice built order form and table headdings in backend/orders. No values are transfered to the table, however. I also have not yet modify the email content (don't know how and where).
The result of my testing is at http://obchod.cmsimple.sk.
Closer hints highly appreciated.

Tata55

Tata55

Avatar: Tata55

2018-05-18 16:36

It would be also nice if the additional fields would show up and would be mandatory if a firm is defined.

Tata55

Tata55

Avatar: Tata55

2018-05-18 17:36

Now I see that the order_email is not saved while in configuration. :-(

openzibi

Avatar: openzibi

2018-05-18 20:15

I do not checked your code but I saw "core/_fields.php".
_fields.php must be in database folder, not in core folder.

Zbyszek - StudioStrona.pl

Tata55

Avatar: Tata55

2018-05-18 21:07

Ah,yes, of course. Here it's only misprint. It is in database of course. Thank you anyway. I made some progress since my last post. If interested, I can send the modified QC. Where can I find your contact?

Tata55

Avatar: Tata55

2018-05-18 21:24

I have found your contact. Mail sent.

Tata55

Avatar: Tata55

2018-05-18 21:28

:-(
<info@studiostrona.pl>: host studiostrona.pl[94.152.145.129] said: 554 mail
server permanently rejected message (#5.3.0)

Tata55

Avatar: Tata55

2018-05-19 09:29

I think I have made it working as desired. The only that remained is the email content. All details are included. But I would like to have the details with their labels. I tried all possible mods in core/orders.php. But the email remains without any changes.

openzibi

Avatar: openzibi

2018-05-19 09:56

1. E-mail? Maybe you added zip file with js, php files.
2. Sometimes I try to help on the forum but I only make modifications for the EXT version.

P.S.
Do you changed function sendEmailWithOrderDetails in core/orders.php?

Zbyszek - StudioStrona.pl

Tata55

Avatar: Tata55

2018-05-19 10:28

Well, that's the mod I have made

  public function sendEmailWithOrderDetails$iOrder ){
    global 
$lang$config;

    
$aData $this->throwOrder$iOrder );
    
$sMailContent str_replace'|n|'"\n"$lang['Order_customer_email_head']."\n------------------------\n".$lang['Order_customer_personal']."\n------------------------\n".$aData['sFirstName'].' '.$aData['sLastName'].

        ( isset( 
$aData['sCompanyName'] ) ? "\n".$aData['sCompanyName'] : null )."\n".
/* Additional Data */
        
( isset( $aData['sCompanyICO'] ) ? "\n".$aData['sCompanyICO'] : null )."\n".
        ( isset( 
$aData['sCompanyDIC'] ) ? "\n".$aData['sCompanyDIC'] : null )."\n".
/* *** */
        
$aData['sStreet']."\n".$aData['sZipCode'].' '.$aData['sCity']."\n".$aData['sPhone']."\n".$aData['sEmail'].( isset( $aData['sComment'] ) ? "\n\n".$lang['Comment'].': '.$aData['sComment'] : null )."\n------------------------\n".$lang['Order_customer_products']."\n------------------------".$this->listProducts$iOrdertrue )."\n------------------------\n".( isset( $aData['iShipping'] ) ? $lang['Order_customer_shipping']."\n------------------------\n".$aData['mShipping'].' ('.$aData['mPayment'].') = '.$this->aOrders[$iOrder]['sPaymentShippingPrice'].' '.$config['currency_symbol']."\n\n" null ).$lang['Summary_cost'].': '.$this->aOrders[$iOrder]['sOrderSummary'].' '.$config['currency_symbol']."\n------------------------\n".$lang['Order_customer_email_foot'] );


The email arrives but I don't know where and how to add the $lang['CompanyICO'] and $lang[CompanyDIC'] Data to see the in the email.
E.g.:
Company: Company XYZ
ICO: 123456789
DIC: 987654321

openzibi

Avatar: openzibi

2018-05-19 12:07

Try this example:

 ( isset( $aData['sCompanyICO'] ) ? "\n".$lang['CompanyICO'].': '.$aData['sCompanyICO'] : null )."\n"

Zbyszek - StudioStrona.pl

Back to top
about us | contact