VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Tryer on May 19, 2016, 20:02:16 PM

Title: Search in Shop
Post by: Tryer on May 19, 2016, 20:02:16 PM
I am using VM 3.0.16 0n a new Joomla 3.5.1 site.

1 - I am confused by the display of "Search in Shop" with every product when I have the VM -Search in Shop module unpublished. How can I remove the Search in Shop field and button?

2 - As a secondary issue, the Search in Shop function dies not seem to work although I have read on this forum that it may only be searching within a single product category. The behaviour of the search field is odd to say the least. The field and the associated search button are poorly aligned (vertically) and when the button is clicked the search field shrinks to a much smaller size during the search process. Is that what is supposed to happen?

Comments appreciated.
Title: Re: Search in Shop
Post by: GJC Web Design on May 19, 2016, 20:43:38 PM
without a live site url how could anyone help u?

have u looked at the demo?
Title: Re: Search in Shop
Post by: Tryer on May 21, 2016, 10:03:04 AM
I have found that during the development of a new site, which may not yet be live, most forums are able to offer some sort of advice or direction if a reasonable description of a problem is offered.

Yes, I have looked at the demo site but was unable to get an answer to this particular issue. I have also spent a lot of time searching through forum posts before posting.

However, I have now built the site to a stage where it is possible to make it visible for a brief period. A relevant page can be seen at:
http://www.openphotographicsociety.org/joomla35/shop-and-tools/shop/distinction-fees

I don't pretend to be any expert on this subject. Indeed I am a beginner and an ordinary human being who struggles to understand many aspects of the web. I suspect I am not alone in that. However I do try to be courteous when seeking advice from others.

Comments and suggestions would be appreciated.
Title: Re: Search in Shop
Post by: jenkinhill on May 21, 2016, 10:53:35 AM
Now that you have posted a URL it is possible to see that you are not using the default VirtueMart templates, but are using a commercial template with overrides.

1. If you use Firebug you can see that the div holding the search box has the class virtuemart_search so can be hidden with css if you want to hide it, although you could simply unpublish the VM search module in Joomla's module manager.

2. The search parameters are set in the VM search module configuration.

As for alignment, Firebug shows that this can be corrected in your template by adding some top_margin to the input box -  the  class used is  .virtuemart_search .inputbox
The size change on search is Joomla template related so maybe you should take this up with your template supplier.

See http://forum.virtuemart.net/index.php?topic=116620.0
and http://forum.virtuemart.net/index.php?topic=108212.0
Title: Re: Search in Shop
Post by: Tryer on May 21, 2016, 11:52:29 AM
Thanks for your helpful reply - it is appreciated.

One of the aspects of this that totally confuses me is that the VM-Search module is unpublished!! How can it therefore appear as it does on the site? Is this something for Virtuemart or the template?

Thanks
Title: Re: Search in Shop
Post by: AH on May 21, 2016, 12:10:56 PM
That is a template thing - clearly the template is getting the search - regardless of joomla module settings
Title: Re: Search in Shop
Post by: jenkinhill on May 21, 2016, 12:49:13 PM
It is a case of a template developer thinking they know better than the user, so they remove choice. A good reason for being very careful about template choice!
Title: Re: Search in Shop
Post by: Tryer on May 21, 2016, 12:56:14 PM
Thanks to Ah and jenkinhill for you replies and advice. I will make contact with the template supplier.

I take note of your comment regarding care when selecting a template, but for someone like me it is near impossible to foresee a problem of this level of detail at the beginning of a project. Actually, the same template was fine (ie no enforced shop search) before I upgraded to Joomla 3.5.1 from Joomla 2.5.28. The template did not change since it was compatible with both versions of Joomla.

Thanks again
Title: Re: Search in Shop
Post by: Tryer on May 21, 2016, 17:03:06 PM
As a follow-up to the comments I have now reverted to all the default Virtuemart templates - choosing" Joomla default" for the shop template and category template, and "default" for the home page template. The VM - Search in Shop module is unpublished and has no menu assignments. However, the link below shows that the "Search in Shop" facility is still shown.

