Git Product home page Git Product logo

vc-storefront's Introduction

Virto Commerce Storefront Kit

CI status Quality gate Reliability rating Security rating Sqale rating Lines of code

Deploy to Azure

The Virto Commerce Storefront Kit is the official online shopping website based on the Virto Commerce Platform, written on ASP.NET 8. The website serves as a client application for the VC Platform and communicates solely through public APIs.

The Storefront Kit enables the creation of multiple distinct stores (websites) on top of the Virto Commerce Platform. Each store may have its own theme with specific layouts, yet still be based on the same catalog and customer data. This allows for versatile store configurations, such as:

  • Different designs for various product categories.
  • Regional-specific sites offering tailored product sets.
  • Integration with multiple touchpoints for a true omnichannel experience.

Key features

  • Launch and host e-commerce themes on top of the Virto Commerce Platform.
  • XAPI Gateway.
  • Caching mechanism.
  • Multi-store support.
  • Multi-theme support.
  • Server-side rendering. And more.

Architecture

For detailed information about the Virto Storefront Architecture, please refer to our developer guide

Technologies and frameworks used

  • ASP.NET 8
  • ASP.NET Identity Core

Setup

For detailed setup information, please refer to Quick Start to deploy and run.

Themes

B2B Theme

View B2B theme on GitHub.

image

FAQ

Running the Storefront only on HTTP schema

  • In order to run the platform only at HTTP schema in production mode, it's enough to pass only HTTP URLs in --urls argument of the dotnet command.
  dotnet VirtoCommerce.Storefront.dll --urls=http://localhost:5002

Running the Platform on HTTPS schema

  • Install and trust HTTPS certificate

Run to trust the .NET Core SDK HTTPS development certificate:

    dotnet dev-certs https --trust

Read more about enforcing HTTPS in ASP.NET Core

    dotnet VirtoCommerce.Storefront.dll --urls=https://localhost:4302/
  • Trust the .Net Core Development Self-Signed Certificate. More details on trusting the self-signed certificate can be found here

Forward the scheme for Linux and non-IIS reverse proxies

Apps that call UseHttpsRedirection and UseHsts put a site into an infinite loop if deployed to an Azure Linux App Service, Azure Linux virtual machine (VM), Linux container or behind any other reverse proxy besides IIS. TLS is terminated by the reverse proxy, and Kestrel isn't made aware of the correct request scheme. OAuth and OIDC also fail in this configuration because they generate incorrect redirects. UseIISIntegration adds and configures Forwarded Headers Middleware when running behind IIS, but there's no matching automatic configuration for Linux (Apache or Nginx integration).

To forward the scheme from the proxy in non-IIS scenarios, set ASPNETCORE_FORWARDEDHEADERS_ENABLED environment variable to true.

For more details on how it works, see the Microsoft documentation.

References

License

Copyright (c) Virto Solutions LTD. All rights reserved.

Licensed under the Virto Commerce Open Software License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://virtocommerce.com/opensourcelicense

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

vc-storefront's People

Contributors

akak1977 avatar alivemen avatar andrew-orlov avatar andrewehlo avatar anton-abyzov avatar artem-dudarev avatar artmakarov avatar asvishnyakov avatar avas avatar basilkot avatar dvs39 avatar eugeneokhriemnko avatar htrbr avatar ilyawzrd avatar kostyrin avatar krankenbro avatar ksavosteev avatar mvktsk avatar n2pro avatar olegoo avatar omnidark avatar pushnitsa avatar t13ka avatar tatarincev avatar trueboroda avatar vc-ci avatar vectorfield4 avatar vkrashenko avatar woland2k avatar yecli avatar

Stargazers

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

Watchers

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

vc-storefront's Issues

Displays wrong currency symbol on Thank you page

@jarbi says:

Hello. I'm having some issues with the storefront "clothing" theme. I've set my currency symbol in admin and all works ok except that on the "Thank you" page the currency symbol is the default "kr" instead of the in admin defined "SEK".

I have located the issue to this line: https://github.com/VirtoCommerce/vc-storefront/blob/90089bbd18ad5eca2112e3d7a35876ec9ba34e86/VirtoCommerce.Storefront/Binders/CartTypesModelBinder.cs#L57

How to reproduce:
Add item to cart, go to checkout. finish order. When order is created then a "thank you" page is shown.
With in my case, wrong currency suffix

Allow to disable cache

Version info:

  • Storefront version: 3.0.5

Expected behavior

Storefront must provide configuration setting to disable memory cache on storefront.

Actual behavior

There is no setting for that

Make changes in default themes to avoid incompatibilities with old storefront version

Add {% Layout %} tag to all templates which are don't use default layout
Checkout, Account

Change Page.liquid template to always render static content
{% layout page.layout %} {{ page.content | render }}

Add to templates\customers\reset_password.liquid new lines

	  <input type="hidden" value="{{ reset_password.token }}" name="customer[token]" id="token">
	  <input type="hidden" value="{{ reset_password.email }}" name="customer[email]" id="email">
``` for correct password reset

(optional) Now instead CustomerInfo we are using User type which encapsulated  Contact as property need to change all js and templates according to this fact. Also, these changes affected the Cart and QuoteRequest model. 
List of files for change:  `Checkout.liquid`, `main.js`, `account.js` and other 

IIS Url Rewrite role doesn't work

Expected behavior

See staging content from robots.staging.tx

Actual behavior

See main robots.txt

Steps to reproduce

  1. Add rule
<rule name="Robots.txt for production domain only" stopProcessing="true">
            <match url="robots.txt" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^(virtocommerce\.com)$" negate="true"/>
            </conditions>
            <action type="Rewrite" url="/robots.staging.txt" />
        </rule>
  1. Open https://vc-public-qc.azurewebsites.net/robots.txt
  2. Should see content from robots.staging.txt

Theme location discovery reporting is not implemented correctly

The discovery paths of where template is resolved should be added at the time of resolution instead of after the fact using: _liquidThemeEngine.DiscoveryPaths.

Currently "_liquidThemeEngine.DiscoveryPaths" is simply a static method that is calculated based on preconfigured discovery folders paths. Instead find template should return a view object which when view view is not found contains collection of absolute paths view was searched in.

Error with IIS Url Rewrite rule for Redirect

Expected behavior

Redirect to new correct url

Actual behavior

NullReferenceException: Object reference not set to an instance of an object. with rule

Steps to reproduce

  1. Add a new rewritre rule into IISUrlRewrite.xml
        <rule name="Redirect Blogs to Blog" stopProcessing="true">
            <match url="^blogs/news/(.+)" />
            <conditions trackAllCaptures="true" />
            <action type="Redirect" url="blog/{R:1}" />
        </rule>
  1. Open https://vc-public-qc.azurewebsites.net/blogs/news/agile-platform

  2. Get error
    NullReferenceException: Object reference not set to an instance of an object.

Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.ConditionEvaluator.Evaluate(ConditionCollection conditions, RewriteContext context, BackReferenceCollection backReferences)
Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISUrlRewriteRule.ApplyRule(RewriteContext context)
Microsoft.AspNetCore.Rewrite.RewriteMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware+d__3.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
VirtoCommerce.Storefront.Middleware.ApiErrorHandlingMiddleware+d__3.MoveNext() in ApiErrorHandlingMiddleware.cs

Testing the storefront on Azure

Url where storefront core deployed
https://vc-storefront-core.azurewebsites.net

Any founded bugs you can write on this issue.

Some use cases for testing:

  1. Categories navigation
  2. Products filtration bt properties
  3. Add / Remove products in cart
  4. Checkout
  5. Registration, Login, Google login
  6. Anonymous cart merging when login
  7. New addresses adding when new order placed
  8. User cabinet (change password, add/edit/delete addresses, see order list)
  9. Discounts (on product list, enter coupon in checkout)
  10. Change currency, language
  11. Blogs, pages

Limits anonymous access for CMS pages.

As a Content Manager, I want to limit access to anonymous access for CMS pages.

want to block anonymous access to the page.

GIVEN Anonymous user
GIVEN CMS Page with Authorize = false.
WHEN Open CMS Page
THEN Should be redirected to login
THEN After registration I should be redirected to CMS Page and be able to see content.

Use authorize property to true/false

Set to true if you want to block anonymous access to the page.
Set to false if you want to allow anonymous access to the page.
Default value is false

Rename repository to vc-core-storefront

Currently we have the following repos:
vc-storefront
vc-theme-*
vc-platform
vc-module-*

After migration to .NET Core we may want to have the following structure:
vc-core-storefront
vc-core-platform
vc-core-module-*

instead of
vc-storefront-core
vc-platform-core
vc-module-*-core

Fails to compile scss files on linux vm

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Failed to compile sass file "/Themes/Electronics/default/assets/default.scss.liquid"
Line:
Compiler error: The type initializer for 'LibSassHost.SassCompiler' threw an exception.

Implement API for bulk update

@asvishnyakov commented on Fri Sep 15 2017

In ApiCartController add copies of AddItemToCart, ChangeCartItem, RemoveCartItem method, but allow to pass multiple items instead of single, i.e.

AddItemToCart([FromBody] AddCartItem cartItem) → AddItemToCart([FromBody] AddCartItem[] cartItems)

In CartBuilder add copies of AddItemAsync & AddLineItemAsync, etc. and allow to pass multiple items instead of single, i.e.:

public class CartItem
{
    public Product Product { get; set; }
    public int Quantity { get; set; }
}

AddItemAsync(Product product, int quantity) → AddItemsAsync(IEnumerable<CartItem> items)
AddLineItemAsync(LineItem lineItem) → AddLineItemAsync(IEnumerable<LineItem> lineItems)

View is searched in incorrect paths and full paths are not displayed

Currently views are searched inside the following folders:

Themes/Clothing/default/templates
Themes/Clothing/default/snippets
Themes/Clothing/default/layout
Themes/Clothing/default/assets

The view like "index.liquid" should never be searched in any folder besides "templates".

Same goes with snippets (includes inside liquid), they should only be searched inside "snippets" folder. And layouts should only be seached inside "layout".

Invalidate cache when theme changed

Version info:

  • Browser version: Chrome 63
  • Platform version: 2.13.19
  • Storefront version: 3.0.5

Expected behavior

Storefront cache should be invalidated when theme files changed.

Actual behavior

Nothing happens when Azure blob provider used. Locally working normal.

CMS PoC

Purpose

Prepare CMS proof of concept to demonstrate page rendering by providing a definition in JSON and defining visual blocks in the theme as snippets.

Requirements

  • page definition (meta description) should be prepared manually in JSON format.
  • simple visual blocks should be used for page definition: image and text
  • use default (electronic) theme

Acceptance criteria

  • GIVEN three files are prepared: page definition in JSON format, two liquid snippets for representing image and text blocks WHEN open test page on storefront THEN page with sample image and text should be displayed

Definition of Done

  • Documentation: About Json page, How to create json page, How to customize UI block snippet
  • Release vc-storefront-core with Json pages

Write/Edit new deployment documentations

-[ ] Installation from source code
-[ ] Installation precompiled version
-[ ] Deploy to Azure from Visual Studio
-[ ] Deploy to Azure from GitHub
-[ ] List of changes

Electronics theme displays clothing homepage catalog

To replicate, set envrionmental variable to clothing on startup, so it opens clothing store first and then switch to electronics store:

  "environmentVariables": {
    "VirtoCommerce:DefaultStore": "Clothing",
    "ASPNETCORE_ENVIRONMENT": "Development"
  },

You get this incorrect homepage:

image

Implement cache expiration based on Azure blob triggers

Invalidate User cache when we add external login

We should invalidate cache when add external login into current account.

For example when we use AddLoginAsync
https://github.com/VirtoCommerce/vc-storefront-core/blob/21710b9c30989aa3a9fec270a45a61ad41d01c33/VirtoCommerce.Storefront/Domain/Security/CustomUserManager.cs#L137

Expected behavior

Add external login and see correct externalLogins collection when I load account info.

Actual behavior

Add external login. See empty externalLogins because we cached it in FindByEmailAsync, FindByNameAsync and etc.
I can resolve issue by storefront restart only.

Steps to reproduce

  1. Sign-in
  2. Assign external login (Google, Facebook) into current account
  3. See wrong status or Call /storefrontapi/account and see empy externalLogins ((

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.