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

    Sabo

    03/08/2023, 9:51 AM
    Hello everyone, I'm doing a kind of cloning of the "product feature" (model, controller, helper, admin panel, ...) I also would like to generalize the search helper
    Spree::Core::Search::Base
    and
    Spree::Core::ControllerHelpers::Search
    for searching not only for the Product model
    Copy code
    module SearchDecorator
      class Base
      end
       
      class Product
        #something
      end
       
      class Other
        #something
      end
    
      ::Spree::Core::Search.prepend self
    end
    Copy code
    module BuidlSearchHelperDecorator
      module Product
        def build_searcher(params)
          #something
        end
      end
      
      module Other
        def build_searcher(params)
          #something
        end
      end
      
      def build_searcher(params)
      end
    
      ::Spree::Core::ControllerHelpers::Search.prepend self
    end
    There is the code I wrote in
    /app/overrides
    I was wondering if this is the right approach ------ Solidus 3.2.0
    k
    • 2
    • 2
  • z

    Zyad A

    03/08/2023, 1:50 PM
    Good afternoon everyone, I am writing an extension to integrate my local payment provider. I have created the extension with the gateway/paymentmethod/source. I was wondering if someone might have a working example I could look at. I'm a little confused with how to actually initiate the transaction, I am looking to have a button that customers can click and be redirected to the PSP page and then back when successful, but I'm a little stumped as to how to achieve this. If anyone has a working example I could take a look at I would be enormously grateful!
    w
    • 2
    • 2
  • s

    Steve Simitzis

    03/10/2023, 6:06 PM
    Hello! We are using Solidus on Google Cloud with a headless front end running on Gatsby. We’ve noticed that Solidus defaults to using signed URLs from the bucket for our product images. Unfortunately the signed URLs have an expiry, so users will see broken images in their cart if they come back the next day. We’ve tried setting the bucket read permissions to fully open to the public, but Solidus insists on using signed URLs. How do we force public URLs from the bucket with no signature or expiry?
    j
    • 2
    • 3
  • j

    jakemumu

    03/12/2023, 7:02 PM
    just wanted to share this semi serious issue in the solidus paypal extension: https://github.com/solidusio/solidus_paypal_commerce_platform/issues/191
  • d

    Daniel Senff

    03/13/2023, 11:53 AM
    Hi, I have two questions about the solidus starter frontend handling taxons. In the
    TaxonController#show
    to retrieve the list of all products in the given taxon, you go through the searcher_class - search for products having the given taxon_id. Why is this instead of using
    @taxon.products
    or
    @taxon.classifications
    ? I also wonder how the search class is respecting Classification#position, I don't find any references to this in
    Spree::Core::Search::Base
    .
    k
    • 2
    • 2
  • s

    Sabo

    03/15/2023, 9:18 AM
    Hello, I have some issue with Ransack I'm making a new admin panel with search bar using ransack like in
    admin/products/index.html.erb
    but I get the error
    undefined method 'name_cont' for Ransack::Search<class: Spree::Kit, base: Grouping <combinator: and>>:Ransack::Search
    Copy code
    # frozen_string_literal: true
    
    module Spree
      module Admin
        class NewPanelController < ResourceController
          update.before :update_before
          helper_method :clone_object_url
          before_action :split_params, only: [:create, :update]
          
          def show
            redirect_to action: :edit
          end
    
          def index
            session[:return_to] = request.url
            respond_with(@collection)
          end
    
          def destroy
            ...
          end
    
          def clone
            ...
          end
          
          private
          
          def collection
            return @collection if @collection
            params[:q] ||= {}
            params[:q][:s] ||= "name asc"
            # @search needs to be defined as this is passed to search_form_for
            @search = super.ransack(params[:q])
            @collection = @search.result.
                  order(id: :asc).
                  includes(:images).
                  page(params[:page]).
                  per(Spree::Config[:admin_kits_per_page])
          end
          
          def split_params
          end
          
          def update_before
             ...
          end
          
          def clone_object_url(resource)
            clone_admin_kit_url resource
          end
        end
      end
    end
    index.html.erb
    Copy code
    <%= search_form_for [:admin, @search] do |f| %>
            <%- locals = {f: f} %>
            <div class="row" data-hook="admin_kits_index_search" >
              <div class="col-10">
                <div class="field">
                  <%= f.label :name_cont, Spree::Kit.human_attribute_name(:name) %>
                  <%= f.text_field :name_cont, size: 15 %>
                </div>
              </div>
    
              <div class="col-2">
                <div class="field checkbox">
                  <label>
                    <%= f.check_box :with_discarded, { checked: params[:q][:with_discarded] == 'true', class: 'js-with-discarded-input' }, 'true', 'false' %>
                    <%= t('spree.show_deleted') %>
                  </label>
                </div>
              </div>
            </div>
    
            <div class="actions filter-actions" data-hook="admin_kits_index_search_buttons">
              <%= button_tag t('spree.search'), class: 'btn btn-primary' %>
            </div>
        <% end %>
    k
    r
    • 3
    • 4
  • t

    Tom Wilson

    03/16/2023, 9:22 PM
    I have a somewhat random question for this group. Our application has a requirement for an "estimate" API - basically, we need to be able to say "if you assembled this particular order with these variants at these prices, what would the total price look like?". It seems like we could achieve this by creating the Orders on the fly and saving them, but then at that point we end up churning the database more than we might otherwise need to. I guess I'm questioning whether it is at all a reasonable thing to attempt to create an Order in memory without saving it. Looking through some of the code, I kind of get the suspicion that there are too many callbacks/etc that will make that an impractical idea - but I'm curious if there's other suggestions. (Alternately, we could potentially explore making the changes persistent but in a transaction which is intentionally rolled back after we get what we need, but even that feels ... perilous)
    k
    b
    +3
    • 6
    • 11
  • c

    coquerel

    03/20/2023, 4:20 PM
    Hi everyone 👋 so to start I would like to know how on this kind of article, to offer to choose the size AND the color, without having all the photos on the side. For example, on this black sweatshirt, being able to choose S M or L for example, but also buttons with red and green. And in photo on the left side, just a photo of the sweatshirt in the 3 colors. On the other hand, if you choose a specific color, for example red, only photos of the red sweatshirt are displayed, but with other profiles. Next, I would like to know how to change the solidus icon in the tab. Thanks a lot for your answers :)
    k
    • 2
    • 6
  • m

    muhammet faik

    03/21/2023, 7:46 AM
    Hi Do you know solidus heroku and s3 integration tutorial link ? video or article ?
  • c

    coquerel

    03/21/2023, 8:25 AM
    Do you know how to create and connect an event to a solidus site to have the same Users and the same Admin, so that it can be managed from the interface?
  • m

    muhammet faik

    03/21/2023, 10:18 AM
    spree.rb
    spree.rb
  • m

    muhammet faik

    03/21/2023, 10:22 AM
    This my
    config/spree.rb
    file
  • m

    muhammet faik

    03/21/2023, 10:24 AM
    Its my heroku app error
    heroku logs.sh
  • m

    muhammet faik

    03/21/2023, 10:24 AM
    Whats's problem ?
  • d

    danielepalombo

    03/21/2023, 2:10 PM
    @muhammet faik the article that you followed is 7 years old. In the meanwhile, solidus has replaced paperclip with activestorage. You can try to adjust the configuration, or you can use the solidus example app https://github.com/solidusio/solidus-example-app that looks more updated.
  • d

    Daniel Senff

    03/22/2023, 12:48 PM
    Hello, I'm reading into ShippingMethods and got a question. When I create a new shipping method in the admin interface, there are the fields "Store" and the checkbox/dropdown-select "Available to all". These are not described in the documentation on https://legacy-guides.solidus.io/users/settings/shipping, what do they do?
    k
    • 2
    • 8
  • d

    Daniel Senff

    03/22/2023, 12:49 PM
    Service level is also not mentions
  • c

    coquerel

    03/22/2023, 3:48 PM
    Hi guys 👋🏼, I redid the app this morning because i broke the other one doing a db:drop rails 🤦🏼‍♀️. It's not serious. For the moment I have this as a problem: • - I still can't change the logo of the tab. favicon? • - I don't know why but my admin model was not created, which caused me class problems, I had to add "Admin::" in several controllers, and currently I I suddenly have problems on my roads. • - Then, I cannot manage the creation of an event from the admin interface, I must be on the user side but logged in as an admin to create one. Is it possible to add this on the admin interface side?? • - Tinally I separated the categories into 3. One for breeding, one for the event, and one for the shop. So I have to do basically 3 sites in 1. 🙏🏼 Thanks in advance ❤️
    k
    • 2
    • 2
  • c

    coquerel

    03/22/2023, 9:24 PM
    Why 🥺
    t
    k
    b
    • 4
    • 8
  • c

    coquerel

    03/23/2023, 10:08 AM
    How change this html ? 🤔
    k
    b
    • 3
    • 10
  • m

    muhammet faik

    03/24/2023, 10:04 AM
    It's my Dockerfile:
    Dockerfile
  • m

    muhammet faik

    03/24/2023, 10:04 AM
    I build in fly.io
  • m

    muhammet faik

    03/24/2023, 10:04 AM
    I use command fly deploy:
  • m

    muhammet faik

    03/24/2023, 10:05 AM
    error.dockerfile
    error.dockerfile
  • c

    coquerel

    03/24/2023, 11:50 AM
    Hi guys ::
    Copy code
    I think I have a tax error
    
    Because as I added two items to my menu, by default I have the impression that he wants to tax them but I would like to deactivate that. I don't use it. Look at :
    b
    • 2
    • 1
  • b

    benmorganio

    03/24/2023, 8:01 PM
    Does anyone know if it's possible to place the Solidus API at
    /solidus/api
    instead of
    /api
    ?
    e
    • 2
    • 2
  • c

    coquerel

    03/25/2023, 4:52 PM
    Copy code
    Hi guys ! I managed to make a lot of changes, thanks to you, but I'm far from getting the result I'd like. For example, I managed to create two new elements thanks to this code in the spree.rb file:                config.menu_items << config.class::MenuItem.new(
        [:event],
        'calendar',
        url: '/admin/events',
        position: 0
      )      However, they are both created in home/products/categories, and therefore inherit the ecommerce settings, which I don't want. I would like it to be really two modules apart from ecommerce, keeping the same topbar, with the 3 elements visible and clickable exaetera. Same on the homepage, I don't want to be able to see the articles, because it's not in the ecommerce element. Do you have any ideas to help me fix this please? :heart:
  • b

    benmorganio

    03/25/2023, 10:28 PM
    So I got a controlled list of products/variants and the stock item for each variant could in theory be completely different in price even if it belongs to the same variant.
  • b

    benmorganio

    03/25/2023, 10:29 PM
    How would one manage attaching the price of that stock item to an order if you cannot rely (ever) on the price of the variant?
    c
    • 2
    • 1
  • s

    Sabo

    03/27/2023, 11:28 AM
    [Solidus 3.2.2] Hello, I'm trying to add a clone route to a controller like for the Admin::ProductsController
    Copy code
    clone_admin_product    POST  /admin/products/:id/clone(.:format)  spree/admin/products#clone
    config/route.rb
    Copy code
    namespace :admin do
        resources :kits
        post 'kits/:id/clone', to: 'kits#clone'
      end
    but I get `action_dispatch/routing/route_set.rb588in
    add_route': Invalid route name, already in use: 'admin'  (ArgumentError)
    ✅ 1
    k
    • 2
    • 6
1...323334...39Latest