http://www.openphotographicsociety.org/joomla35/shop-and-tools/shop/distinction-fees

I recently upgraded this site from Joomla 2.5.28 to Joomla 3.5.1, and as part of this process also upgraded to the latest version of Virtuemart 3.0.16 (from Virtuemart 2.6.20 with the Joomla 2.5 site). I am using PHP 5.4. The JSN Tendo template has not changed since it was compatible with both Joomla 2.5 and Joomla 3.5. My simple logic seems to suggest that the appearance of the "Search in Shop" facility must therefore be a consequence of eith (or both) the Joomla upgrade or the Virtuemart upgrade.

I cannot believe that the VM- Search in Shop module is being used when it is unpublished and has no menu assignments. The search module is surely coming from somewhere else.

Any further thoughts would be appreciated.
Title: Re: Search in Shop
Post by: GJC Web Design on May 21, 2016, 21:06:01 PM
That is not the search module

it is the search box that is normally shown at the top of the category description page when you make a search..
the cat template is the same file as the product search results
components\com_virtuemart\views\category\tmpl\default.php

if no over ridden

it normally has an if

if (!empty($this->keyword)) { 

meaning if the url has a keyword in it

if (!empty($this->keyword)) {
//id taken in the view.html.php could be modified
$category_id  = vRequest::getInt ('virtuemart_category_id', 0); ?>
<h3><?php echo $this->keyword?></h3>

<form action="<?php echo JRoute::('index.php?option=com_virtuemart&view=category&limitstart=0'FALSE); ?>" method="get">

<!--BEGIN Search Box -->
<div class="virtuemart_search">
<?php echo $this->searchCustomList ?>
<br/>
<?php echo $this->searchCustomValues ?>
<input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>"/>
<input type="submit" value="<?php echo vmText::('COM_VIRTUEMART_SEARCH'?>" class="button" onclick="this.form.keyword.focus();"/>
</div>
<input type="hidden" name="search" value="true"/>
<input type="hidden" name="view" value="category"/>
<input type="hidden" name="option" value="com_virtuemart"/>
<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id?>"/>

</form>
<!-- End Search Box -->
<?php  ?>


check your template does or just remove that whole block .. but then on search results you wont have the search box
Title: Re: Search in Shop
Post by: Tryer on May 22, 2016, 11:07:23 AM
Thank you for your detailed reply - it is appreciated.

However, I removed the section of code indicated and it made no difference in the front end. The Search in shop remains firmly in place. I cleared cache etc etc but to no avail.

Any further thoughts?
Title: Re: Search in Shop
Post by: Jörgen on May 22, 2016, 11:22:45 AM
Then Your view is overridden in Your template. remove the same code there.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Search in Shop
Post by: Tryer on May 22, 2016, 19:25:09 PM
Thank you.

OK, that did it! The category template was being overridden by the template despite , in Virtuemart/configuration/templates, having the category layout set to "No override" and the default templates being set to "Joomla default".

Thank you for your help and persistence!
Title: Re: Search in Shop
Post by: Jörgen on May 23, 2016, 07:56:59 AM
Nice that it worked.

Jooomla default does not mean no overrides, it just mean that You are using the default template for Joomla. This template can of course have overrides, which it had in Your case.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Search in Shop
Post by: Tryer on May 23, 2016, 10:56:00 AM
OK, thanks. However, I am still unclear about one aspect of why my original settings did not work. In Virtuemart - configuration - templates - shopfront settings - category layout I had set "No overrides" (rather than "Default"). I thought that meant than no category layout overrides would be applied - apparently not.
Title: Re: Search in Shop
Post by: jenkinhill on May 23, 2016, 11:03:24 AM
If the override files use the same filename as the default files then they will be used. If the overrides had different filenames then "No overrides" will prevent their use.