Yogesh Raghav Posted March 22, 2016 Share Posted March 22, 2016 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 More sharing options...
musicmaster Posted March 22, 2016 Share Posted March 22, 2016 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 More sharing options...
Yogesh Raghav Posted March 22, 2016 Author Share Posted March 22, 2016 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 More sharing options...
Yogesh Raghav Posted March 22, 2016 Author Share Posted March 22, 2016 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 More sharing options...
musicmaster Posted March 23, 2016 Share Posted March 23, 2016 Blocklayered.php is a file of 3500 lines and my knowledge of it is rather superficial. So adding discounts as a new source to it would take me at least several hours and might well take several days. This is a bit too big for me to do on a forum for free. Link to comment Share on other sites More sharing options...
Yogesh Raghav Posted March 23, 2016 Author Share Posted March 23, 2016 so what i need to do for this?can u plz tell me in details and some hint ? its really urgent for me Link to comment Share on other sites More sharing options...
musicmaster Posted March 23, 2016 Share Posted March 23, 2016 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. 1 Link to comment Share on other sites More sharing options...
Yogesh Raghav Posted March 23, 2016 Author Share Posted March 23, 2016 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 More sharing options...
musicmaster Posted March 23, 2016 Share Posted March 23, 2016 There is no hook. You are just changing the module. Link to comment Share on other sites More sharing options...
musicmaster Posted March 24, 2016 Share Posted March 24, 2016 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 More sharing options...
Yogesh Raghav Posted March 25, 2016 Author Share Posted March 25, 2016 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 More sharing options...
musicmaster Posted March 25, 2016 Share Posted March 25, 2016 One other way you could consider is database triggers. You could set a database trigger that automatically copies any change in the specific_prices table to the feature_value table. It is probably the only way to do this without spending weeks. Link to comment Share on other sites More sharing options...
Yogesh Raghav Posted March 25, 2016 Author Share Posted March 25, 2016 (edited) well thanks sir but can u show how to do it i mean if u can show code.. iam in real trouble..i know its tedious but plz help me please i would be really thankful to you Edited March 25, 2016 by Yogesh Raghav (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted March 25, 2016 Share Posted March 25, 2016 Database triggering is rather basic stuff that one should be able to understand within a day. If you want me to do the work I will need to charge you for it. You can pm me for a quote. Link to comment Share on other sites More sharing options...
Yogesh Raghav Posted March 26, 2016 Author Share Posted March 26, 2016 ok can u give me quote? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now