filter: {
category: false,
tag: false,
items: [
{
name: 'Game',
multiple: true,
logic: 'and',
multipleLogic: 'or',
closedSubOptions: true,
sort: 'asAllowed',
getAttr: 'categories',
allowedOptions: [
'Magic: The Gathering'
// add Pokémon, Yu-Gi-Oh!, etc. later
]
},
{
name: 'Set',
multiple: true,
logic: 'and',
multipleLogic: 'or',
closedSubOptions: true,
sort: 'asAllowed',
getAttr: 'categories',
allowedOptions: [
'Tarkir: Dragonstorm',
'Tarkir: Dragonstorm > Commons',
'Tarkir: Dragonstorm > Uncommons',
'Tarkir: Dragonstorm > Rares',
'Tarkir: Dragonstorm > Mythics',
'Tarkir: Dragonstorm > Lands',
'Commander 2022',
'Commander 2022 > Commons',
'Commander 2022 > Uncommons',
'Commander 2022 > Rares',
'Commander 2022 > Mythics',
'Commander 2022 > Lands',
// …repeat for each set…
]
},
{
name: 'Rarity',
multiple: true,
logic: 'or',
sort: 'asAllowed',
// no getAttr here — just fixed values
values: [
'Commons',
'Uncommons',
'Rares',
'Mythics',
'Lands'
]
},
{
name: "Tags",
multiple: true,
getAttr: "tags"
},
{
name: "Availability",
multiple: false,
getAttr: function(el, data){
if(el.hasClass && (el.hasClass('sold-out')||el.one && el.one('.product-mark.sold-out'))){ return 'Sold Out'; }
if(el.classList && (el.classList.contains('sold-out') || el.querySelector('.product-mark.sold-out'))){ return 'Sold Out'; }
return 'Available';
}
}
]
},