Code Monkey home page Code Monkey logo

spree_rails_frontend's Introduction

Spree Commerce - Open Source e-commerce platform

Spree Commerce

An open source eCommerce platform giving you full control and customizability.
Build any eCommerce solution that your business requires.

Slack · Documentation · Website · Roadmap

Gem Total Downloads Slack members

Getting Started

Visit the Quickstart Guide to set up Spree in 5 minutes.

Enterprise support

Contact us for enterprise support and custom development services. We offer:

  • migrations and upgrades,
  • delivering your Spree application,
  • optimizing your Spree stack.

Features

Customizable and modular

  • pick and choose parts you want to use
  • customize everything else (storefront, order processing, API, etc)
Spree Commerce - Storefront customization

Composable and API-first

Spree Commerce - API   Integrations

Cart and Checkout for any use case

  • advanced cart functionality
  • over 30 payment provider integrations out of the box
  • API to integrate any other payment gateway
  • robust discounts system
  • store credits, gift cards
Spree Commerce - Cart   Checkout Spree Commerce - Payments   Refunds
  • multi-currency
  • multi-language
  • full translation support for products, categories, and more
  • different shipping methods / costs for different regions
  • advanced tax calculation
Spree Commerce - Multi-region   Multi-store Spree Commerce - Multi-region

Multi-Store ready

  • host multiple brands / stores on a single Spree instance
  • each with different branding, configuration, payment methods, shipping options, product catalogs etc
Spree Commerce - Multi-store

Responsive Admin Panel

Manage and curate products, users, orders, returns, shipments & more Spree Commerce - Inventory management

Orders & Post-purchase management

Manage orders, shipments, returns and refunds Spree Commerce - Order   Return management Spree Commerce - Order Fulfillment

Why developers love it

  • Runs anywhere - cloud, VPS, Docker, Kubernetes
  • Battle Tested - used by thousands of merchants around the globe in all categories since 2007!
  • Extensions available adding new features to Spree

What you can build with Spree

Use Spree for any use case. Innovate beyond what's out there.

A headless eCommerce micro-service

Capture orders and payments for whatever you're selling - physical or digital, products or services

Spree Commerce - Composable eCommerce

Run your own marketplace with multiple suppliers, each with a dedicated supplier dashboard Spree Commerce - Marketplace

A high-ticket B2B eCommerce

Start capturing 6+ figure orders from resellers with safe payments and a checkout process that fits your business model Spree Commerce - B2B eCommerce

Wholesale eCommerce

Run your wholesale operation the way your retail partners expect Spree Commerce - Wholesale

A SaaS eCommerce platform

Launch a multi-tenant, multi-store platform for your customers, resellers, affiliates in any configuration, eg. B2B2B, B2B2C, B2B2E

Spree Commerce - Multi-store

Community & Contributing

Spree is an open source project and we love contributions in any form - pull requests, issues, feature ideas!

Follow our Contributing Guide

Join our Slack to meet other community members.

Contact

Contact us and let's go!

License

Spree is released under the New BSD License.

spree_rails_frontend's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree_rails_frontend's Issues

Shipment total manager (JS) doesn't work correctly with tax

When you are using tax included in price setting, the ShippingTotalManager will subtract tax difference between methods twice, causing wrong calculation in the checkout shipping step.
The problematic line is
var newOrderTotal = orderTotal + this.totalShipmentAmount(newShipmentTotal, oldShipmentTotal) + (newTaxTotal - oldTaxTotal)
If the last part is removed, it works correctly when Store prices are set to include tax (as is usual in EU).

Address is not updated after service calls

I've had an issue creating some custom validation on my checkout process, because the update service does not update the instance of the class it is acting on. Near this line of code, can see that the flash notice is updated with errors, but the instance @address is still the instance of the address before the service is called.
https://github.com/spree/spree_legacy_frontend/blob/bf44b73278e0efe18806fd3d8d4b343b6efadcd4/app/controllers/spree/addresses_controller.rb#L26

I admit this could be intentional to support a clean state for the @address, but in my case I want the @address with errors, so I've had to make the call and update the reference manually for some reason.

call = update_service.call(address: @address, address_params: address_params)
@address = call.value
if call.success?

User dropdown menu not show

Context

Hello,
The user dropdown menu doesn't show when click on user icon, it only shows empty box (screenshot),
I am running,
Spree 4.4
Spree_backend 4.4.0

Anyone has idea how to fix it? Thank you.

196516196-0ec7a642-ac6d-43fc-89d9-850fc4e584ee

Infinite redirect to /registration when proceeding to checkout

When not logged in, the following steps result in an infinite loop of calls to /registration and /address -

  • add any product to the cart
  • proceed to the checkout

On the browser, you get the message "This page isn’t workinglocalhost redirected you too many times."

Acccessing account page gives error

When trying to access /account, application throws error saying it can't find the UsersController. This seems to be an issue with the user controller not being extracted properly from the main app when the legacy frontend was split from the rest of the code during 4.4 release.

Upload logo didn't show

in app/helpers/spree/frontend_helper.rb line 11-31

    def logo(image_path = nil, options = {})
      logo_attachment = if defined?(Spree::StoreLogo) && current_store.logo.is_a?(Spree::StoreLogo)
                          current_store.logo.attachment # Spree v5
                        else
                          current_store.logo # Spree 4.x
                        end

      image_path ||= if logo_attachment&.attached? && logo_attachment&.variable?
                       main_app.cdn_image_url(logo_attachment.variant(resize_to_limit: [244, 104]))
                     elsif logo_attachment&.attached? && logo_attachment&.image?
                       main_app.cdn_image_url(logo_attachment)
                     else
                       asset_path('logo/spree_50.png')
                     end

      path = spree.respond_to?(:root_path) ? spree.root_path : main_app.root_path

      link_to path, 'aria-label': current_store.name, method: options[:method] do
        image_tag image_path, alt: current_store.name, title: current_store.name
      end
    end

