Page 1 of 1

[Solved] Pin Certain Product to top of Category?

Posted: Wed Nov 07, 2018 8:43 pm
by SB1777
Hi,

Version 2.3.0.2

Struggling with this one. At the moment the category is set to sort by price. I want to keep it this way but have certain products that appear first regardless of the price. I have tried changing the Sort Order numbers in the edit product page but it does not seem to change anything.

Any help would be greatly appreciated!

Thanks

Re: Pin Certain Product to top of Category?

Posted: Thu Nov 08, 2018 5:27 am
by straightlight
Theory posted. More information needed. Forum rules.

Re: Pin Certain Product to top of Category?

Posted: Thu Nov 08, 2018 7:26 pm
by SB1777
Okay, to better explain.

On the category page there is 'sort by' which obviously rearranges the product display order depending on price, name a-z etc.

I would just like a selected few "recommended" products to always appear first regardless of the 'sort by'.

In the admin panel under the 'data' tab when editing a product there is 'Sort Order' which i have changed but this still does not solve anything.

Am i missing something or is this a going to be a little harder than initially thought?


It is Version 2.3.0.2 with Journal Theme.

Hope that better explains.


Thanks

Re: Pin Certain Product to top of Category?

Posted: Mon Nov 12, 2018 7:49 pm
by SB1777
Surely it should be a simple enough task but i still cant seem to figure this one!

Any help or point in right direction is appreciated.

Re: Pin Certain Product to top of Category?

Posted: Mon Nov 12, 2018 9:24 pm
by straightlight
which i have changed but this still does not solve anything.
Lack of details. More information needed. In addition, simplicity as described on the above becomes the complexity when one does not provide the full details of the results encountered.

Re: Pin Certain Product to top of Category?

Posted: Mon Nov 12, 2018 9:43 pm
by SB1777
which i have changed but this still does not solve anything.
It is a simple objective that i am trying to achieve. 'does not solve anything' i mean, it did not achieve the simple thing that i am trying to achieve which is make certain products always appear first regardless of the 'sort by' on the category page.

simplicity as described on the above becomes the complexity when one does not provide the full details of the results encountered.
I think you are over complicating it to be honest. Anyone that knows Opencart and sees what i have put should understand what i am asking for,
Sorry if i am wrong but i think it is quite clear when you read it in full context?


It is quite a straightforward issue that i was hoping would be easy to resolve.
I am now thinking i may have to add additional code to controller/product/category.php

Just a point in the right direction from someone who has some expertise would be great, i've still got a lot of learning to do!

Re: Pin Certain Product to top of Category?

Posted: Mon Nov 12, 2018 10:09 pm
by straightlight
I think you are over complicating it to be honest. Anyone that knows Opencart and sees what i have put should understand what i am asking for,
Sorry if i am wrong but i think it is quite clear when you read it in full context?
If the case, a solution would of been posted already also by those who may have the answer on what has been posted from your perception-view. Take note that I have been on this forum for a long time now and when I notice lack of details have been posted, I rather take the chance to notify the OP than leaving the topic in the dark. Forum rules.

Re: Pin Certain Product to top of Category?

Posted: Mon Nov 12, 2018 10:42 pm
by SB1777
I respect you are a Legendary Member.

After re-reading my second post which better explains, I am not quite sure how i can give more details.

it seems straightforward and to the point to me though i wrote it so i guess it would! please can you advise on what i need to put, if you read it again do you yourself understand the task i am trying to solve?

Re: Pin Certain Product to top of Category?

Posted: Tue Nov 13, 2018 2:31 am
by Johnathan
There's no way to do this in OpenCart using the settings, so you'd have to modify the controller file yourself. That would be in the controller file you mentioned, you'd have to hard-code some product_id's into the data array, based on the "path" in the URL. It's possible but not simple, so it's something you'd need to know PHP for.

Instead of doing that, I'd recommend using the Featured module to just pin some products at the top of the page. They'll still appear in the product results, but that way you can "highlight" them without modifying any code. To do that, you'd create a module for each category page where you want it to appear, and then create a Layout to host each module. Once you've done that, you can assign each category its own layout in its "Design" tab, so you can get the specific module to appear on that specific category's page.

It's a bit of set-up work depending on how many categories you're doing this for, but a better option than modifying core files, in my opinion.

Re: Pin Certain Product to top of Category?

Posted: Wed Nov 14, 2018 6:13 pm
by SB1777
I had never thought of using separate layouts and a featured module for each category, took a little time but it is working a treat!

Thank you!

Re: [Solved] Pin Certain Product to top of Category?

Posted: Wed Nov 14, 2018 10:30 pm
by Johnathan
👍