parameters:

    shopify_connection_default: &shopify-connection-default
        endpoint: 'https://studioforty9-sandbox.myshopify.com/admin/api/2020-01/'
        user: '2e16f94cd83d83a15c21891b8d0b10f2'
        password: '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'

    sf9_shopify.mapping.product.create:  &shopify-mapping-product-create-custom
        - { target: 'title', sources: 'name' }
        - { target: 'body_html', sources: 'description', expression: 'strsanitize(description)' }
        - target: 'handle'
          sources:
              - key: 'name'
                alias: 'name'
              - key: 'style_code'
                alias: 'style_code'
          expression: 'strtokebab(name) ~ "-" ~ strtolower(style_code)'
        - { target: 'published', literal: false }

        - target: 'product_type'
          sources:
              - key: 'product_type'
                alias: 'product_type'
                default:
                    type: 'variable'
                    value: false
          expression: 'strtolower(product_type)'
        - target: 'vendor'
          sources:
              - key: 'supplier'
                alias: 'supplier'
          expression: 'supplier'

    sf9_shopify.mapping.product.update: &shopify-mapping-product-update-custom
        - { target: 'product_type', sources: 'product_type|0', expression: 'strtolower(product_type)' }
        - { target: 'vendor', sources: 'supplier|' }

    sf9_shopify.mapping.variant.create: &shopify-mapping-variant-create-custom
        - { target: 'price', sources: 'price' }
        - { target: 'sku', sources: 'sku' }
        - { target: 'inventory_management', literal: 'shopify' }
        - { target: 'fulfillment_service', literal: 'manual' }
        - { target: 'inventory_policy', literal: 'deny' }


    sf9_shopify.mapping.variant.update: &shopify-mapping-variant-update-custom
        - { target: 'price', sources: 'price' }
        - { target: 'sku', sources: 'sku' }


    channel.enabled: ['default']

    channel.default:
        general:
            price_list: 'ie'
            order_prefix: ''
        shopify:
            connection: *shopify-connection-default
            option_fields:
                - source: 'getSize'
                  title: 'Size'
                - source: 'getColour'
                  title: 'Colour'
            location_id: '42167140490'
            mapping_product_create: *shopify-mapping-product-create-custom
            mapping_product_update: *shopify-mapping-product-update-custom
            mapping_variant_create: *shopify-mapping-variant-create-custom
            mapping_variant_update: *shopify-mapping-variant-update-custom