Change blow this line code:

'''
main_app.cdn_image_url(logo_attachment.variant(resize_to_limit: [244, 104])
'''

Rails 7.1.3 it's works.

Can't override assets/images/noimage/plp.svg

If you put your own assets/images/noimage/plp.svg in your project, it will not override the one from this gem, on PRODUCTION (assets:precompile). It works on development.
Sprockets pick up both assets but they put the one from the gem in the asset manifest instead of the one from the app, which should normally have priority.

Login locale URL issue in 4.5

@wjwitek I'm not sure if all your work is already included in 4.5 versions of gems, but I was testing around with spree_starter and v4.5 legacy frontend (so '4.5' in Gemfile for all the spree gems), and I found this situation:

  • choose default language (the one that doesn't have a prefix in the URL)
  • go to login page
  • now click the globe icon and change the language to a non-default one
  • in my case it will redirect to /de-DE/login but that route does not exist

Note that if you switch language somewhere else and then click on the login link, that works fine (/login?locale=de-DE). Same thing also happens with the signup link.
In spree/spree_auth_devise#570 you link to my PR spree/spree_auth_devise#570 - does that mean you have not found another solution to this problem? As my PR itself seems mostly obsolete apart from this issue.

Could not render layout: layout preference not defined

Context

I was trying to simply setup spree frontend with the new headless spree and expected it to be a frictionless process.

Expected Behavior

After copying spree-starter-main and introducing this gem I expected to have a non-buggy shop.

Actual Behavior

It has the bug mentioned in the title.

Possible Fix

So, according to my research, this should only be a matter of a missing preference. I tried following all suggestions mentioned on this SF post but none of them seemed to work.

So, after some extra looking into the source code, my proposed change is to add the preference as a default value on app/models/spree/frontend_configuration.rb. I opened a PR with the proposed change.

Steps to Reproduce

  1. Download spree_starter-main.zip from https://github.com/spree/spree_starter/archive/main.zip
  2. Cd into the directory and add gem 'spree_frontend' to Gemfile
  3. Run rails g spree:frontend:install
  4. Run bin/setup

Ideally for me this should provide a non breaking access to localhost:4000.

Your Environment

Sprockets::DoubleLinkError

I've installed this gem in using rails 7; ruby 3. Partial section of my Gemfile:

gem 'spree_frontend'
gem 'jsbundling-rails'

gem 'spree' # core and API
gem 'spree_backend' # Rails admin panel (optional)
gem 'spree_emails' # transactional emails (optional)
gem 'spree_sample' # dummy data like products, taxons, etc
gem 'spree_auth_devise', '~> 4.3' # Devise integration (optional)
gem 'spree_gateway', '~> 3.9' # payment gateways eg. Stripe, Braintree (optional)
gem 'spree_i18n', '~> 5.0' # translation files (optional) 
 
# only needed for MacOS and Ruby 3.0
gem 'sassc', github: 'sass/sassc-ruby', branch: 'master'

After everything was installed, I started the app with bin/dev. When to localhost:3000 and got the error:

Multiple files with the same output path cannot be linked ("flags/4x3/ad.svg")
In "/Users/dev/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spree_frontend-4.5.0/app/assets/config/spree_frontend_manifest.js" these files were linked:

  • /Users/dev/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spree_frontend-4.5.0/app/assets/images/flags/4x3/ad.svg
  • /Users/dev/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/flag-icons-rails-3.4.6.1/app/assets/images/flags/4x3/ad.svg

On investigation spree_frontend has the image ad.svg and there is a gem, flag-icons-rails, is also using the same image name. How to rename?

Version 4.4.0 is incompatible with Spree Backend 4.4.1

The version 4.4.0 of this gem is incompatible with Spree Backend 4.4.1 due to javascript issues.

Context

After following all the steps to upgrade Spree to 4.4.0 following the upgrade guide, during the smoke test phase I realized that the javascript from Spree Legacy Frontend had stopped working.

I think this issue is caused because both Spree Legacy Frontend and Spree Backend define Spree.ready in their respective spree.js files in a conflictive way:

Spree Legacy Frontend v4.4.0 defines Spree.ready adding listeners to page:load and turbolinks:load events (turbo:load in main branch), while Spree Backend defines Spree.ready adding a listeners to spree:load event. Since both functions have the same name and Spree Backend is loaded after Spree Legacy Frontend, Spree.ready gets overwritten in a way that just listens to spree:load, but Spree Legacy Frontend does not know how to handle that.

Expected Behavior

Spree 4.4.x, Spree Legacy Frontend 4.4.x and Spree Backend 4.4.x are compatible.

Possible Fix

Two possible solutions come to my mind:

  • I have started exploring renaming the Spree object in Spree Legacy Frontend javascript files as SpreeFrontend. But so far it raises a NameError at lib/spree/frontend/configuration.rb:3:in telling <module:Frontend>: uninitialized constant Spree::Preferences.
  • Reworking Spree Legacy Frontend javascript files so that Spree.ready listener also listens to spree:load, although that would imply maintaining a dependency between Spree Legacy Frontend and Spree Backend, which probably makes this less desirable long term.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.