Jump to content

creating a dynamic discount filter in layered navigation block


Recommended Posts

Hello,

Note: This is regarding Block  layered Navigation module in prestashop 1.6.3

 

  well i want to include a custom filter "discount" into layered navigation block that should take value dynamically from uploaded value from CSV.(CSV IMPORT PRO -module)

I want to display it in "%" and "amount" format.
It would be same like as "Price range" feature where we need to move slider in order to get price variant from min to max.

 

only thing is i need this feature in check box or radio button features so that a particular discounted product will be visible when we check the box.

 

i also don't wont this feature to be manually added through "Product feature" or "combinations".

 

also i need this feature on product category page.(Left Column)

please help me as the matter is very urgent for me and my company and also for my job. if iam unable to resolve this issue i can lose my job.   :(

my company website is: http://www.shelltag.com

Link to comment
Share on other sites

Sounds like you are putting yourself in an impossible position.

 

A few points that may (or may not) help your further:

 

 - it is useless to start thinking from the CSV. The csv puts the data in your database. That should be your starting point. That means that your discounts will be in the ps_specific_prices table.

 

 - if you had a look at the code of the layered navigation module you know that it is hellishly complex. So you don't want to change more than strictly necessary. So you should transfer those discounts into features.

 

 - that will leave you with one job to do: take care that a slider is applied. That is not in the Prestashop backoffice menu - it is by default only allowed for prices and weight - so you will need to make some code modifications to allow that. 

Link to comment
Share on other sites

sir i know i need to fetch details from ps_specific_Price table...into layered block table....but i need to fetch details and display it on left column in layered navigation block...but just need to modify it such a way that it shud appear as filter in form of check box/radio button rather than SLIDER....

 

can u show code which i need to implement sir? please.. 

Link to comment
Share on other sites

also my boss strictly said no me to use of attributes,combination and use of static feature...i used this but he said know as we need to applied discount at every 30 minutes to products and its manually impossible to assign discount to each of the product so in this case making this dynamic and fetching directly from database and show it in form of checkbox/radio button rather than slider..

 

so plz help me in this regard's

Link to comment
Share on other sites

As I wrote, this isn't easy, neither said nor done.

 

I would start with the backoffice. There is a function getContent() that calls the admin template view_1.6.tpl. This function is 300 lines long. The next step would be to find out how the form in this template file is handled. 

 

You could also start with the front side. In that case you should first analyze how the ps_layered_filter database table works. As it stores the filters json-encoded even that is not really simple.

  • Like 1
Link to comment
Share on other sites

thats good info sir, i can see there's a function getContent() in blocklayered.php..so what we have to do suppose to be inside getContent() function itself??

 

and do we have to call it in LeftColumn(hook) in order to display this,sir?

this is really critical for me 

Link to comment
Share on other sites

If you don't use weights for filtering you could use them for the discount filter. That way you could keep the middle part and you would only need to change the frontend and backend part. But even so it would have a teeribly difficult job for someone who doesn't know the Prestashop code.

Link to comment
Share on other sites

well weight filter is necessary sir as we need it,but how to implement discount filter using radio/checkbox rather than slider(which we dont need)...

iam not getting any reference for it.. although i have some knowedge of prestashop coding but as i said i have just begun using prestashop since 5-6 months and as u kow very well,it takes heck of time to become perfect in coding so ..its really cumbersome for me..

 

still i need it anyhow??

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...