Jump to content
thirty bees forum
  • 0

Multistore: Different invoice content for each store


Question

Posted

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.

5 answers to this question

Recommended Posts

  • 0
Posted

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?

  • 0
Posted

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

 

  • 0
Posted

Multiple themes would be an overkill in my opinion. We have such little issues quite often. We use just use some {if $shop->id==1} conditions, to solve such things. Not super clean, but works pretty well.

  • 0
Posted

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!

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...