Sha256: 6fc53b9b9fc48356650f0169545bf408d890e31da85eb2241c3ff9ab0ad68045

Contents?: true

Size: 834 Bytes

Versions: 6

Compression:

Stored size: 834 Bytes

Contents

<div class="content_editor essence_spree_product" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
  <%= content_label(content) %>
  <%= text_field_tag(
    content.form_field_name,
    content.essence.spree_product_id,
    id: content.form_field_id,
    class: 'alchemy_selectbox full_width'
  ) %>
</div>

<script>
  $('#<%= content.form_field_id %>').alchemyProductSelect({
    placeholder: "<%= Alchemy.t(:search_product, scope: 'solidus') %>",
    apiToken: "<%= current_alchemy_user.spree_api_key %>",
    baseUrl: "<%= spree.api_products_path %>",
    query_params: <%== content.settings[:query_params].to_json %>,
    <% if content.essence.product %>
    initialSelection: {
      id: <%= content.essence.spree_product_id %>,
      text: "<%= content.essence.product.name %>"
    }
    <% end %>
  })
</script>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alchemy-solidus-3.1.0 app/views/alchemy/essences/_essence_spree_product_editor.html.erb
alchemy-solidus-3.0.2 app/views/alchemy/essences/_essence_spree_product_editor.html.erb
alchemy-solidus-3.0.1 app/views/alchemy/essences/_essence_spree_product_editor.html.erb
alchemy-solidus-3.0.0 app/views/alchemy/essences/_essence_spree_product_editor.html.erb
alchemy-solidus-2.5.1 app/views/alchemy/essences/_essence_spree_product_editor.html.erb
alchemy-solidus-2.5.0 app/views/alchemy/essences/_essence_spree_product_editor.html.erb