VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => VirtueMart Dev/Coding Central. VM1.1 => Topic started by: franzpeter on June 20, 2011, 17:20:53 pm

Title: Bug in Virtuemart 1.1.9 with category module
Post by: franzpeter on June 20, 2011, 17:20:53 pm
The new update VM 1.1.9 seems to have a bug in the shop.browse.php. If the main category has no product but subcategories, where the products reside, VM tells that the category is empty. I did exchange the VM 1.1.9 shop.browse.php with the older VM 1.1.8 shop.browse.php and it works again as expected.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Tanatus on June 20, 2011, 21:20:08 pm
Has anybody found the solution?
I have the same problem  :(
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: jenkinhill on June 20, 2011, 23:46:38 pm
There are just 2 lines different between administrator/components/com_virtuemart/html/shop.browse.php in V1.1.8 and 1.1.9

Around line 36 in 1.1.8
Code: [Select]
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));
becomes
Code: [Select]
$search_op= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_op', null ));
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));

and around line 85 in 1.1.8
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {becomes
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {(notice the missing ! in 1.1.9

Try adding in the ! and see if it fixes the issue.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: CaféTango on June 21, 2011, 05:42:05 am
The fix did the trick.  Thanks.

Cheers,
Cha
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: franzpeter on June 21, 2011, 10:32:02 am
That fixes it. But it is also possible to use the shop.browse.php from VM 1.1.8. Despite of that it seems that every update produces more errors.  The '!' is a logical php operator and not an orthographic error. Deleting operators for whatever purpose does not mean a plus of functions. As far as I can see, it was only done to show the sentence that 'category is empty'. from the language file. I think it is more important to show subcategories and products. VM has by default the possibility to unpublish empty categories.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: zanardi on June 21, 2011, 11:39:57 am
I am perfectly aware that ! is not an ortographic error, suggesting that the lead developer of VirtueMart 1.1.x does not know about this is very funny :-)
Anywyay, look at this: http://forum.virtuemart.net/index.php?topic=81461.msg268327#msg268327. That is why i made this correction; other users seem to think that THIS is the correct way for it to behave.

Please note that I ASKED LOUDLY for testing of VM 1.1.9 BETA before releasing it, on this forum also, but very few responded. Maybe we could have considered more about introducing this change. Now i will think about it.

@franzpeter: saying that every update produces more errors is simply not true. Not only because this is not really a bug, but even if it was we introduced a bug while fixing other ten or more, and in a complex system like VirtueMart that is not so bad, believe me. I always like to remind that there is no "WE" and "YOU". VM is a community effort, open for everyone to contribute, fix, and bring forward. If it fails, it means that we ALL fail, not just the people who actually commit the code, but every single VM user in the world, ESPECIALLY the ones who make business with it and give back nothing.

Have a nice day everyone!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: yabadabadoo on June 21, 2011, 18:24:21 pm
Had a mad fright after i updated ...(without backing up ... please dont tell anyone :)

Just wanted to thank you for posting the solution!!!

 8) :o ;D :P
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: bettondesign on June 22, 2011, 15:24:29 pm
Just had a big scare when updating Virtuemart but thanks to your '!' solution I have fixed it. Thank you :)
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: lipes on June 22, 2011, 22:44:48 pm
i've got the same problem here when i've update 1.1.8 to 1.1.9 ..

I only change the new:
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {

to the old line:
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {

and now it's solved..  only a problem of the ->      !
thanks to all community! :D
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Bruce Morgan on June 23, 2011, 01:05:31 am
Could someone post the corrected file?

Bruce
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: zanardi on June 23, 2011, 11:23:02 am
Well, since everyone seems to think the old way is better, i'll just revert the change for the next release.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: franzpeter on June 24, 2011, 11:16:39 am
@zanardi,

just my opinion: If VM 1.1.9 with or without the '!' has just a few neglectable 'bugs' now, wouldn't it be better to leave it as it is. VM 1.1.9 is EOL. Investing time and brain would only be necessary, if a serious problem (security issue) would occur, like sql injection or other things.
Why: Changes in the code need often need changes in the theme or in modules or other extensions. I think the most theme and extension developers do not invest a lot of time into further developement for old (EOL) code. The idea of the oscommerce developers to declare 2.3.1 as final and invest all efforts to develop the new 3.xx version, in case of VM 1.1.xx, that would mean 1.1.9 to declare as final and put all effort on 2.xx would be the better way. But as already said, just my opinion.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: mtovarnet on June 24, 2011, 20:08:55 pm
Thank you

is only dellete "!" character

Gracias

i've got the same problem here when i've update 1.1.8 to 1.1.9 ..

I only change the new:
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {

to the old line:
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {

and now it's solved..  only a problem of the ->      !
thanks to all community! :D
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Reincha on June 26, 2011, 13:08:32 pm
hi!
Had the same problem and also added ! to fix it for now, but i actually think the new code is correct. i think there is a problem with $child_list because if child_list is NOT empty e.g - !empty($child_list) - it shouldn't return that category is empty.

Correct me if i'm wrong.

update:
calling for $child_list returns:

Notice: Undefined variable: child_list in ...
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: veredanet on June 26, 2011, 23:06:13 pm
I try the last solution, and it works but not at all. The category tree appears but the link of the subcategory doesn't work.

i apreciate an actualization
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: veredanet on June 27, 2011, 01:51:45 am
I'm really disappointed with vm 1.1.9 version. I'm experience a lot of issues, example, i can't see my shopping cart, the sub categories appears but doesn't have an active link. Some one of the team has to check it soon, because this version has a lot of failures. pls help us, we need this tool
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: aravot on June 27, 2011, 06:01:22 am
Why are you disappointed? VirtueMart 1.1.9 Beta was released on May 28, 2011 for feedback from the community http://forum.virtuemart.net/index.php?topic=87070.0, after nearly a month with only one reply Stable version was released, if the community doesn't test or reply how are the team suppose to know what the issues are.

Even now in regards to shopping cart you haven't described your issue in detail so how is the team suppose to test/duplicate.

As suggested in the 3rd post you can use shop.browse.php from VM 1.1.8 to fix category view issue.

Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: zanardi on June 27, 2011, 10:54:28 am
@franzpeter:
totally agree with you. In fact, two days ago i repackaged 1.1.9 so that "!" is back where it belongs and the issue reported in this thread is no longer existant. Apart from serious security issues, 1.1.9 will be the last VM 1.1.x release. Please note, though, that there are no significant structural changes in 1.1.9 such that 3d party themes and extensions developers should be worried.

@veredanet:
version 1.1.9 has not that many changes, so it sounds strange that it creates a lot of issues. Maybe there is something different which went wrong during the install? Anyway, as Aravot said, if you open a new thread and describe carefully your issue, maybe someone will be able to help.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: franzpeter on June 27, 2011, 11:52:26 am
@zanardi,

I have found something else, what seems to have some influence on the theme. There must be a change too in the way VM handles the product availability. If I change the product availability with the date function, I receive double entries in the frontend. An example: If I say: product xyz 1 in stock and I change the date to future date say 15. July or so and give it a picture like out of stock, I receive double pictures in the frontend, one says availabilty is low stock and the date will be July 15th. and the other says: out of stock. Was there a change in the product details class too, I use VM Amazing from Yagendoo, and that theme shows that problem. Did already tell the yagendoo support about the issue.

I did try to test the beta release, but my problem is, that my localhost uses MySQL 5.5.x and VM does not install on that database version.

I think it is a good decision to leave (except of occurence of security issues) VM 1.1.x as it is.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: bh_scripts on June 28, 2011, 10:32:50 am
I did a grep (over all the code files) for $child_list and only found it in the line already mentioned - line 86 in shop.browse. So unless my grep went wrong $child_list isnt even set.
I recoded as:
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && (isset($category_id) && !$ps_product_category->has_childs($category_id))) {
Please let me know if I've missed something regarding $child_list.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: mhornbuckle on July 03, 2011, 16:55:26 pm
I added the ! where it is supposed to go, and my sub categories are still not appearing. Could it be something else? Thanks
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: fbcyborg on July 05, 2011, 12:34:19 pm
Thanks for the tip. It worked like a charm.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: wicko on July 12, 2011, 10:39:07 am
check the changes as mentioned above but all appeared to have already been made. Changed again anyway just in case I missed the odd character but made no change. Still the category say it is empty.
I then replaced the VM 1.1.9 shop.browse.php with VM 1.1.8 version and that fixed it straight away.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 12, 2011, 22:57:15 pm
it is still not working for me... not all of the categories appeers. look:
http://hockeysale.co.il/index.php?option=com_virtuemart&page=shop.browse&category_id=50&Itemid=1
http://hockeysale.co.il/index.php?option=com_virtuemart&Itemid=77
and there is some more.
please help me! what should i do ?

i changed the codes and now i can see the categories but i can't see the products assyou see.. please help me!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: digit on July 13, 2011, 18:59:43 pm
I had the same problems upgrading from 1.1.8, and the "!" partially solved my issues... than I used winmerge to compare the files and I discovered some missing code in 1.1.9.

I got the upgrade patch package 1.1.8 - 1.1.9 from this site.

Around line 250 in shop.browse.php 1.1.8 I have:

    $count_prod = $products_per_row;
    $tpl->set( 'count_products', $count_prod );

in 1.1.9 is missing. After adding the code to 1.1.9 version of shop.browse, my product lists are fully working again.

Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 14, 2011, 01:43:23 am
can you add your file ? maybe im doing it wrong, it's still not working for me O_o
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: lipi on July 14, 2011, 02:00:25 am
After days trying to figure out why these was happening, I have to say Thank you!.

I upload the two php files, the modified and the original. The modified works for me, but with the fact that now when I click on an empty category, the text "This category is empty" doesn't appear. It doesn't matter for me.



[attachment cleanup by admin]
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 14, 2011, 12:50:07 pm
sorry buddy , your modified version not working for me ....
look:
http://www.hockeysale.co.il/index.php?option=com_virtuemart&page=shop.browse&category_id=9&Itemid=1

thank you any ways....

someone else can help me?
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: digit on July 15, 2011, 16:27:32 pm
this is currently the version I'm using. It is V 1.1.9 file + "!" added + missing code from line 250 V 1.1.8 added.

[attachment cleanup by admin]
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 15, 2011, 17:23:04 pm
hi ,
i updated to 1.1.9 again , put your file but still some of my products are missing...
look at this two pages:
missing: http://hockeysale.co.il/index.php?option=com_virtuemart&page=shop.browse&category_id=9&Itemid=1
not missing: http://hockeysale.co.il/index.php?option=com_virtuemart&Itemid=78

i don't know why but it is runing my website!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: aravot on July 15, 2011, 18:25:59 pm
Maybe it is your theme try default VirtueMart theme.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 15, 2011, 21:41:27 pm
i tried to change the template but it didn't help ):
some other options ?
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 17, 2011, 14:54:52 pm
somebody ?! please!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: jaamsadams on July 18, 2011, 13:18:42 pm
I am new at VM, hardly started playing with a month back or so.

Any how I did check both with my template and defauld VM template (v1.1.5 & v1.1.9)

I did insert and removed that little !

Currently upon inserting ! it shows only product which have got set Categories as parent also. If no product has been bounded to parent it remains empty.

wouldn't it make better sense if it shows all special products for all underneath categories
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: tomml on July 20, 2011, 15:38:59 pm
i just restored my old website with akeeba backup ... i am not updating my virtuemart again to 1.1.9 , until it will be 100% fixed from bugs...

anyways, thanks for all the pepole who tried to help me here (:
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: sambo on July 28, 2011, 08:08:45 am
Thanks bh, that fixed my issue!

I did a grep (over all the code files) for $child_list and only found it in the line already mentioned - line 86 in shop.browse. So unless my grep went wrong $child_list isnt even set.
I recoded as:
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && (isset($category_id) && !$ps_product_category->has_childs($category_id))) {
Please let me know if I've missed something regarding $child_list.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: webdesco on July 28, 2011, 21:36:57 pm
sorry that my solution  http://forum.virtuemart.net/index.php?topic=81461.msg268327 (http://forum.virtuemart.net/index.php?topic=81461.msg268327) has caused problems with other users, I did suggest that you could leave the ! in place and modify the
browse_notables.tpl.php in my themes/mytheme/templates/browse/includes folder to include a condition that displays the empty category if $num_products ==0
However I'm guessing that if a category does not contain any products but does contain sub-categories that the $num_products would still equal zero and this solution might fail.

Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Anastasios on July 30, 2011, 11:31:24 am
Hello from Greece.
I had the same problem exactly when i updated to 1.1.9, with my categories but i thought my solution would to hide the main categories.
So that is what i did... But the problem remains and made other conflicts.

My problem now, except from the problem that i cant see my main kategories is...
When i go to any category its all good... when i click on a product starts the problem.
Once i get to the product... it sends me to another category.
It shows the product correctly but the explorer bar shows that i am in another category (and it shows on the menu also)... its very confusing for my customers and i cant work like that.
Please help.

My website is www.foodparty.gr and i have a translation tool for any language at the right.
If you need more info for the problem please ask me.

And thank God forums like this exist in order to help each other.

Thanks in advance.
Anastasios.
Respect others as you wish them to respect you.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: hdwebpros on August 01, 2011, 17:06:15 pm
Wow. got a big scare in front of 2 clients with the VM update. Don't know why the ! was removed, but I'm glad I found this post. Also, it shouldn't wait until the next release. Otherwise every single person that tries out VM for the first time will not have any nested sub categories available and will leave because they have to hack the code to make it work normally. Just my 2cents
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: publiccreate on August 23, 2011, 12:14:06 pm
hi, i use VirtueMart 1.1.9

I get an error does not load the Category when adding a new product

please help me

_________
Dien hoa (http://www.caycauvang.com)
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: mapshop on August 24, 2011, 23:31:41 pm
Just about went crazy when there were no products in our categories and subcategories. Looked at everything in admin, and all looked good (everything published!). Then came to the forum and found there were many, many others with the same dilemma. Well, since I am such a newbie, and know virtually nothing about changing the code, piecing together what everyone else said, for the categories and subcategories with no products in them (ex. books (no products), hiking books (no products) local hiking (products), I just added a product from another category (ex. compasses and hiking maps) as products that the customer might be interested in purchasing also, something like "relate products". And lo and behold!! I had my categories with products in them back. This might not be the correct and proper fix, but we have our site back. Implementing this strategy might be the solution for those of you out there, like me, that only know the basics!!! Hope this helps.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: taohi on August 28, 2011, 22:14:37 pm
i've got the same problem here when i've update 1.1.8 to 1.1.9 ..

I only change the new:
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {

to the old line:
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {

and now it's solved..  only a problem of the ->      !
thanks to all community! :D



Thanks a lot as i had the other lines (from the other post)  1.8 already in my browse.php wich didn´t help, your post did give me the solution.... jipi it works... Thank you veeeeeeeeeeeeeeeeeeeeeery much...

Klaus
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: vetoveljet on August 31, 2011, 11:24:07 am
Adding "!" to shop.browse.php file helped me a bit but didn't solve the problem. Before I was shown only "Categoty is empty" message - now I see name of category.
Yes I don't have any products in category but there is description of category with taxt and pic and some subcategories with products. I have tried all the tricks hinted here, changed templates etc. but still can't get working.
As it was working finely in 1.1.8 before upgrade - question is - how to roll back to VM 1.1.8 ? Just uninstalling current version without deleting tables or how? Has there been any changes in table structures because upgrade? Or any other suggestions I should test?

Joomla 1.5.23 and VM 1.1.9
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: aforantman on September 08, 2011, 06:36:33 am
Kelvyn's solution appears to have worked for us.  Much appreciated.  Cheers!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: gloton on September 09, 2011, 08:57:50 am
Sorry does not speak any English!!

my explain:

not working when...

in Configuration-Site-Layout-Configuration
Product List Style= Flat Product (fixed to 1 product per row, using a table)

shows the categories but, shows also the <th>
Nombre   SKU   Precio   Imagen en miniatura   Descripción   Acciones
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: sparta2011 on September 09, 2011, 20:38:49 pm
Hi everybody,

I have a problem with virtual mart 1.1.9. The products from the categories don't show up http://www.euroghidhoreca.ro/produse-discount?page=shop.browse&category_id=31. I bought soon a flyer VMJ Color PLUS for Virtual mart and  i understand that is a bug in Virtual Mart. I want to resolve this problem but i don't know how.

I have bean trying sens Wednesday.   

Can you help me, please....
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: acarhakan on September 10, 2011, 17:07:28 pm
There are just 2 lines different between administrator/components/com_virtuemart/html/shop.browse.php in V1.1.8 and 1.1.9

Around line 36 in 1.1.8
Code: [Select]
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));
becomes
Code: [Select]
$search_op= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_op', null ));
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));

and around line 85 in 1.1.8
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {becomes
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {(notice the missing ! in 1.1.9

Try adding in the ! and see if it fixes the issue.


DEAR FRIENDS,
 JUST PUTTING AND ! SIGN INTO THE CODE HAS BEEN SOLVED THIS PROBLEM
THANK YOU ALL VERY MUCH
MAY GOD BLESS YOU !

Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: silut7 on September 13, 2011, 16:40:45 pm
i've got the same problem here when i've update 1.1.8 to 1.1.9 ..

I only change the new:
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {

to the old line:
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {

and now it's solved..  only a problem of the ->      !
thanks to all community! :D
Many thanks. You save my life.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Jumbo! on September 13, 2011, 20:06:03 pm
Hi everybody,

I have a problem with virtual mart 1.1.9. The products from the categories don't show up http://www.euroghidhoreca.ro/produse-discount?page=shop.browse&category_id=31. I bought soon a flyer VMJ Color PLUS for Virtual mart and  i understand that is a bug in Virtual Mart. I want to resolve this problem but i don't know how.

I have bean trying sens Wednesday.   

Can you help me, please....
We have already fixed this Virtuemart 1.1.9 problem in VMJ Color Plus theme with a corrected copy of shop.browse.php. You just need to reinstall the complete VMJ Color Plus theme in your site will all hacks and the problem will be resolved. In case of any other queries related to the theme please post on our Support Forum.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: efocus on September 22, 2011, 01:26:05 am
Well, since everyone seems to think the old way is better, i'll just revert the change for the next release.

Zanardi, I can understand why VM users might not want a category to show up if it had no products in it. I have several clients that move products around and don't notice that they've orphaned a category, for instance.

So this could be a good thing except for one change: a main category with no products but does contain subcategories with products should still show up. This is a common scenario for my clients.

I sure appreciate all you developers as we wouldn't have VM without you!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: vistadon on September 23, 2011, 05:20:42 am
I did a grep (over all the code files) for $child_list and only found it in the line already mentioned - line 86 in shop.browse. So unless my grep went wrong $child_list isnt even set.
I recoded as:
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && (isset($category_id) && !$ps_product_category->has_childs($category_id))) {
Please let me know if I've missed something regarding $child_list.
Thanks for the tip. It worked like a charm.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: jjspelman on October 04, 2011, 05:36:27 am
This did not work for me. I am running Joomla 1.5.22 and VM 1.19.

Adding the "!" did not show the subcategories when clicking on the category link on the site.

Guess I will just delete the main category for the time being. I can get away with that on this site, but don't think this is the ideal solution for upcoming projects.

Is this fixed in 2.0?
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: dantek on October 05, 2011, 19:21:14 pm
Thank you
it works by simple adding "!" before empty($child_list)) {

from
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {
to
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {


Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: ptk013 on October 20, 2011, 01:57:06 am
Hi All

Did everything within this post to no avail.
Whats strange is that I can add product to categories that were previously created in earlier versions of VM and they show.
When I add a new category and then new product within VM1.1.9 the product does not show and yes they are published.

See http://signedandnumbered.com.au/genna-campton.html

Any ideas????

Phil
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: rblezer on October 23, 2011, 11:22:49 am
The ! in line 85 worked for me.

Thanks very much....!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: roc on October 25, 2011, 10:06:48 am
hello,

I have added the missing ! and it solved part of the problem, but i still can't see my products.  I have had someone working on my site and I believe my products are in sub categories.  I can now see my category listing... but no products. (my products still list properly when someone is logged in, but not a general user)

I believe someone else on this thread also had the same issue but I did not see (or recognise) a solution.

Has anyone found a complete solution for this problem?

thanks. 
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: peso on October 25, 2011, 18:40:29 pm
hey hey...

unfortunately i  have the same problem as the person above me. by adding the "!" the categories are displayed with description, but the products are missing...

has anyone an idea?

cheers
peso
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: OzRic on October 26, 2011, 19:24:06 pm
Exact this solution isn't valid anymore.

Lots of people would like to have an update on that !
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: lanmi13 on November 11, 2011, 15:32:29 pm
Really annoying and frustrating. Is there any other solution, update,... anything?
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: arpitap on November 30, 2011, 01:38:52 am
Thanks. this hack worked for me like a charm. but I think developer of the virtuemart should add this in latest version so people dont have to search for hack.


Regards,
Arpita
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: earthrat on January 23, 2012, 17:12:37 pm
So the VM team did not see that as a major problem and push a fix to the version? How pathetic!!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: OpenGlobal on January 31, 2012, 16:44:44 pm
Nooooooo!!! Stop!!

Adding the '!' does not fix the problem, it just "fudges" the problem. The problem is that $child_list is ALWAYS empty. At the line where it checks if it's empty, it will always be empty, there is nothing anywhere in the code setting $child_list to a value. By adding a '!', all you are doing is preventing the Empty Category message from ever showing.

ie. If you have a category with no products and no subcategories, you just get a blank page with no "Empty Category" message.

A much better solution would be to add:

$child_list = $ps_product_category->get_child_list($category_id);

at the end of the "if ( $category_id ) " block (ie. around line 80).

This will populate the array if there are any subcategories and so the the if/elseif/elseif/else block will behave correctly.

We must stop condoning these fudge fixes, it is reducing the quality of the code. If there is going to be a 1.1.10 then it must contain this fix (or a similar effective solution) not the '!' fudge fix. I just hope the fudge fix hasn't been carried forward to the 2.x code stream.

OpenGlobal
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Darkman23 on March 03, 2012, 02:53:00 am
Dear Openglobal!

What do you exactly where to insert?
Thx!
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: OpenGlobal on March 03, 2012, 11:04:42 am
Add:

$child_list = $ps_product_category->get_child_list($category_id);

at the end of the "if ( $category_id ) " block (ie. around line 80).

So the "if" block in shop.browse.php should look like this (on 1.1.9):

Code: [Select]
if( $category_id ) {
        /**
    * CATEGORY DESCRIPTION
    */
        $db->query( "SELECT category_id, category_name FROM #__{vm}_category WHERE category_id='$category_id'");
        $db->next_record();
        $category_name = shopMakeHtmlSafe( $db->f('category_name') );

        // Set Dynamic Page Title
        $vm_mainframe->setPageTitle( $db->f("category_name") );

        $desc =  $ps_product_category->get_description($category_id);
        $desc = vmCommonHTML::ParseContentByPlugins( $desc );
        // Prepend Product Short Description Meta Tag "description" when applicable
        $mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
        $child_list = $ps_product_category->get_child_list($category_id);
}

OpenGlobal
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: samuelpires on March 09, 2012, 17:17:25 pm
Didn't work for me... any other solution, please...
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: maxispin on March 22, 2012, 07:22:27 am
Remember to empty CACHE after (!) modifaction in line 86
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: ironlion37 on March 26, 2012, 21:17:26 pm
None of this is working for me. Sub-categories are still not displaying:

http://tribaltraditions.org/index.php/virtuemart?page=shop.browse&category_id=4

I tried:
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: ironlion37 on March 26, 2012, 21:23:57 pm
Mmm, found the solution.

I'm using rockettheme mynxx template. Here's the fix:

http://www.rockettheme.com/forum/index.php?f=186&t=91684&p=466599&hilit=mynxx%20sub%20categories%20not%20displaying&rb_v=viewtopic#p466599
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: mowlman on April 16, 2012, 16:03:35 pm
openglobal's fix to leave the ! off of line 86 of admin/components/com_virtuemart/html/shop.browse.php
Code: [Select]
elseif( $num_rows == 0 && empty($product_type_id) && empty($child_list)) {
as it was intended in the VM1.1.9 release
and Add:

Code: [Select]
$child_list = $ps_product_category->get_child_list($category_id);
at the end of the "if ( $category_id ) " block (ie. around line 80).
Worked for me.

http://forum.virtuemart.net/index.php?topic=88020.msg320389#msg320389

http://forum.virtuemart.net/index.php?topic=88020.msg326735#msg326735 (http://forum.virtuemart.net/index.php?topic=88020.msg320389#msg320389

http://forum.virtuemart.net/index.php?topic=88020.msg326735#msg326735)
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: TooNewbie on June 04, 2012, 23:54:32 pm
Add:

$child_list = $ps_product_category->get_child_list($category_id);

at the end of the "if ( $category_id ) " block (ie. around line 80).

So the "if" block in shop.browse.php should look like this (on 1.1.9):

Code: [Select]
if( $category_id ) {
        /**
    * CATEGORY DESCRIPTION
    */
        $db->query( "SELECT category_id, category_name FROM #__{vm}_category WHERE category_id='$category_id'");
        $db->next_record();
        $category_name = shopMakeHtmlSafe( $db->f('category_name') );

        // Set Dynamic Page Title
        $vm_mainframe->setPageTitle( $db->f("category_name") );

        $desc =  $ps_product_category->get_description($category_id);
        $desc = vmCommonHTML::ParseContentByPlugins( $desc );
        // Prepend Product Short Description Meta Tag "description" when applicable
        $mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
        $child_list = $ps_product_category->get_child_list($category_id);
}

OpenGlobal

WOW!!! that´s Mastery OpenGlobal, the line works smoothly on my development ( I am just a designer), I notice the fudged fix while getting my empty categories didn´t showed the previous message about "empty category".

WOW!!! and Thank you, your fix solve both problems for 1.1.9 Version.

I guess moderator have to take this thread as solved with your fix.

In teh other hand I wonder why such an issue is not fixed in the released 1.1.9 version, at least 2.0 have not worked for me and I have to get back to a previous development like 1.1.9


Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: aravot on June 05, 2012, 01:46:54 am
I believe VM 1.1.9 is the last version of VM 1.1.x branch, core developers are working on VM 2.0 and VM 1.1.x branch is no longer been worked on however we have released VirtueMart 1.2.0 http://joomlacode.org/gf/project/vm11j25/frs/ which is the same as VM 1.1.9 but for Joomla 2.5.x only and this bug is fixed in VM 1.2.0.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: OpenGlobal on June 05, 2012, 09:21:50 am
Maybe it would be worth releasing a patch for 1.1.9 with this change in as it's quite a fundamental problem (and such a simple fix).

OpenGlobal
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: emizz on July 10, 2012, 11:36:08 am
Thanks for solving the problem right way OpenGlobal!

Worked like a magic..
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Elboy on October 21, 2012, 21:07:32 pm
Hi there, i had the same problem with my VM menu item not linking to the category page, which i managed to fix by deleting the menu item and then recreating it.

I tried a bunch of things first but then as a last resort i tried this and it worked.

I created a new menu item > virtuemart in main menu and called it shop2 and it loaded the category page fine. I checked the difference between the new menu item and the old one and there was no difference. Wierd! So i just deleted the orignal shop menu item and then renamed the new one.

hope this helps as this could be the last thing you try but it fixed my problem.
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: SimonHodgkiss on January 10, 2013, 12:14:10 pm
This fix is perfect! Many thanks!


Add:

$child_list = $ps_product_category->get_child_list($category_id);

at the end of the "if ( $category_id ) " block (ie. around line 80).

So the "if" block in shop.browse.php should look like this (on 1.1.9):

Code: [Select]
if( $category_id ) {
        /**
    * CATEGORY DESCRIPTION
    */
        $db->query( "SELECT category_id, category_name FROM #__{vm}_category WHERE category_id='$category_id'");
        $db->next_record();
        $category_name = shopMakeHtmlSafe( $db->f('category_name') );

        // Set Dynamic Page Title
        $vm_mainframe->setPageTitle( $db->f("category_name") );

        $desc =  $ps_product_category->get_description($category_id);
        $desc = vmCommonHTML::ParseContentByPlugins( $desc );
        // Prepend Product Short Description Meta Tag "description" when applicable
        $mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
        $child_list = $ps_product_category->get_child_list($category_id);
}

OpenGlobal
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: bocek on January 30, 2013, 17:37:14 pm
Thank you. Adding ! worked for me
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: mkt on February 09, 2013, 07:41:57 am
Hello from Kazakhstan. Still not work :( ... please anything else solution. I really need to resolve this problem...
Title: Re: Bug in Virtuemart 1.1.9 with category module
Post by: Flygye on April 16, 2013, 18:59:49 pm
According to this thread discussion, i have another question.

And if a category is empty (have no products),  but this category  have  sub-categories (children).

How i made when i click on the main category  to view all the products off the first sub-categoy?

 - main category (no prod)
---- sub-category1 (have products)
---- sub-category2