An open API service indexing awesome lists of open source software.

https://github.com/sean-codes/cs-discount

Front-End Discount Interface
https://github.com/sean-codes/cs-discount

Last synced: 12 months ago
JSON representation

Front-End Discount Interface

Awesome Lists containing this project

README

          

# cs-discount
Front-End Discount Interface

![Alt text](https://raw.githubusercontent.com/sean-codes/cs-discount/master/img/couponform.png)

Dynamically building conditions

![Alt text](https://raw.githubusercontent.com/sean-codes/cs-discount/master/img/conditions.gif)

HTML for inline inputs

//class: inlineInput to get initialized
//data-input: type of input (select, text, number)
//data-optiongroup: the group of options to use for this input
//name: the value this can be (aggregator, operator, value)
//multiple=multiple: for multi select options
ALL

HTML for nests (combinations)

//nest: the type of nest this is
//class: nest to get initialized
//html: needs a aggregator and value
//ul with li and button (will be moving this to javascript side)

If ALL of these conditions are TRUE${conditions.deleteButtonHTML}

  • ${conditions.addButtonHTML}


Data Structure for options:

optionName: {
options: {
label: 'string',
value: 'is optional'
}
}

Data Structure for nests:

conditions.nests = {
nestName: {
label: 'Condition Combination',
options: 'combination, productCombination, cart',
priority: 1,
list: {
main: {
label: 'Condition Combination',
html: `

If ALL of these conditions are TRUE

  • ${conditions.addButtonHTML}


`
}
}
}