Jump to content
thirty bees forum
  • 0

Multistore: Different invoice content for each store


b_otho

Question

How can I have different invoice adresses for two different stores in a multistore setup? Specifically I want the one shop to include first and last name and the second one to include a company name and no first / last name in the address section.

It seems that the fields you setup under each country's setting changes for both stores, so that's not an option.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Yes, I know and I've already made custom templates for each theme. But from what I can tell I cannot achieve what I want without overriding an address controller as it will hold the info I need to print in my template. The question is which override and where?

Link to comment
Share on other sites

  • 0

Address format is determined by country.

Country (and associated AddressFormat) is not multi-store ready, so this settings is global for all stores. I believe this is the correct behaviour. Your use case is really very rare, and in my opinion does not justify making AddressFormat multistore.   

To solve your requirement, you can override method AddressFormat::getFormat. Please do this in custom module if you can

 

Link to comment
Share on other sites

  • 0

I use different themes for each shop as I also need different e-mail templates for each store. But I actually just found the solution.

In HTMLTemplateInvoice.php I can insert extra variables in the data array at line 268 like these:

 

  $data = [
          
            'firstname_value' 			 => $customer->firstname,
            'company_value' 			 => $customer->company,

        ];

and then I can call these from my invoice templates. Succes!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...