Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Edit Product shows blank stores #178

Open
hossamhossny opened this issue Dec 25, 2017 · 1 comment
Open

Edit Product shows blank stores #178

hossamhossny opened this issue Dec 25, 2017 · 1 comment

Comments

@hossamhossny
Copy link

hossamhossny commented Dec 25, 2017

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().

@blset
Copy link

blset commented May 19, 2019

I had to add

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

to make it work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants