spree-multi-domain icon indicating copy to clipboard operation
spree-multi-domain copied to clipboard

Edit Product shows blank stores

Open hossamhossny opened this issue 6 years ago • 1 comments

I am having troubles fixing this. As I understand in the Edit Product page, Stores should be added (manually? automatically?) however only the "Stores" label is shown on the page.

 <p data-hook="admin_product_form_stores" class="omega two columns">
  <%= f.field_container :stores, class: ['form-group'] do %>
    <%= f.label :store_ids, Spree.t(:stores) %>
    <% if can? :modify, Spree::Store %>
      <%= f.hidden_field :store_ids, value: @product.store_ids.join(',') %>
    <% elsif @product.stores.any? %>
      <ul class="text_list">
        <% @product.stores.each do |store| %>
          <li><%= store.name %></li>
        <% end %>
      </ul>
    <% else %>
      <div class="alert alert-info">
        <%= Spree.t(:no_resource_found, resource: :stores) %>
      </div>
    <% end %>
  <% end %>
</p>

<script src="https://code.jquery.com/ui/1.10.2/jquery-ui.js" type="text/javascript" charset="utf-8">
  Spree.routes.store_search = '<%= spree.admin_stores_path(format: :json) %>';
  $('#product_store_ids').storeAutocomplete();
</script>

I had to add src="https://code.jquery.com/ui/1.10.2/jquery-ui.js" to the code above in order to suppress an error message complaining about storeAutocomplete().

hossamhossny avatar Dec 25 '17 22:12 hossamhossny

I had to add

//= require spree/backend/spree_multi_domain in the vendor spree backend all.js

to make it work

blset avatar May 19 '19 15:05 blset