- 8
Hi all,
We have bought Nop Beauty Responsive Templates, and before to install it, we have an order attributes by number of product who contains this attribute.
[Sample]
With :
Product_1 contains size : XS, S, L, XL
Product_2 contains size: S, XL, XXL
Product_3 contains size: S,L, XXL
attributs will be display like that :
size :
1. S (3)
2. L (2)
3, XXL (2)
4. XL (2)
5, XS (1)
[/Sample]
To do this we had edit : ¨ProductLoadAllPaged" and replace:
this
INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId])
SELECT DISTINCT [psam].SpecificationAttributeOptionId
FROM [Product_SpecificationAttribute_Mapping] [psam] with (NOLOCK)
WHERE [psam].[AllowFiltering] = 1
AND [psam].[ProductId] IN (SELECT [pi].ProductId FROM #PageIndex [pi])
by that
INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId])
SELECT [psam].SpecificationAttributeOptionId
FROM [Product_SpecificationAttribute_Mapping] [psam] with (NOLOCK)
WHERE [psam].[AllowFiltering] = 1
AND [psam].[ProductId] IN (SELECT [pi].ProductId FROM #PageIndex [pi])
group by [psam].SpecificationAttributeOptionId
order by count([psam].ProductId) desc
But with NopAjaxFilters this order is not keep because NopAjaxFilters use a new procedure with encryption. So we have find this procedure without encryption to edit it, again (it's was not easy to do this but we have do it).
In your procedure we have try to do that, replace:
that
--INSERT INTO #FilterableProductVariantIdsDistinct ([ProductVariantAttributeId])
--SELECT DISTINCT ProductVariantAttributeId
--FROM #FilterableProductVariantIds
by that
INSERT INTO #FilterableProductVariantIdsDistinct ([ProductVariantAttributeId])
SELECT ProductVariantAttributeId
FROM #FilterableProductVariantIds
GROUP BY ProductVariantAttributeId
ORDER BY count(ProductId).
But order not working whatever we edit, this list is only order by Name. (i have try to manufacturer, but it's the same things).
We Need Help.
PS : Why do you Encrypt your StoredProcedure ??
We have bought Nop Beauty Responsive Templates, and before to install it, we have an order attributes by number of product who contains this attribute.
[Sample]
With :
Product_1 contains size : XS, S, L, XL
Product_2 contains size: S, XL, XXL
Product_3 contains size: S,L, XXL
attributs will be display like that :
size :
1. S (3)
2. L (2)
3, XXL (2)
4. XL (2)
5, XS (1)
[/Sample]
To do this we had edit : ¨ProductLoadAllPaged" and replace:
this
INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId])
SELECT DISTINCT [psam].SpecificationAttributeOptionId
FROM [Product_SpecificationAttribute_Mapping] [psam] with (NOLOCK)
WHERE [psam].[AllowFiltering] = 1
AND [psam].[ProductId] IN (SELECT [pi].ProductId FROM #PageIndex [pi])
by that
INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId])
SELECT [psam].SpecificationAttributeOptionId
FROM [Product_SpecificationAttribute_Mapping] [psam] with (NOLOCK)
WHERE [psam].[AllowFiltering] = 1
AND [psam].[ProductId] IN (SELECT [pi].ProductId FROM #PageIndex [pi])
group by [psam].SpecificationAttributeOptionId
order by count([psam].ProductId) desc
But with NopAjaxFilters this order is not keep because NopAjaxFilters use a new procedure with encryption. So we have find this procedure without encryption to edit it, again (it's was not easy to do this but we have do it).
In your procedure we have try to do that, replace:
that
--INSERT INTO #FilterableProductVariantIdsDistinct ([ProductVariantAttributeId])
--SELECT DISTINCT ProductVariantAttributeId
--FROM #FilterableProductVariantIds
by that
INSERT INTO #FilterableProductVariantIdsDistinct ([ProductVariantAttributeId])
SELECT ProductVariantAttributeId
FROM #FilterableProductVariantIds
GROUP BY ProductVariantAttributeId
ORDER BY count(ProductId).
But order not working whatever we edit, this list is only order by Name. (i have try to manufacturer, but it's the same things).
We Need Help.
PS : Why do you Encrypt your StoredProcedure ??