VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: csimmo on November 30, 2012, 00:06:36 AM

Title: Sort by manufacturers
Post by: csimmo on November 30, 2012, 00:06:36 AM
I have a bug, I must have missed some thing when I was moding the template. When I try to sort by Manufacturer or Product name, I get an empty page back.
http://www2.abtsystems.com.au/services/computer-assembly.html
Can someone let me know where the code for this is in the original template? I am sure I can figure it out from there.
Title: Re: Sort by manufacturers
Post by: bytelord on November 30, 2012, 00:34:48 AM
Hello,

You did not mention your joomla, php and vm2 versions you are using.

To your issue, seems that this sef language keys is not translated, try to disable SEF and report back. Also please check if the file language\en-GB\en-GB.com_virtuemart.sef.ini exists and if exists please check if those keys exist
COM_VIRTUEMART_SEF_MF_NAME="manufacturer_name"
COM_VIRTUEMART_SEF_PRODUCT_NAME="name"

Regards
Title: Re: Sort by manufacturers
Post by: csimmo on November 30, 2012, 00:48:46 AM
I keep doing that!!
VM 2.0.14/joomla 2.5.8/PHP 5.4.9.1

Those files were there just fine.
Turning off SEF or SEO made no difference. I have just tested the demo website for the template I was running, and it is broken there too. I am checking with their support too.
Title: Re: Sort by manufacturers
Post by: bytelord on November 30, 2012, 01:43:10 AM
Hello,

Please try without template overrides ...

Regards
Title: Re: Sort by manufacturers
Post by: csimmo on November 30, 2012, 01:52:33 AM
That was surprising. I deleted the html folder in the template, but it did not correct the issue. I actually expected it would!!!
Is there no over ride I could just put in to the template file itself to do as its told? Which section of code on what file actually has that sort field?

It might also be worth noting that the template was not sold on its own (hotjoomla templates - drugstore). But ruther had Virtuemart 2.0.8 and Joomla 2.5.8 all together. I have since updated to 2.0.14 and added the code changes manually to the template.

Like I said though, I am sure I can figure out how to fix it if someone just points me to the right files and code areas
Title: Re: Sort by manufacturers
Post by: bytelord on November 30, 2012, 18:27:58 PM
Hello,

So is worked without template overrides? Wasn't clear on your response.

The orderby code is located under joomla_folder\components\com_virtuemart\views\category\tmpl\default.php
The overrided file is located under: your_joomla_folder\templates\your_joomla_template\html\com_virtuemart\category\default.php

Line 175 on the original template files:

<div class="width70 floatleft">
      <?php echo $this->orderByList['orderby']; ?>
      <?php echo $this->orderByList['manufacturer']; ?>
</div>

Regards
Title: Re: Sort by manufacturers
Post by: csimmo on December 01, 2012, 02:10:23 AM
It didn't work with the override deleted.
The template opverride was missing this line:       
<?php echo $this->orderByList['manufacturer']; ?>

But adding it has made no difference. Manufacturer is a reference right? which file is the reference in?

Its a bit weired, sort by manufacturer works here:
http://www2.abtsystems.com.au/services/format/html/view/category/start/8/orderby/m.mf_name/virtuemart_manufacturer_id/13.html
but not here:
http://www2.abtsystems.com.au/services/computer-assembly.html

Cold the pagination and the sort by issues be related?
Title: Re: Sort by manufacturers
Post by: csimmo on December 03, 2012, 04:21:36 AM
This is my last bug. I have turned off all the virtuemart search modules, do any of them have to be on?

Please help me, Last bug!!!!!!!!!!
Title: Re: Sort by manufacturers
Post by: csimmo on December 03, 2012, 05:22:37 AM
if the pagination issues was solved with the extra lines added to the product.php  file, could something be wrong in the same file for sort by? from line 1717? Is anyone else having issues?
Title: Re: Sort by manufacturers
Post by: csimmo on December 03, 2012, 07:20:20 AM
I just got this error: for sort by product
vmError: exeSortSearchListQuery Unknown column 'p.product_name' in 'order clause' SQL=SELECT SQL_CALC_FOUND_ROWS l.`virtuemart_product_id` FROM `in162_virtuemart_products_en_gb` as l JOIN `in162_virtuemart_products` AS p using (`virtuemart_product_id`) LEFT JOIN `in162_virtuemart_product_categories` ON p.`virtuemart_product_id` = `in162_virtuemart_product_categories`.`virtuemart_product_id` LEFT JOIN `in162_virtuemart_categories_en_gb` as c ON c.`virtuemart_category_id` = `in162_virtuemart_product_categories`.`virtuemart_category_id` LEFT JOIN `in162_virtuemart_product_shoppergroups` ON p.`virtuemart_product_id` = `in162_virtuemart_product_shoppergroups`.`virtuemart_product_id` LEFT OUTER JOIN `in162_virtuemart_shoppergroups` as s ON s.`virtuemart_shoppergroup_id` = `in162_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id` WHERE ( p.`published`="1" AND `in162_virtuemart_product_categories`.`virtuemart_category_id` > 0 AND ( s.`virtuemart_shoppergroup_id`= "1" OR s.`virtuemart_shoppergroup_id`= "2" OR s.`virtuemart_shoppergroup_id`= "3" OR s.`virtuemart_shoppergroup_id`= "4" OR s.`virtuemart_shoppergroup_id` IS NULL ) ) group by p.`virtuemart_product_id` ORDER BY p.product_name ASC LIMIT 0, 16
and this on sort by manufacturer
vmError: exeSortSearchListQuery Unknown column 'm.mf_name' in 'order clause' SQL=SELECT SQL_CALC_FOUND_ROWS l.`virtuemart_product_id` FROM `in162_virtuemart_products_en_gb` as l JOIN `in162_virtuemart_products` AS p using (`virtuemart_product_id`) LEFT JOIN `in162_virtuemart_product_categories` ON p.`virtuemart_product_id` = `in162_virtuemart_product_categories`.`virtuemart_product_id` LEFT JOIN `in162_virtuemart_categories_en_gb` as c ON c.`virtuemart_category_id` = `in162_virtuemart_product_categories`.`virtuemart_category_id` LEFT JOIN `in162_virtuemart_product_shoppergroups` ON p.`virtuemart_product_id` = `in162_virtuemart_product_shoppergroups`.`virtuemart_product_id` LEFT OUTER JOIN `in162_virtuemart_shoppergroups` as s ON s.`virtuemart_shoppergroup_id` = `in162_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id` WHERE ( p.`published`="1" AND `in162_virtuemart_product_categories`.`virtuemart_category_id` > 0 AND ( s.`virtuemart_shoppergroup_id`= "1" OR s.`virtuemart_shoppergroup_id`= "2" OR s.`virtuemart_shoppergroup_id`= "3" OR s.`virtuemart_shoppergroup_id`= "4" OR s.`virtuemart_shoppergroup_id` IS NULL ) ) group by p.`virtuemart_product_id` ORDER BY m.mf_name ASC LIMIT 0, 16


It is repeatable here:
http://www2.abtsystems.com.au/shop/0/by,p.product_sku.html
Title: Re: Sort by manufacturers
Post by: bytelord on December 03, 2012, 07:32:45 AM
There is a posibility to have untranslated those sef links.
http://forum.virtuemart.net/index.php?topic=110676.msg371148#msg371148
Title: Re: Sort by manufacturers
Post by: csimmo on December 03, 2012, 07:49:00 AM
COM_VIRTUEMART_SEF_MF_NAME="manufacturer_name"
COM_VIRTUEMART_SEF_PRODUCT_NAME="name"
COM_VIRTUEMART_SEF_CREATED_ON="creation_date"

Seem to be there.
I think it is worth noting that when I turned off SEO the error disappeared, though the sort didn't work, then turning on SEO again made the error still stay away, but didn't fix the issue
Title: Re: Sort by manufacturers
Post by: bytelord on December 03, 2012, 13:11:33 PM
are you using en-gb?
Title: Re: Sort by manufacturers
Post by: csimmo on December 03, 2012, 23:39:35 PM
Correct, I am.
It would seem that this error is rather common:
http://forum.virtuemart.net/index.php?topic=108603.msg363506#msg363506
http://forum.virtuemart.net/index.php?topic=109257.msg365850#msg365850
http://forum.virtuemart.net/index.php?topic=106693.msg356249#msg356249
http://forum.virtuemart.net/index.php?topic=104916.msg353503#msg353503
http://forum.virtuemart.net/index.php?topic=106086.msg353775#msg353775
http://forum.virtuemart.net/index.php?topic=106142.msg353970#msg353970
http://forum.virtuemart.net/index.php?topic=105918.msg353091#msg353091
http://forum.virtuemart.net/index.php?topic=105918.msg353091#msg353091

While most of these errors are relating to DB issues, I have done a DB tables update with no change. The disturbing thing is most of these posts have no replies.
Title: Re: Sort by manufacturers
Post by: csimmo on December 04, 2012, 03:22:39 AM
I found a fix, but I need help applying it
This does not work:
http://www2.abtsystems.com.au/services/shop-servicing/by,m.mf_name.html
But if I delete the m. and make it like this:
http://www2.abtsystems.com.au/services/shop-servicing/by,mf_name.html
it works fine!!!

How do I apply it?
Title: Re: Sort by manufacturers
Post by: csimmo on December 04, 2012, 04:22:31 AM
I turned on translate strings and its fixed!!
Title: Re: Sort by manufacturers
Post by: bytelord on December 04, 2012, 04:44:44 AM
I thing you had already check that on my previous post: http://forum.virtuemart.net/index.php?topic=110676.msg371148#msg371148

But remain some issues with created_on, modified_on and product sku order fields.

Regards
Title: Re: Sort by manufacturers
Post by: csimmo on April 01, 2013, 13:36:51 PM
I retract this post. It was a side effect of resetting the config file.