|
|
|
@ -1,5 +1,6 @@ |
|
|
|
from .models import Product |
|
|
|
from .models import Product |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_variant_picker_data(product): |
|
|
|
def get_variant_picker_data(product): |
|
|
|
variants = product.variants.all() |
|
|
|
variants = product.variants.all() |
|
|
|
variant_attributes = product.attributes.all() |
|
|
|
variant_attributes = product.attributes.all() |
|
|
|
@ -29,11 +30,10 @@ def get_variant_picker_data(product): |
|
|
|
|
|
|
|
|
|
|
|
return data |
|
|
|
return data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def expand_categories(categories): |
|
|
|
def expand_categories(categories): |
|
|
|
products = None |
|
|
|
products = None |
|
|
|
for e in categories: |
|
|
|
for e in categories: |
|
|
|
if e.name.startswith('None'): |
|
|
|
if e.name.startswith('None'): |
|
|
|
products = Product.objects.filter(category=e) |
|
|
|
products = Product.objects.filter(category=e) |
|
|
|
return [x for x in categories if not x.name.startswith('None')], products |
|
|
|
return [x for x in categories if not x.name.startswith('None')], products |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|