Removing the shipping information fields

Merchant
Dari France
Anggota sejak Okt 2023

Hello everyone,

I'm new to LiteCart, and I'm in the process of setting up a digital file sales website. I was wondering if it's possible to simplify the checkout page by removing the shipping information fields (like address, phone number, etc.) and only retain the email, first name, and last name fields. Since I'm selling digital products, I don't need the physical shipping details.

Any guidance or suggestions on how to achieve this would be greatly appreciated!

Thank you in advance for your help.

Best regards,

Youss

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

Hello!  After removing the address1 and address2 fields from /includes/templates/default.catalog/views/box_checkout_customer.inc.php, it ask me again to input address! How to solve this?

LiteCart Fan
Dari Netherlands
Anggota sejak Des 2022

@valdeo Removing the input fields is not enough. You should also comment out the check on the fields in file [b]includes/entities/ent_order.inc.php[/b]
Only address1 is required.
About line 562 you will find the validation of the input fields:


      try {
        if (empty($this->data['customer']['firstname'])) throw new Exception(language::translate('error_missing_firstname', 'You must enter a first name.'));
        if (empty($this->data['customer']['lastname'])) throw new Exception(language::translate('error_missing_lastname', 'You must enter a last name.'));
        //if (empty($this->data['customer']['address1'])) throw new Exception(language::translate('error_missing_address1', 'You must enter an address.'));
        if (empty($this->data['customer']['city'])) throw new Exception(language::translate('error_missing_city', 'You must enter a city.'));
        if (empty($this->data['customer']['country_code'])) throw new Exception(language::translate('error_missing_country', 'You must select a country.'));```
But better not modify this file! Use the vmod below (attached)
LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

@ jackmaessen
Many thanks for your valuable help!

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

One more question if you don't mind.  How to make the field for Different Shipping Address is always fully displayed?

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

Works perfect! Thanks again!

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

After removing the  post code field, it  throws message: you must enter the post code. But validation of this field in file includes/entities/ent_order.inc.php seems quite different from the others.I've tried to comment it out, but throws some error. Any help will be appreciated!

LiteCart Fan
Dari Netherlands
Anggota sejak Des 2022

which postal code field did you remove: from Customer Details or Different Shipping Address?
And what is exactly the error?

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

Postal code field  removed from Customer Details. 
After comment in includes/entities/ent_order.inc.php of:

//if (reference::country($this->data['customer']['country_code'])->postcode_format) {
          if (!empty($this->data['customer']['postcode'])) {
            if (!preg_match('#'. reference::country($this->data['customer']['country_code'])->postcode_format .'#i', $this->data['customer']['postcode'])) {
              throw new Exception(language::translate('error_invalid_postcode_format', 'Invalid postcode format'));
            }
          } else {
            throw new Exception(language::translate('error_missing_postcode', 'You must enter a postcode'));
          }
        }

Throws:  Fatal error: syntax error, unexpected 'catch' (T_CATCH), expecting function (T_FUNCTION) or const (T_CONST) in ~/vmods/.cache/includes-entities-ent_order.inc.php (Line 610)

LiteCart Fan
Dari Netherlands
Anggota sejak Des 2022

Haven't tested it but try this:


     if (!empty($this->data['customer']['postcode'])) {
          if (!preg_match('#'. reference::country($this->data['customer']['country_code'])->postcode_format .'#i', $this->data['customer']['postcode'])) {
              throw new Exception(language::translate('error_invalid_postcode_format', 'Invalid postcode format'));
          }
     } else {
          throw new Exception(language::translate('error_missing_postcode', 'You must enter a postcode'));
     }
}*/```
or this:
```if (reference::country($this->data['customer']['country_code'])->postcode_format) {
      if (!empty($this->data['customer']['postcode'])) {
          if (!preg_match('#'. reference::country($this->data['customer']['country_code'])->postcode_format .'#i', $this->data['customer']['postcode'])) {
              //throw new Exception(language::translate('error_invalid_postcode_format', 'Invalid postcode format'));
          }
      } else {
           // throw new Exception(language::translate('error_missing_postcode', 'You must enter a postcode'));
      }
}```
Project Leader
Dari Paraguay
Anggota sejak Sep 2023

To deactivate the postal code you just have to go to country and then in code format and leave it empty and that's it.

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

Thank you all! I will try your suggestions.

LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

Hello!  The postal code warning is solved. Thanks!
 But after removing the country and zone fields in Different shipping address,
 I get this in order print and packing list:

Warning: Invalid country code () in ~/includes/references/ref_country.inc.php (Line 12)

Any help will be appreciated!

LiteCart Fan
Dari Netherlands
Anggota sejak Des 2022

Comment it out:


        //trigger_error('Invalid country code ('. $country_code .')', E_USER_WARNING);
      }```
LiteCart Fan
Dari Bulgaria
Anggota sejak Des 2017

@jackmaessen
Thanks!
I did it, but unfortunately this doesn't help!?

Anda
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.