Where could I store some key/value pairs?
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 41
- Joined: 03 Jun 2023, 17:30
Where could I store some key/value pairs?
Hello,
Laravel Framework 10.13.1, php8.1-fpm, aimeos/aimeos-laravel 2023.04.2
I want to implement sales tax per state. I want to avoid doing additional API calls during the checkout/basket process. My thought process is that I can store sales tax rates for each state in a database table. I will then periodically run some type of console command or a cronjob to keep these rates updated from an API.
Would a database table be appropriate? Or is there some existing key/value pair storage mechanism I should be using?
And if a database table is the way to go, where would something like that ideally be placed?
Thank you
Laravel Framework 10.13.1, php8.1-fpm, aimeos/aimeos-laravel 2023.04.2
I want to implement sales tax per state. I want to avoid doing additional API calls during the checkout/basket process. My thought process is that I can store sales tax rates for each state in a database table. I will then periodically run some type of console command or a cronjob to keep these rates updated from an API.
Would a database table be appropriate? Or is there some existing key/value pair storage mechanism I should be using?
And if a database table is the way to go, where would something like that ideally be placed?
Thank you
Re: Where could I store some key/value pairs?
There's a basket plugin available which changes the tax rate according to the country/state of the customer (during checkout):
https://aimeos.org/docs/latest/manual/plugins/#taxrates
https://aimeos.org/docs/latest/manual/plugins/#taxrates
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 41
- Joined: 03 Jun 2023, 17:30
Re: Where could I store some key/value pairs?
Thank you,
If I wanted to programmatically keep these values up-to-date, could I keep updating these values directly in the database?
I see its here:
Would it be inadvisable to be directly interacting with the database?
If I wanted to programmatically keep these values up-to-date, could I keep updating these values directly in the database?
I see its here:
Code: Select all
mysql> select * from mshop_plugin where provider = 'TaxRates' limit 5 \G
*************************** 1. row ***************************
id: 9
siteid: 1.
type: order
provider: Taxrates
label: Country and state tax rates
config: {"country-taxrates":{"US":"5.00","AT":"20.00"},"state-taxrates":{"CA":"6.25"}}
pos: 90
status: 0
mtime: 2023-06-06 14:13:38
ctime: 2023-06-06 14:13:38
editor: core
1 row in set (0.00 sec)
Re: Where could I store some key/value pairs?
At least it's possible to do so.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star