VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Lydiasupplyingdirect on January 14, 2022, 13:18:06 PM

Title: Virtuemart Category Layout [solved]
Post by: Lydiasupplyingdirect on January 14, 2022, 13:18:06 PM
Hello!

We've almost finished our website but am struggling with our filter and search module we use. When we use the search feature, it returns the virtuemart category layout first and then underneath shows the search result. We don't want the category layout to show when searching, does anyone know how to change this?

I have tried playing about with VM category settings but nothing seems to work so I must be missing something!

http://timb114.sg-host.com/home

Would appreciate any help!
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 14, 2022, 13:26:19 PM
You can create custom layout for view products == search result + add search box - as override in template + connect to menu type search

But you are right, category layout is default and actually solutions (old from VM2) is not good :)
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 14, 2022, 13:41:14 PM
Hi,

There must be a way to hide the category as a result without having to set up custom layout as on our current site when you search you only get the results you have searched for.

https://www.schoolfurniture-direct.co.uk/

I want to try and figure out why this is happening, could it be to do with how the Yootheme Template has set out?
Title: Re: Virtuemart Category Layout
Post by: jenkinhill on January 14, 2022, 15:15:59 PM
TRy a search on http://demo.virtuemart.net/ to see how a search displays with the default VM templates.
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 14, 2022, 17:24:56 PM
Hello,

We're not using the VM search we are using Break Designs Custom Filters & Search extension but when I raised this issue with them they said it was to do with VM Category settings, which is why I'm now on here.

So if there's anything you think I could try changing to stop the category layout sitting on top of search results please let me know.

Thank you,

Lydia
Title: Re: Virtuemart Category Layout
Post by: Jörgen on January 14, 2022, 17:30:15 PM
Have You set up a landing page for the Break design search ?

Jörgen
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 14, 2022, 17:40:02 PM
Hello,

Yes, in Joomla back end have set up menu item in hidden menu as 'Custom filters > search results' Please see image attached.
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 14, 2022, 18:13:28 PM
If I am to create another VM Category layout, how would I go about doing that through Joomla?

Seems like it may be the only way to solve my issue as I can then choose which category layout loads when getting search results - I just want the products to come up when searching not the category layout.
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 14, 2022, 23:51:07 PM
Look at the attachment:

- create custom template for FE view category - php+xml - override language constant to COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_TITLE+COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_DESC
- create language override
- create menu item for customfilters search result
- select your new custom layout
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 14, 2022, 23:52:42 PM
attachments
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 17, 2022, 10:07:10 AM
Hello,

Thank you for attaching screen shots but our problem is we won't even have the option to create a custom layout. Please see image attached.
Title: Re: Virtuemart Category Layout
Post by: Jörgen on January 17, 2022, 10:42:10 AM
Rudolf meant that You must create the custom layout. See his screenshots.

Jörgen
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 17, 2022, 11:58:06 AM
Ahh, sorry - didn't read that properly!

Will have a go and see how far I get.

Thank you so much everyone for all your help :)
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 12:20:13 PM
Hello all,

I am trying to create the custom layout in overrides but when I search for these on the right hand side COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_TITLE+COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_DESC
it's not coming up with anything (please see screen shot attached)

Could you possibly describe the process of creating custom layout (in baby mode) as I am not web developer so I only know so much, what did you mean by  'create custom template for FE view category'? What does FE view mean?

Thank you for your help.

Lydia
Title: Re: Virtuemart Category Layout
Post by: GJC Web Design on January 18, 2022, 12:33:18 PM
the process for over riding VM views is virtually identical to over riding any Joomla view ... there are plenty of online how tos if u google..
Just pay attention to the paths required...

But if u don't have the coding skills to do this then you will have to employ someone...

P.S. it has nothing to do with language over rides
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 12:40:46 PM
Ok but I'm being told by someone else that it is?

So I want to know how to do that so that I can see if that solves the issue. When I search for creating a custom category layout on google I can't find anything on that apart from this...

https://www.joomlashack.com/blog/joomla/custom-layouts/?__cf_chl_f_tk=Em7EGPP3H2V7M1lcTyvYS50dgS6_86vT1C959MY7txs-1642418259-0-gaNycGzNB1E

Which doesn't seem to relate to what I'm trying to do.

Title: Re: Virtuemart Category Layout
Post by: GJC Web Design on January 18, 2022, 13:11:19 PM
Quotehttps://www.joomlashack.com/blog/joomla/custom-layouts/?__cf_chl_f_tk=Em7EGPP3H2V7M1lcTyvYS50dgS6_86vT1C959MY7txs-1642418259-0-gaNycGzNB1E

this is how you create a custom over ride .. yes... that is as I understand it what you want to do...
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 13:34:18 PM
Ok - understood.

So these instructions show you how to create a template override for an article, it tells you to create file from com_content > article. If I am wanting to create a custom category layout (not custom article), which file would I need to create from? (please see attached)

Would it be com_content > category?

Would be much appreciated if you could help as much as you can.

Thank you,

Lydia

Title: Re: Virtuemart Category Layout
Post by: pinochico on January 18, 2022, 14:01:19 PM
How can you look for a translation of constants that do not yet exist and only you create them in overrides?
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 14:10:18 PM
Hi,

Yes I am starting to understand now but I don't know how to create the override in the first place.

If I go to Extensions > Templates > Yootheme Template > Create Overrides

Which file am I creating the override from?
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 18, 2022, 14:40:26 PM
I send you image with FTP folder list == you don't create override, but create new files
Title: Re: Virtuemart Category Layout
Post by: GJC Web Design on January 18, 2022, 14:58:14 PM
I am finding it extremely difficult to understand what your trying to achieve...

If I go https://www.schoolfurniture-direct.co.uk/search-result/?q=table I get a very normal looking result page..

if I then choose a category I get what I assume are all tables in that category ...

https://www.schoolfurniture-direct.co.uk/search-result/Replacement-Canteen-Unit-Stools/?q=table

what are trying to change?  A picture is worth a 1000 words...

be aware u are not using the core VM search system ... you are using VM Custom Filters which is a 3rd party extension...  com_customfilters
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 15:13:16 PM
The screen shots you have attached aren;t of the website I am working on.

I am editing this website, which uses Yootheme Pro a completely different template to our old website.

http://timb114.sg-host.com/

Referring to my original post question...

"We've almost finished our website but am struggling with our filter and search module we use. When we use the search feature, it returns the Virtuemart category layout first and then underneath shows the search result. We don't want the category layout to show when searching, does anyone know how to change this?"

In response to that, Rudolph said that I would need to create a custom category layout so that's why I need to know exactly how I do that.

If you have a different suggestion to fix my search results issue then I am open to hearing it.


Thank you


Title: Re: Virtuemart Category Layout
Post by: pinochico on January 18, 2022, 15:13:39 PM
Solutions I send, because we use Custom Filters and we use custom layout for search too...

So you try find others?
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 15:17:09 PM
Hi pinochico,

No I want to use your suggestion but I just don't know how to do it!
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 18, 2022, 16:55:34 PM
ok

> create custom template for FE view category - php+xml

Do you finished?

Show me :)
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 18, 2022, 17:15:13 PM
Hi pinochico.,

Thank you very much for your help, I really appreciate it.

My path: Extensions > Templates > Yootheme Pro > Editor >Create new file > Created Php file > Created xml file

So far I have created both php and xml file (see screen shot attached) but not sure if I have done this correctly? Do the new files need to be under a certain folder?

I hope this makes sense.

Thank you.

Title: Re: Virtuemart Category Layout
Post by: pinochico on January 18, 2022, 17:52:37 PM
as my FTP list ==

a/ inside core VM folder
components/com_virtuemart/views/category/tmpl/custom.php
components/com_virtuemart/views/category/tmpl/custom.xml

or

b/ inside template folder as override

templates/YOUR_TEMPLATE/html/com_virtuemart/category/custom.php
templates/YOUR_TEMPLATE/html/com_virtuemart/category/custom.xml

After this (and create language override for COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_TITLE+COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_DESC == of course, the template and XML file you created as copy from default.php and default.xml) you can see on menu item type Custom Filter Search Result as my picture.
And of course - XML file is copy - only title and desc have changed language constant - template file you have to changed and this is the priority file for creating view for search result

But I think - if you don't know nothing about template override, you know about how create new template file in PHP == delete all input which don't do you need and add your new?
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 19, 2022, 10:40:23 AM
Hello pinochico,

Please see screen shot attached, is this correct?
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 19, 2022, 10:41:59 AM
Please see updated screen shot attached
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 19, 2022, 11:26:43 AM
no

are you looking my images?
are totally other
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 19, 2022, 12:45:41 PM
I am with you now!

Am I now in the correct area?

I am completely new to all of this so that's why it's taking me a while to understand apologies.


If I am in the correct area, I will make the copy files you have instructed and show you once done.

Again, thank you for your help
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 19, 2022, 12:46:50 PM
When you say this..

as my FTP list ==

a/ inside core VM folder
components/com_virtuemart/views/category/tmpl/custom.php
components/com_virtuemart/views/category/tmpl/custom.xml

or

b/ inside template folder as override

templates/YOUR_TEMPLATE/html/com_virtuemart/category/custom.php
templates/YOUR_TEMPLATE/html/com_virtuemart/category/custom.xml


Do I need to do both of these or just either or?
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 19, 2022, 13:50:13 PM
Have edited xml, please see screenshots.

Next step is creating the language override, which is confusing me now.

When I search for COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_TITLE or COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_DESC nothing comes up? Do I need to search for the original code first? COM_VIRTUEMART_CATEGORY_VIEW_DEFAULT_TITLE
Title: Re: Virtuemart Category Layout
Post by: Jörgen on January 19, 2022, 15:00:03 PM
Quote from: pinochico on January 18, 2022, 17:52:37 PM


templates/YOUR_TEMPLATE/html/com_virtuemart/category/custom.php
templates/YOUR_TEMPLATE/html/com_virtuemart/category/custom.xml

After this (and create language override for COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_TITLE+COM_VIRTUEMART_CATEGORY_VIEW_CUSTOM_DESC)

You should use this language constants and create content for these. Please consult JOOMLA help pages for the concept creating language constants and what they are used for.

Jörgen
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 19, 2022, 15:59:03 PM
QuoteHave edited xml, please see screenshots.

This point is ok

Language override is not ok.
Again and again
Why do you search your new language constant, if is not setuped in Joomla?
You have to create as new, dont search.

Title: Re: Virtuemart Category Layout
Post by: pinochico on January 19, 2022, 16:01:23 PM
QuoteAm I now in the correct area?

yes, correct subfolder is tmpl in folder category.

Again:
components/com_virtuemart/views/category/tmpl/custom.php
components/com_virtuemart/views/category/tmpl/custom.xml
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 19, 2022, 16:03:17 PM
So that's what I am saying I don't understand how to do that part. How do I create/set up the language constant in Joomla in the first place?

Like I've said, i am new to this, I have no idea what I'm doing so I need help with how to do this part. I am trying to understand what you are saying but can be difficult with how your put sentences together, I hope you can understand what I am saying.
Title: Re: Virtuemart Category Layout
Post by: Jörgen on January 19, 2022, 16:07:31 PM
QuoteYou should use this language constants and create content for these. Please consult JOOMLA help pages for the concept creating language constants and what they are used for.

Search Joomla.net ...

Jörgen @ Kreativ Fotografi
Title: Re: Virtuemart Category Layout
Post by: pinochico on January 19, 2022, 21:39:40 PM
Oh my goodness :)

1/ Add new language constant to your new layout custom.php -> DONE
2/ Add your new language constant from your new layout to administration as new override - don't find it - is not exist yet you wilt to create and save - look at the attachment -> I think not DONE
3/ After this put your new layout and XML file to folder component/com_virtuemart/views/category/tmpl - DONE
4/ After this you have to create new menu item type CustomFilter Search Result and select in dropdown your new layout with the your new name == Custom Category Layout, because before you created override for administration -> I think not DONE

If you don't know still, then pls study on Joomla.org in documentation or exist a couple of Books about Joomla how
- create language override in Joomla
- create custom layout for view for ANY Joomla Component

So I did it and spent two beautiful nights testing and rehearsing before I learned it in Joomla 25.
I also looked into the code of the various components as they have done.

I will be surprised if the final result is not there :)
Title: Re: Virtuemart Category Layout
Post by: Lydiasupplyingdirect on January 20, 2022, 10:29:06 AM
Hello Pinochico,

Thank you ever so much for your help, I have done all of this now and is working!! I just need to figure out what code I need to get rid of in the xml file as is still showing category on top of search result but I know that's because I haven't deleted what I do not need in the file.

I will read Joomla documentation now, thank you again for being so patient!

Lydia
Title: Re: Virtuemart Category Layout [solved]
Post by: pinochico on January 20, 2022, 19:11:16 PM
Pleasure on my part, you can mark it as solved
Title: Re: Virtuemart Category Layout
Post by: Jörgen on January 20, 2022, 20:39:05 PM
Nice work you have put into this Pinochico  8)

Thank You

Jörgen @ Kreativ Fotografi
Title: Re: Virtuemart Category Layout [solved]
Post by: pinochico on January 21, 2022, 08:03:24 AM
I'm glad I succeeded, I keep my fingers crossed for the future