aimeos / aimeos-typo3

TYPO3 e-commerce extension for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
https://aimeos.org/TYPO3
GNU General Public License v3.0
274 stars 738 forks source link

Fallback for language from language attribute #220

Closed DavidHedden closed 1 month ago

DavidHedden commented 1 month ago

If there is no param set, the language should be taken from the typo3 attribute langauge. In previous version this was still done, via the aspect from typo3 context.

An argument can be made to extend this to getting the site code & currency via the request attibutes. For site code this could be a property in the site config. That would mean multiple sites could use the same shop instance. And for curreny this could be attached as a property to the language attribute.

aimeos commented 1 month ago

Thanks a lot! Can you add the necessary code for the site and currency as well as you've suggested?

DavidHedden commented 1 month ago

Example Configuration:

base: 'https://example.com'
...
aimeosSite: 'default'
languages:
  0:
    languageId: '0'
    ...
    aimeosCurrency: 'EUR'
DavidHedden commented 1 month ago

I've created a new commit with all the discussed changes. If something can not be taken from the request object the typoscript configuration or fallback is used.

base: 'https://example.com'
...
aimeos:
  site: 'default'
languages:
  0:
    languageId: 0
    ...
    aimeos:
        currency: 'EUR'
aimeos commented 1 month ago

We would suggest to use currency only, i.e.:

base: 'https://example.com'
aimeos:
  site: 'default'
languages:
  0:
    languageId: 0
    currency: 'EUR'

Because currency may not be specific to Aimeos

DavidHedden commented 1 month ago

We would suggest to use currency only, i.e.:

base: 'https://example.com'
aimeos:
  site: 'default'
languages:
  0:
    languageId: 0
    currency: 'EUR'

Because currency may not be specific to Aimeos

done

aimeos commented 1 month ago

Great and thank you very much for all your work to make Aimeos better! :-)