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

    Sabo

    11/23/2022, 11:31 AM
    Hello 👋 I have a little question, in
    layouts/spree_application.html.erb
    how and from where is calculed the value of
    <%= title %>
    ?
    ✅ 1
    k
    w
    • 3
    • 9
  • s

    Sabo

    11/24/2022, 8:53 AM
    Hello 🙂 I would 'namespacing' a solidus app into a subdomain like 'shop', should I do something like
    mount Spree::Core::Engine, at: '/', constraints : { subdomain: 'shop' }
    or
    Copy code
    Spree::Core::Engine.routes.draw do
      constraints subdomain: 'shop' do
        ...
      end
    end
    ?
    ✅ 2
    k
    w
    • 3
    • 8
  • b

    BFX462heo

    11/24/2022, 9:32 AM
    Hi everybody. I need to translate to french this ...>
    ✅ 1
  • b

    BFX462heo

    11/24/2022, 9:33 AM
    But I don't know how to do it.
  • b

    BFX462heo

    11/24/2022, 9:35 AM
    It would be: • Acheter par Catégories • Acheter par Marque I don't konw how to pass every taxonomy.name translation.
    ✅ 1
    k
    • 2
    • 9
  • b

    BFX462heo

    11/25/2022, 9:55 AM
    Hi everybody. I have added icons to my categories in the admin pannel but I can not see them in the storefront. How must I do this? Thanks in advance.
    ✅ 1
    w
    • 2
    • 9
  • a

    Antón

    11/25/2022, 12:18 PM
    Hello everyone. I'm new to solidus and I have a little problem with permissions. I have the role warehouse_admin and I need him to only be able to see his warehouses (stock_locations). I have the following:
    Copy code
    # config/initializers/spree.rb
     
    config.roles.assign_permissions :warehouse_admin, [
        'Spree::PermissionSets::RestrictedStockManagement'
      ]
    but the user sees all warehouse. The problem is because of the query that is launched this is the query Where does the
    OR ("spree_stock_locations"."active" = TRUE)
    ?
    Copy code
    Spree::StockLocation Load (0.3ms)  SELECT "spree_stock_locations".* FROM "spree_stock_locations" WHERE (("spree_stock_locations"."id" = 3) OR ("spree_stock_locations"."active" = TRUE)) /* loading for inspect */ LIMIT $1  [["LIMIT", 11]]
    I have tried having a custom permissions class but the result is the same.
    Copy code
    #app/models/spree/permissions_sets/warehouse_admin.rb(
    require 'cancan'
    
    module Spree
      module PermissionSets
        class WarehouseAdmin < Spree::PermissionSets::Base
    
          def activate!
            can :read, Spree::StockLocation, id: location_ids
          end
    
          def location_ids
            @location_ids ||= user.stock_locations.pluck(:id)
          end
        end
      end
    end
    
    # config/initializers/spree.rb
    
    config.roles.assign_permissions :warehouse_admin, [
        'Spree::PermissionSets::WarehouseAdmin'
      ]
    thanks!!
    w
    • 2
    • 5
  • s

    Sabo

    11/25/2022, 12:56 PM
    Hello everyone, a have a new question 🙂 I would like to create a kind of permanent redirect between 'example.com' to 'shop.example.com'
    Copy code
    Rails.application.routes.draw do
    
    get '/', to: 'home#index', constraints: { subdomain: '' }
    mount Spree::Core::Engine, at: '/', constraints: { subdomain: 'shop' }
    
    end
    but I have an error to find the HomeController
    raise MissingController.new(error.message, error.name)
    PS. I just understood that it is certainly because it is in the Spree module
    ✅ 1
    w
    • 2
    • 2
  • s

    Sabo

    11/26/2022, 1:09 AM
    Hello, I'm starting to use solidus in production via a heroku like with aws s3, since I use the solidus/spree part into a subdomain (
    mount Spree::Core::Engine, at: '/', constraints: { subdomain: 'shop' }
    ) I'm getting some problems to upload product images from the backend after upload an image, in the home view:
    Copy code
    (before)
    <img itemprop="image" src="<https://bucket.s3.eu-west-2.amazonaws.com/inaiwpq6x48d2i81z2m2e6au7hi0>">
    
    (now)
    <img alt="" itemprop="image" src="/assets/noimage/small-e0e64753ab233ecd636325b86739eace7af7759hu1t673578df9781f7f34dbaf.png">
    PS. I'm on Rails 7, so with ActiveStorage
    ✅ 1
    • 1
    • 2
  • c

    Cody Baldwin

    11/27/2022, 1:43 AM
    I'm trying to add a column to Spree::Product for a shipping refrigeration setting. I'm having trouble debugging an error when trying to make this enum: `gems/3.0.0/gems/activerecord-6.1.7/lib/active_record/enum.rb294in
    raise_conflict_error': *You tried to define an enum named "refrigeration" on the model "Spree::Product", but this will generate a instance method "room?", which is already defined by another enum. (ArgumentError)*
    Regardless of what I set the enum text values to it throws the same error. Is it being prepended twice?
    ✅ 1
    j
    • 2
    • 7
  • k

    Kevin I

    11/28/2022, 6:41 PM
    If something isn’t shippable (a warranty) what might a good place be in the Solidus Core to filter that out so that shipments do not include that item with least amount of impact. it seems like an inventory unit shouldn’t be needed given that we don’t really need to track fulfillment .. but perhaps too much relies on inventory units being present and I should just filter them out of packages in a custom splitter…
    ✅ 1
    z
    t
    j
    • 4
    • 5
  • a

    Alexander V

    11/28/2022, 8:57 PM
    Hello everyone. I'm getting
    uninitialized constant SolidusPaypalBraintree::Gateway (NameError)
    when trying to start the server after configuring SolidusPaypalBraintree gem exactly how README says. What it can be? Will appreciate any hints. ruby 3.1.2 rails 7.0.4
    ✅ 1
    w
    • 2
    • 2
  • c

    Cody Baldwin

    11/29/2022, 3:25 AM
    I have the old frontend (yeah I know i need to update, lol). On the checkout screen for the address input there's no way to translate states (even in the new frontend I think), without overriding some JS. See the path for api/states: https://github.com/solidusio/solidus_frontend/blob/dae732ed7442a755cc0426cd2afa6ac[…]e7105/app/assets/javascripts/spree/frontend/checkout/address.js and https://github.com/solidusio/solidus_starter_frontend/blob/main/templates/app/assets/javascripts/utils.js.erb I tried to change the checkout form like this:
    Copy code
    <span class="js-address-fields" style="display: none;">
            <%=
              form.collection_select(
                :state_id, address.country.states, :id, Proc.new { |val| t(val.name) },
                {include_blank: true},
                {
                  class: have_states ? 'required border-slate-400 grow text-slate-900 focus:border-sky-200 focus:ring-1 focus:ring-sky-100 text-xs lg:text-sm xl:text-base rounded' : '',
                  style: have_states ? '' : 'display: none;',
                  disabled: !have_states,
                  autocomplete: address_type + ' address-level1',
                })
              %>
            <%=
              form.text_field(
                :state_name,
                class: !have_states ? 'required border-slate-400 grow text-slate-900 focus:border-sky-200 focus:ring-1 focus:ring-sky-100 text-xs lg:text-sm xl:text-base rounded' : '',
                style: have_states ? 'display: none;' : '',
                disabled: have_states,
                autocomplete: address_type + ' address-level1',
              )
            %>
          </span>
    If I turn off the JS then I've got to write some new js for countries that don't have states, or the form element won't show. This Proc added to the collection_select won't work, it show sup for a few ms then disappears.
    ✅ 1
    w
    k
    • 3
    • 8
  • a

    Alexander V

    11/29/2022, 7:53 AM
    1. I already saw similar questions, but didn't understand what the problem is.. • Billing address state can't be blank • Shipping address state can't be blank when trying to fill the address form, doesn't matter which country 2. checkbox "Use Billing Address" not working? doesn't matter if it's ticked or not it insist to fill out shipping address
    n
    w
    • 3
    • 15
  • a

    Alexander V

    11/30/2022, 8:14 AM
    solidus_paypal_braintree gem: Configure payment types
    If your site uses an unmodified solidus_frontend, it should now be ready to take payments.
    this doesn't work now out of the box, right? because I have multiple files missing errors, like partials, scripts
    k
    • 2
    • 23
  • b

    BFX462heo

    12/01/2022, 7:20 AM
    Hello everybody. I have a little problem. I want to remove the tax decimals in the cart view...
    ✅ 1
    n
    e
    • 3
    • 22
  • o

    Oleksandr Pozniak

    12/01/2022, 11:39 AM
    Hi all! Please tell me how can I apply a promotional code for order or line items through solidus API? I cant figure it out( Thank you!
    k
    • 2
    • 1
  • c

    Cody Baldwin

    12/01/2022, 10:15 PM
    I'm using Solidus Stripe (with the old Frontend) for a store in Japanese and English (currency is 'JPY', Stripe is set to 'JP', no v3 intents/elements). For a payment of ¥5100, the amount that is sent to Stripe it is taking off two digits, e.g. only charging ¥51. I'm not sure how to proceed. Maybe something related to this? https://github.com/solidusio/solidus_stripe/blob/master/app/models/spree/payment_method/stripe_credit_card.rb#L30 https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount
    n
    • 2
    • 8
  • j

    jakemumu

    12/02/2022, 6:28 PM
    Hey -- quick question. I've got an issue with what i believe to be stale orders causing issues for current users on checkout -- is there a way to move all incomplete orders -- or remove from from a users cart if they're logged in?
    j
    c
    • 3
    • 6
  • s

    Steve Simitzis

    12/03/2022, 4:12 AM
    Hi all, I’m new to Solidus and trying to install
    solidus_social
    . I’m getting stuck at this step:
    Copy code
    bundle exec rails g solidus_social:install
    With this error message:
    Copy code
    /Users/steve/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/solidus_social-1.5.0/app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb:24:in `<module:UserRegistrationsControllerDecorator>': uninitialized constant Spree::UserRegistrationsController (NameError)
    
          ::Spree::UserRegistrationsController.prepend self
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Did you mean?  UserSessionsController
                   UserConfirmationsController
    	from /Users/steve/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/solidus_social-1.5.0/app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb:5:in `<module:Spree>'
    Any ideas how I can fix this? Gemfile attached in the thread
    j
    a
    • 3
    • 9
  • w

    Wilfred

    12/06/2022, 10:14 AM
    Hey, trying to add some products via a Rake task, but can anyone tell what I'm doing wrong?
    Copy code
    [...]
    
    created_product = Spree::Product.find_or_create_by(
      name: name,
      price: price,
      description: description,
      available_on: Time.current,
      shipping_category: shipping_category,
      tax_category: tax_category,
      taxon_ids: [taxon_ids]
    )
    puts created_product.name
    
    options = $browser.at_css("#productOverview_feature_div table")
    
    values = []
    
    options.css("tr").each_with_index do |row, index|
      type = row.at_css("td:nth-of-type(1) span").text.strip
      value = row.at_css("td:nth-of-type(2) span").text.strip
    
      created_type = Spree::OptionType.find_or_create_by(
        name: type,
        presentation: type
      )
      # created_product.option_types << created_type.name
      # created_product.save
      # => ActiveRecord::AssociationTypeMismatch: Spree::OptionType(#74440) expected, got "Brand" which is an instance of String(#5020)
    
      created_value = Spree::OptionValue.find_or_create_by(
        name: value,
        presentation: value,
        option_type: created_type.name
      )
    
      puts "#{ created_type.name }: #{ created_value.name }"
    
      values << created_value.name
    end
    
    created_product.variants.create(
      option_values: [values],
      sku: rand(100000)
    )
    created_product.save!
    # => ActiveRecord::RecordInvalid: Validation failed: Option types is invalid, Variants is invalid, Variants including master is invalid
    m
    • 2
    • 8
  • w

    Wilfred

    12/06/2022, 12:42 PM
    Or if anybody's available for freelance I would gladly pay...
  • g

    Given Reed

    12/06/2022, 3:56 PM
    Has anybody set up checkout as a "single page" checkout? I have a client who wants to collect everything (cart qtys/billing/shipping/payment/discount info) all on a single page. Wondering if anybody has done it and has any words of advice on things to watch out for while we work on it.
    j
    m
    +3
    • 6
    • 18
  • a

    Alexander V

    12/06/2022, 7:21 PM
    Maybe this is silly question, is there a ready partial to use with solidus_paypal_commerce_platform gem? And I also, do I need to configure API credentials in spree.rb initializer after Paypal wizard?
    g
    • 2
    • 2
  • g

    Given Reed

    12/07/2022, 3:43 PM
    Setting up a new store, working on easypost, but a fresh install and config (I ran the install command with migrations and set the config pieces) throws
    Copy code
    PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "spree_shipping_rates_join_index"
    DETAIL: Key (shipment_id, shipping_method_id)=(9, 2) already exists.
    when I click "save and continue" after entering the shipping address. Looking at the logs and I see
    Copy code
    [1m[36mSpree::ShippingRate Create (0.7ms)[0m  [1m[32mINSERT INTO "spree_shipping_rates" ("shipment_id", "shipping_method_id", "selected", "cost", "created_at", "updated_at", "tax_rate_id", "name", "easy_post_shipment_id", "easy_post_rate_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id"[0m  [["shipment_id", 9], ["shipping_method_id", 2], ["selected", true], ["cost", "23.75"], ["created_at", "2022-12-07 15:25:17.919924"], ["updated_at", "2022-12-07 15:25:17.919924"], ["tax_rate_id", nil], ["name", "USPS Express"], ["easy_post_shipment_id", "shp_683cdccae3f34e65b8e77f997c6d84e1"], ["easy_post_rate_id", "rate_2d90fba67a874e62ae4dd45ac51ce490"]]
      ↳ app/controllers/checkouts_controller.rb:53:in `transition_forward'
      [1m[36mSpree::ShippingRate Create (1.4ms)[0m  [1m[32mINSERT INTO "spree_shipping_rates" ("shipment_id", "shipping_method_id", "selected", "cost", "created_at", "updated_at", "tax_rate_id", "name", "easy_post_shipment_id", "easy_post_rate_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id"[0m  [["shipment_id", 9], ["shipping_method_id", 2], ["selected", false], ["cost", "23.75"], ["created_at", "2022-12-07 15:25:17.924424"], ["updated_at", "2022-12-07 15:25:17.924424"], ["tax_rate_id", nil], ["name", "USPS Express"], ["easy_post_shipment_id", "shp_683cdccae3f34e65b8e77f997c6d84e1"], ["easy_post_rate_id", "rate_127e8d2ca0504d1ea584d5b911678396"]]
      ↳ app/controllers/checkouts_controller.rb:53:in `transition_forward'
    It appears to be trying to insert twice. I haven't done any shipping customizations, the store is still mostly vanilla. I'm running on solidus 3 (
    gem "solidus_core", "~> 3.2"
    ). I can dig into the gem's code to try to figure it out, but was wondering if anybody had any ideas that would save me needing to dig around.
    m
    • 2
    • 5
  • a

    Alexander V

    12/07/2022, 7:20 PM
    guys, sorry for repeating the question.. is there ready for use partial for paypal_commerce_platfrom or what I can use for the reference, please?
    g
    • 2
    • 4
  • b

    BFX462heo

    12/08/2022, 8:31 AM
    Hello everybody. I have a little question. I want to change, in the billing address form, the preselected country (United States of America) to France...
    ✅ 1
    c
    • 2
    • 10
  • w

    Wilfred

    12/08/2022, 9:06 AM
    Been having a super hard time adding my Amazon products due to Spree's pricing. I've been trying to follow https://blog.magmalabs.io/2020/10/22/how-pricing-selection-works-in-solidus.html but I just can't seem to get rid of these syntax errors. Should all those classes/modules even be in my Rake task? https://pastebin.com/Wxg5Ng2g
    amazon.rake:336: syntax error, unexpected end-of-input, expecting 'end'
    Thanks!
    j
    • 2
    • 2
  • b

    BFX462heo

    12/09/2022, 8:09 AM
    Hi everybody. Do you know wich will be the easiest way to add an access age verification popup to my storefront? Thanks in advance.
    j
    • 2
    • 3
  • a

    Alexander V

    12/09/2022, 8:49 PM
    I installed 1.0.0.beta1 pre-release, trying to run Paypal wizard, after loggin in it throws this (after Agree and Connect to Paypal's sandbox):
    g
    • 2
    • 10
1...282930...39Latest