Ecommerce version_price_in_u_s_d_enabled #15834
-
|
Does anyone know why the ecommerce generates columns for currency? eg version_price_in_u_s_d_enabled. I need to change to AUD and its broken my db. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
That column is expected with The plugin is multi-currency and it creates a separate price field per currency (e.g. To switch to AUD you need to update the plugin config and run a schema migration (or reset the DB in dev). Example: import { ecommercePlugin } from '@payloadcms/plugin-ecommerce'
const AUD = {
code: 'AUD',
decimals: 2,
label: 'Australian Dollar',
symbol: '$',
}
ecommercePlugin({
currencies: {
supportedCurrencies: [AUD],
defaultCurrency: 'AUD',
},
}) |
Beta Was this translation helpful? Give feedback.
-
|
Is the initial price field |
Beta Was this translation helpful? Give feedback.
That column is expected with
@payloadcms/plugin-ecommerce.The plugin is multi-currency and it creates a separate price field per currency (e.g.
priceInUSD,priceInGBP, etc). On SQL/PG those field names get snake_cased into columns likeprice_in_u_s_d_*. If your collection has Versions/Drafts enabled, versions are stored under aversionobject in a separate*_versionstable/collection, so you’ll also see theversion_prefix (e.g.version_price_in_u_s_d_enabled).To switch to AUD you need to update the plugin config and run a schema migration (or reset the DB in dev). Example: