& Customisation

Make a reference to the Snipcart commerce NuGet package and start your site. The dynamic module will be installed along with a reference to the class library and a few sample files to get you started.

Add the NuGet Package

Once you have downloaded the package create a local package source (or add it to an existing one you have access to ) and build your project.

The package will extract and place a Module import zip file into the /App_Data folder which you will need to import into your project. This will create the Snipcart commerce dynamic module.

I really wanted to use the Sitefinity Add-on install that would have automatically added the moduel on start up but there is an issue. If you add your own fields and the package is upgraded then your custom fields will be deleted. You can read more about it in this post. For know I create a import zip file which will mean that any future changes can be manually managed to ensure no loss of data.

Customise your view

When installed you will find a folder under the /ResourcePackages called 'Snipcart'. You will find the current Razor View template files here which you can copy into your own template folder.

The folder is not an actual package template and shouldn't be used as such. Any updates to the package will look to override what is in this folder so it should be considered a reference and is not required to be deployed.
Snipcart resource folder

Customise Snipcart

Snipcart displays run on Vue templates and as such you can override the default Snipcart HTML and customise them. You can learn about this in the Snipcart documentation but the place to do make those changes is by customising the Core Widget template. In here you can find the Snipcart div element.

<div hidden id="snipcart" data-api-key="@Model.ApiKey"></div>

Migration Script

Also included as part of the installation is a sample page to migrate your Sitefinity eCommerce products to Snipcart commerce products. The code includes gathering Sitefinity Attributes and creating Snipcart variations.

The code/script is located under the Sitefinity folder and is a self-contained .aspx web form file(s). Do consider removing it from your project when it is no longer needed.

Snipcart migrate script

It goes without saying, run and test this on a backup copy of your site and data first. Have a study of the code to see what it is doing and adjust it to suit your environment. If you need help I am available.