https://solidus.io logo
Join Slack
Powered by
# support
  • t

    Tom Wilson

    08/12/2021, 8:18 PM
    Something random I've noticed in our admin UI - it looks like when you select a shipping rate for a shipment from a list of multiple choices, it destroys the other choices. (I have 4 shipping rates available, but after I select a rate, the other three are no longer choices)
    k
    • 2
    • 4
  • t

    Tom Wilson

    08/12/2021, 8:18 PM
    That seems to be intended behavior judging by the code in Shipment for
    select_shipping_method
  • t

    Tom Wilson

    08/12/2021, 8:18 PM
    https://github.com/solidusio/solidus/blob/master/core/app/models/spree/shipment.rb#L170
  • t

    Tom Wilson

    08/12/2021, 8:18 PM
    But... why? Why does this code path not preserve all the previous rates returned by the estimator?
  • t

    Tom Wilson

    08/12/2021, 8:22 PM
    I guess a follow up question here would be - why does the default admin order experience list shipping rates, but then select a shipping method by ID? Wouldn't it be better to select a shipping rate directly?
    a
    • 2
    • 1
  • h

    Haroon Khalid

    08/16/2021, 11:39 AM
    Hey, I want to implement a new payment gateway in solidus. Currently, we have checkout.com integrated into the system.
  • h

    Haroon Khalid

    08/16/2021, 11:39 AM
    I want to ask can I use this active_merchant guide to integrate my payment into solidus? https://github.com/activemerchant/active_merchant/wiki/Contributing
    c
    • 2
    • 12
  • v

    Vlad Danciu

    08/16/2021, 12:10 PM
    Small PR https://github.com/solidusio-contrib/solidus_importer/pull/75 . It lacks a test for the change but am not sure how to write it. Any help would be appreciated
  • t

    Tom Wilson

    08/16/2021, 9:23 PM
    In trying to solve some of the pain points I mentioned earlier around selecting shipping rates and method, I have been attempting to add a
    select_shipping_rate
    method to the
    spree/api/shipments_controller.rb
    class, and I'm having some difficulties.
  • t

    Tom Wilson

    08/16/2021, 9:24 PM
    Specifically, the controller defines a fairly particular chain of callbacks as before actions that it needs to use in order
  • t

    Tom Wilson

    08/16/2021, 9:24 PM
    Before most actions, it invokes
    lock_order
    , which makes good sense.
  • t

    Tom Wilson

    08/16/2021, 9:25 PM
    But it also specifically declares a
    before_action
    for invoking
    find_shipment
    (which sets the
    @order
    variable) only for specific actions: https://github.com/solidusio/solidus/blob/master/api/app/controllers/spree/api/shipments_controller.rb#L7
  • t

    Tom Wilson

    08/16/2021, 9:25 PM
    So for my new custom method, it blows up in the
    lock_order
    method before reaching my new code.
  • t

    Tom Wilson

    08/16/2021, 9:29 PM
    Is there a recommended pattern to solve this? It doesn't seem like my decorator can add a hook in exactly the right point in the callback stack easily - adding my own
    before_action
    to invoke
    find_shipment
    seems like it doesn't work because it either ends up clearing the other before actions or runs in the wrong order.
  • j

    Jared Norman

    08/16/2021, 9:38 PM
    Yeah, Rails was never really meant to support this use case, so some customizations around the before actions are just really hard. If only we had similar tools for inserting `before_action`s before/after other
    before_actions
    like we do with the middleware stack. If there's not a reasonable way to make it work, I would take it as a sign to just add your own API controller that works the way you need and switch over to using that.
    💯 1
  • t

    Tom Wilson

    08/16/2021, 9:55 PM
    That makes sense - I found a particular work-around that works for me in this exact case.
  • t

    Tom Wilson

    08/16/2021, 9:56 PM
    (For anyone curious - I just added a
    find_shipment unless @order
    to the
    lock_order
    call. In case anyone else happens to have a similar use case)
  • t

    Tom Wilson

    08/16/2021, 9:56 PM
    But that's probably good intuition advice for the future!
    sg thumbs up 1
  • g

    Given Reed

    08/17/2021, 7:25 PM
    Trying to load a product by sku (
    product = Spree::Product.find_by(sku: row['associated'])
    ) results in a message that says:
    column spree_products.sku does not exist
    , which is true, it doesn't. I've done this loading on other fields, but I guess I've done it on fields that exist in the actual table. I see the sku in
    spree_variants
    , but it doesn't seem to like
    Spree:Variant
    either. I can see that there's a sku search in the admin, but I can't quite sort out how it pulls the info. Any pointers?
    j
    • 2
    • 3
  • k

    Kevin I

    08/18/2021, 8:03 PM
    Let's say we want to display a discounted price for a product. This product is not in the user's cart. Spree::Promotions seem to run ont he user's cart so what is the mechanism we use in Solidus for generic product based discounting..
    j
    e
    • 3
    • 12
  • t

    Tom Wilson

    08/18/2021, 10:00 PM
    Is there an out-of-the-box way to create a promotion that can only be applied via the Admin UI? If not, how conceptually hard would it be to create such a thing? (Context - we want our admins to be able to offer free shipping easily using a promotion, but we don't want users to be able to guess it themselves)
    j
    • 2
    • 8
  • t

    Tom Wilson

    08/18/2021, 11:27 PM
    Just for my own edification - I've been digging a little into promotion rules. It seems like it would be possible to make a promotion rule that said something like "applicable by admin user only". Is that not a reasonable rule for some reason? Would the problem be that it could potentially get cleared by later updates or become invalid if a user modifies the order?
    j
    • 2
    • 4
  • a

    Ahmad Ridwan Fauzi

    08/19/2021, 7:31 AM
    Hello, has anybody here implemented a way to hide admin dashboard (like redirecting to certain pages or showing 404 error page) for certain user roles and for those who are not logged in?
    v
    • 2
    • 2
  • t

    TEMITAYO ADELEKE

    08/19/2021, 4:12 PM
    Hello everyone, I'm trying to implement a flexible promotion in solidus that can be applied to a
    line_item
    based on the days of the week(Mon, Tues, Wed, Thurs, Fri, Sat, Sun), this is basically to change item price depending on the day. I'm a beginner(.i.e I've just started learning solidus) and I'm just trying to understand how to implement this using the modules mentioned in the documentation(handler, action, and rule). I will appreciate any tips, suggestions, or advice. Thanks 🙏
    p
    a
    • 3
    • 5
  • m

    Matheus Kemer

    08/20/2021, 1:55 PM
    Hello guys! I need another product creation flux for my app. Me (admin) will create "base products" and the shopkeeper (another role, another login) will get these base products and add (by some js lib) a image or phrase for the base product, and that variation will be displayed in his own subdomain shop. In case the 'real' product will be that who shopkeeper will create. Imagine that the admin create a white t-shirt product (master product). The shopkeeper will select this base product and, with the customization lib, will join his company logo to t-shirt and this customized t-shirt (variant maybe?) will be available in his store. All the shopkeepers will need to select the master product to start the customization proccess and create their own product variants. The cost of product will be divided. The base product will have a fixed cost and the shopkeeper can adjust the profit on the product. I'm thinking to create a new admin panel for shopkeeper, only with this "product crud", a his orders page and a page to follow up the shipping status for orders of his store for now. Will need to add subdomains by store too. The stock will be infinite for now, all payments will be direct to the admin account and the shipping will be admin (me) responsabilities too Did someone do something like that before? If not, do you know the best way I can do? Thanks!
    a
    d
    • 3
    • 8
  • v

    Vlad Danciu

    08/20/2021, 5:56 PM
    Two small PR’s: https://github.com/solidusio-contrib/solidus_importer/pull/76 and https://github.com/solidusio-contrib/solidus_importer/pull/77
    j
    • 2
    • 2
  • v

    Vlad Danciu

    08/20/2021, 5:57 PM
    First one already has a review, needs merging
  • g

    Given Reed

    08/20/2021, 7:27 PM
    This fun site I'm working on, it's got thousands of tax rates (all based on zip code, I know it's not ideal, that's how the existing site is set up, that's what I have to make work on solidus, too). It's so many that trying to load the page in the admin times out. I can add in pagination to
    tax_rates_controller.rb
    as a proof of concept, but I know that's not the right way to go about it. What's the best way to extend / override an existing controller action to add some additional functionality? I've seen some articles talking about overrides, some use decorators. I'm sure it's super easy to do, I just haven't seen the right explanation for it so it hasn't "clicked" in my head yet
    j
    • 2
    • 6
  • a

    Ahmad Ridwan Fauzi

    08/23/2021, 9:19 AM
    Hello, just wondering. Anyone here has successfully modified the search for products on frontend? At least to the point that you can integrate a new parameter for the search
    b
    • 2
    • 3
  • u

    Umair Ali

    08/23/2021, 2:20 PM
    It is a spree fork. What makes it better or different than spree?
    j
    b
    m
    • 4
    • 13
12345...39Latest