Skip to content

Module - E-commerce (Nanoxi.Cms.Shop / uCommerce)

La couche e-commerce, optionnelle et activee par client. Compile via StarterKitv3_shop.sln (~28 projets Nanoxi.Cms.Shop.*), integre uCommerce 8.4.1 (8.4.1.19353) a Umbraco 7.

Activation par client

  • Le shop est compile/installe uniquement si le client a le module Shop active dans doc/StarterKitv3_InfosTechniques.json (IsShopEnabled()).
  • Quand actif :
    • Build-Shop compile StarterKitv3_shop.sln.
    • Install-uCommerce installe uCommerce (extraction package + SQL + config).
    • les postbuild shop copient les artefacts vers website/.
    • Remove-NanoxiShopIHttpModule ajuste la config en review-app.
  • Un client vitrine saute entierement cette couche.

Projets shop

ProjetResponsabilite
Shop.ApiEndpoints API shop. Point d'entree synchro : ProductSynchroApiController.Synchro()
Shop.UCommerce / Shop.UCommerceWebFormsIntegration uCommerce (pipelines, WebForms)
Shop.Module / Shop.DataLogique metier + acces donnees shop
Shop.SynchronizationSynchro catalogue ; conteneur IoC SynchroWindsorContainer (Castle Windsor)
Shop.Shipping / Shop.Stock / Shop.TrackAndTraceMethodes de livraison, gestion stock, suivi colis
Shop.Print / Shop.ExportDocuments PDF (confirmation de commande), exports
Shop.Member.Data / Shop.Member.MvcComptes clients shop
Shop.Widget / Shop.Mvc / Shop.WebFormsUI shop (widgets, controllers, webparts)
Shop.Validation / Shop.Setting / Shop.I18n / Shop.Mail / Shop.Util / Shop.Definition / Shop.Extension / Shop.Resources / Shop.Backoffice / Shop.Interface / Shop.Base / Shop.Customization / Shop.MigrationsValidation, parametres, traductions, mails, utilitaires, ressources, backoffice, contrats, migrations
Shop.IedsUtilUtilitaires specifiques au client IEDS (ex. IedsTools.cs)

IoC

uCommerce utilise Castle Windsor. La synchro shop s'appuie sur Shop.Synchronization.SynchroWindsorContainer. Les pipelines uCommerce (ex. AddToBasket) sont configurables ; exemple : ValidateProductToBasketTask pour restreindre le mix de catalogues (cas IEDS).

Synchronisation catalogue (cas IEDS / Opale)

  • Synchro planifiee (08h) via un module Quartz appelant /Umbraco/Api/ProductSynchroApi/Synchro/.
  • Traitement specifique client : Nanoxi.Cms.Custom.Ieds.Shop.Synchro.CustomSynchroManager.WorkSynchro(...).
  • Echange de fichiers avec l'ERP Opale (dossiers csvimport, toOpale, BackupOpaleFileOrder, ...). Voir customer-skins.md (IEDS) et ReadmeCustomer.md.
  • Acces utilisateur configures cote uCommerce : "Service demandeur opale" (autorisation de commande par catalogue, format CodeCatalogue|ServiceDemandeurClient|NumeroSociete) et "Groupe de membres" (affichage des categories).

Documents

Les confirmations de commande PDF sont generees par Shop.Print (sortie ex. C:\ieds_shared\SitesData\<skin>\OrderConfirmation).

Checkout invité et pieges des comptes "GUID"

Le parcours "commander en tant qu'invite" (AppMemberController.ProfileNewGuest, base) genere un GUID, le stocke dans Session["GuestUsername"] / Session["GuestIntranetMember"], puis appelle FormsAuthentication.SetAuthCookie(guid, true) : l'identite de l'invite est donc un GUID. GuestUtil.IsGuest() ne fait que tester si User.Identity.Name a la forme d'un GUID.

Deux pieges en decoulent :

  • Materialisation du guest en vrai membre : si le pipeline checkout du client utilise la tache standard uCommerce CreateMemberForCustomerTask au lieu de la tache Nanoxi CreateMemberAndGuestForCustomerTask (qui, elle, saute les invites quand GuestPreferedPayment != null), le checkout invite cree un vrai membre Umbraco dont le LoginName = le GUID. Ce client est alors piege : a chaque reconnexion (par email -> resolu vers le loginname GUID), IsGuest() retourne true. Verifier la config par client dans prodconfig/<skin>/uCommerce/Pipelines/Baskets.Checkout.config (biofruits / pforet / ieds utilisent la tache Nanoxi ; davidchoco utilisait la tache standard).
  • Session perdue mais cookie persistant : le cookie d'auth (GUID) est persistant alors que la Session serveur est volatile (recyclage app pool, expiration). Un "invite" peut donc revenir authentifie sans ses donnees de session.

Cote checkout, CheckoutController.PrepareViewModel() doit donc se garder du cas IsGuest() == true mais Session["GuestIntranetMember"] == null : on charge alors le membre reel via MemberService.GetByUsername(Identity.Name) (cas des comptes GUID), sinon FormsAuthentication.SignOut(). Sans ce garde, on passait (IntranetMember)null au constructeur de copie IntranetMember(IntranetMember im) -> NullReferenceException (crash checkout + login qui "ne fait rien").

Lister les comptes GUID d'une base : SELECT nodeId, LoginName, Email FROM cmsMember WHERE TRY_CONVERT(uniqueidentifier, LoginName) IS NOT NULL.

Changelog

Le shop a son propre journal : CHANGELOGSHOP.md (versionne v2.x, distinct du CHANGELOG.md base en v3.x).

Contributors

No contributors

Changelog

No recent changes