Skip to main content
All CollectionsAdvanced TopicsIntegration
Discount Ninja and version control systems
Discount Ninja and version control systems

Learn which files you should avoid adding to version control systems

Bart Coppens avatar
Written by Bart Coppens
Updated over 3 years ago

GENERAL GUIDANCE

It is advised to remove Discount Ninja assets from version control systems to avoid overriding the settings of the app.

To exclude the assets, simply ensure your version control system does not include any files that include the words limoniapps or discountninja.

Discount Ninja assets

Discount Ninja includes a number of assets, some of which are dynamic and others that are periodically overwritten. The sections below provide additional details per class of assets.

Script file

If you've opted to have the script file installed as an asset, you can choose to include it in your version control system. When new versions of the app are released you may need to update the script file (this is done via the Settings > General > Assets module of the app). You'll then need to update the file in your version control system.

The name of the script's asset is: limoniapps-discountninja.js or limoniapps-discountninja.min.js

If you've opted to have the script file downloaded as a Shopify script tag, there is no action required.

Building blocks

Some assets contain templates of building blocks. They are overwritten when the configuration of those building blocks is changed in the app. Therefore, adding them to your version control system may cause the content of these files to be out of sync with the configuration in the app. This may impact the look and feel of the building blocks.

The following assets contain building block templates:

  • limoniapps-discountninja-badge.liquid

  • limoniapps-discountninja-cartdiscountfield.liquid

  • limoniapps-discountninja-giftbox.liquid

  • limoniapps-discountninja-notification.liquid

  • limoniapps-discountninja-popup.liquid

  • limoniapps-discountninja-promotionsummary.liquid

  • limoniapps-discountninja-stickybar.liquid

  • limoniapps-discountninja-triggerbutton.liquid

  • limoniapps-discountninja-volumediscounts.liquid

It is not advised to store these files in a version control system.

If these files are not available on your theme, you can restore them by clicking "Update assets" in the Settings > General > Assets module of the app.

Style sheet

The app dynamically builds a style sheet, based on the settings of the building blocks in the Settings modules as well as the configuration of each of the promotions.

This style sheet is stored in the asset: limoniapps-discountninja.css.liquid

It is not advised to store this file in a version control system.

The app regenerates the style sheet when a promotion is saved or the settings of the app are saved.

If you need to override the generated CSS, you can add those overrides in the app (Settings > Assets > CSS). This ensures that the overrides are present in any theme you run Discount Ninja on. It also ensures that the overrides are removed if Discount Ninja is removed from the shop.

Header and body

The content of the header and body assets is changed when:

  • the app is enabled or disabled (Settings > General > Status module)

  • the script modus is changed from script to asset or vice versa

The header is stored in the limoniapps-discountninja-header.liquid asset and the body in the limoniapps-discountninja-body.liquid asset.

These assets, when stored in a version control system can, therefore, override these settings, which can have important side-effects.

It is not advised to store these files in a version control system.

If these files are not available on your theme, you can restore them by clicking "Update assets" in the Settings > General > Assets module of the app.

Flags

The app contains a number of flags that can be used to change the behavior of the app. Flags are rarely required and should typically not be changed. The flags are stored in the limoniapps-discountninja-context-flags.liquid asset.

This file can be included in a version control system.

Settings

The settings that are configured in the app are stored in an asset named limoniapps-discountninja-context-settings.liquid.

It is not advised to store these files in a version control system.

The app regenerates the settings context file when a promotion is saved or the settings of the app are saved.

Context

The context asset limoniapps-discountninja-context.liquid contains static content.

It is not advised to store these files in a version control system.

If this file is not available on your theme, you can restore it by clicking "Update assets" in the Settings > General > Assets module of the app.

Did this answer your question?