| Line 29... |
Line 29... |
| 29 |
except:
|
29 |
except:
|
| 30 |
pass
|
30 |
pass
|
| 31 |
|
31 |
|
| 32 |
con = None
|
32 |
con = None
|
| 33 |
es = None
|
33 |
es = None
|
| - |
|
34 |
try:
|
| 34 |
from elasticsearch import Elasticsearch
|
35 |
from elasticsearch import Elasticsearch
|
| - |
|
36 |
except:
|
| - |
|
37 |
pass
|
| 35 |
from shop2020.config.client.ConfigClient import ConfigClient
|
38 |
from shop2020.config.client.ConfigClient import ConfigClient
|
| 36 |
|
39 |
|
| 37 |
DataService.initialize(db_hostname="localhost")
|
40 |
DataService.initialize(db_hostname="localhost")
|
| 38 |
mc = MemCache("127.0.0.1")
|
41 |
mc = MemCache("127.0.0.1")
|
| 39 |
config_client = ConfigClient()
|
42 |
config_client = ConfigClient()
|
| Line 836... |
Line 839... |
| 836 |
except:
|
839 |
except:
|
| 837 |
item[0]['ppq'] = 0
|
840 |
item[0]['ppq'] = 0
|
| 838 |
if filterData is None:
|
841 |
if filterData is None:
|
| 839 |
if item[0]['category_id']!=6:
|
842 |
if item[0]['category_id']!=6:
|
| 840 |
try:
|
843 |
try:
|
| 841 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+item[0]['brand']+'&filter=brand&brands='+str(int(item[0]['brand_id']))
|
844 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+urllib.urlencode(item[0]['brand'])+'&filter=brand&brands='+str(int(item[0]['brand_id']))
|
| 842 |
item[0]['filterText'] = 'More %s items'%(item[0]['brand'])
|
845 |
item[0]['filterText'] = 'More %s items'%(item[0]['brand'])
|
| 843 |
except:
|
846 |
except:
|
| 844 |
item[0]['filterLink'] = ""
|
847 |
item[0]['filterLink'] = ""
|
| 845 |
item[0]['filterText'] = ""
|
848 |
item[0]['filterText'] = ""
|
| 846 |
else:
|
849 |
else:
|
| 847 |
try:
|
850 |
try:
|
| 848 |
if item[0]['subCategory']=='' or item[0]['subCategory'] is None or item[0]['subCategoryId']==0:
|
851 |
if item[0]['subCategory']=='' or item[0]['subCategory'] is None or item[0]['subCategoryId']==0:
|
| 849 |
raise
|
852 |
raise
|
| 850 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+item[0]['subCategory']+'&filter=subcategory&subcategories='+str(int(item[0]['subCategoryId']))
|
853 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+urllib.urlencode(item[0]['subCategory'])+'&filter=subcategory&subcategories='+str(int(item[0]['subCategoryId']))
|
| 851 |
item[0]['filterText'] = 'More %s'%(item[0]['subCategory'])
|
854 |
item[0]['filterText'] = 'More %s'%(item[0]['subCategory'])
|
| 852 |
except:
|
855 |
except:
|
| 853 |
item[0]['filterLink'] = ''
|
856 |
item[0]['filterLink'] = ''
|
| 854 |
item[0]['filterText'] = ""
|
857 |
item[0]['filterText'] = ""
|
| 855 |
try:
|
858 |
try:
|
| Line 1814... |
Line 1817... |
| 1814 |
except:
|
1817 |
except:
|
| 1815 |
item[0]['ppq'] = 0
|
1818 |
item[0]['ppq'] = 0
|
| 1816 |
|
1819 |
|
| 1817 |
if item[0]['category_id']!=6:
|
1820 |
if item[0]['category_id']!=6:
|
| 1818 |
try:
|
1821 |
try:
|
| 1819 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+item[0]['brand']+'&filter=brand&brands='+str(int(item[0]['brand_id']))
|
1822 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+urllib.urlencode(item[0]['brand'])+'&filter=brand&brands='+str(int(item[0]['brand_id']))
|
| 1820 |
item[0]['filterText'] = 'More %s items'%(item[0]['brand'])
|
1823 |
item[0]['filterText'] = 'More %s items'%(item[0]['brand'])
|
| 1821 |
except:
|
1824 |
except:
|
| 1822 |
item[0]['filterLink'] = ""
|
1825 |
item[0]['filterLink'] = ""
|
| 1823 |
item[0]['filterText'] = ""
|
1826 |
item[0]['filterText'] = ""
|
| 1824 |
else:
|
1827 |
else:
|
| 1825 |
try:
|
1828 |
try:
|
| 1826 |
if item[0]['subCategory']=='' or item[0]['subCategory'] is None or item[0]['subCategoryId']==0:
|
1829 |
if item[0]['subCategory']=='' or item[0]['subCategory'] is None or item[0]['subCategoryId']==0:
|
| 1827 |
raise
|
1830 |
raise
|
| 1828 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+item[0]['subCategory']+'&filter=subcategory&subcategories='+str(int(item[0]['subCategoryId']))
|
1831 |
item[0]['filterLink'] = '/category/'+str(int(item[0]['category_id']))+'?searchFor='+urllib.urlencode(item[0]['subCategory'])+'&filter=subcategory&subcategories='+str(int(item[0]['subCategoryId']))
|
| 1829 |
item[0]['filterText'] = 'More %s'%(item[0]['subCategory'])
|
1832 |
item[0]['filterText'] = 'More %s'%(item[0]['subCategory'])
|
| 1830 |
except:
|
1833 |
except:
|
| 1831 |
item[0]['filterLink'] = ''
|
1834 |
item[0]['filterLink'] = ''
|
| 1832 |
item[0]['filterText'] = ""
|
1835 |
item[0]['filterText'] = ""
|
| 1833 |
try:
|
1836 |
try:
|