Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Created July 9, 2025 20:02
Show Gist options
  • Save codigoconjuan/9930d8449772e4c63fb27f9854a966cf to your computer and use it in GitHub Desktop.
Save codigoconjuan/9930d8449772e4c63fb27f9854a966cf to your computer and use it in GitHub Desktop.
Body para el Product Action de Astro
const body = {
title: input.title,
freshcoffee_categories: input.freshcoffee_category,
featured_media: input.featured_media,
status: 'publish',
...(input.variable_price === "true" ? {
acf: {
variable_price: input.variable_price,
small: {
size: 'Chico',
price: input.small
},
medium: {
size: 'Mediano',
price: input.medium
},
large: {
size: 'Grande',
price: input.large
},
},
} : {
acf: {
variable_price: input.variable_price,
price: input.price
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment