Pass parameters.yml value to Akeneo frontend

I’m migrating a bundle, that add a link button on the product page, from akeneo 2.3 to akeneo 3.2. With 2.3 we have a parameter defined on parameters.yml as

 #CUSTOM
 magento_base_url: http://mymagento.com/

then in the form_extensions

extensions:
  pim-product-edit-form-magento-link-frontend:
    module: pim/product-edit-form/magento-link
    parent: pim-product-edit-form
    targetZone: buttons
    position: 90
    magentoBaseUrl: "%magento_base_url%" <-- MY CUSTOM ATTR
    type: frontend

then in js i will have

define(
[
    'underscore',
    'oro/translator',
    'pim/form',
    'pim/template/product/magento-link'
],
function (_,
          __,
          BaseForm,
          template) {
    return BaseForm.extend({
        template: _.template(template),
        render: function () {
            let linkPath,
                linkLabel,
                sku = this.getFormModel().get('identifier'),
                baseUrl = this.options.magentoBaseUrl; <-- THIS

where baseUrl contains http://mymagento.com/

After upgrading to 3.2 the value on baseUrl is exactly %magento_base_url%

What i should do to pass this parameter to the js stack?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *