Closed josetapadas closed 9 years ago
I've stopped working on this extension as I'm no longer developing applications that use it.
Suppliers shouldn't be able to add new products within this extension anymore that was moved to spree_marketplace so I think you're solution would be more appropriate there.
Hey, thank you @JDutil !
The thing is, I really don't want to use Stripe (I've found out that there are other gems that extend spree_drop_ship and use other Stripe-like systems, but even that is not what I'm looking for). But I've already read what you have done, for instance, with the ProductsController and it is (almost) exactly the same I've wrote here:
Spree::Admin::ProductsController.class_eval do
create.after :set_supplier
private
def set_supplier
if try_spree_current_user.supplier?
@object.add_supplier! spree_current_user.supplier
end
end
end
Even though you stopped working with this extension I think it would be nice to have this snippet on the ProductsController otherwise the logic is not that useful (besides the sample suppliers). I will create just a simple PR for the 2-4 branch if you don't mind.
By the way, thank you very much in advance :)
Hello,
I'm using this gem but I have a small question regarding the table
spree_supplier_variants
.I'm not being able to add stock items to a specify supplier, receiving constantly the error: There was a problem saving this stock movement. Please try again. This happens because there is no relation generated between newly created Spree::Products (or Variants) and the suppliers. For example, this query does not return anything, as the table is empty, and rollback the whole transaction:
When we use the sample data, there is a rake task to associate a variant to a specific supplier, using the proper method that you have added to the model:
But the same does not happen when we create suppliers and/or new products. I've come up with a simple solution that, when, creating a new Product, from the Products Admin page, it automatically is related to the supplier that is creating it:
And I could start Defacing the views in order to add an extra field so the Variants can be associated to a specific supplier, but before that, could you please help me and tell me if I'm missing something and this behaviours is expected. If so, how do you think we should associate the suppliers with the products via the admin UI.
Greets and thanks in advance, José