News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Ajax in category browse view doesn't work without full category tree

Started by lindapowers, October 22, 2016, 16:19:04 PM

Previous topic - Next topic

lindapowers

Hi

As a resume in 3.0.18.1:


A) Childs not loading without full category tree checked or disabling VM SEO.

Issue is only present if you dont use categories in your VM urls, an issue with the router file?


B) Featured products appearing in unrelated parent/childs


C) Childs in dropdown show price 0.00 if the parent has no price set (This one appeared in 3.0.18.1 they show correct price in 3.0.18)


As a side note I don't use any type of customization for the core and I tested in clean Protostar installation too with same effect.


Regards


Milbo

C) Childs in dropdown show price 0.00 if the parent has no price set (This one appeared in 3.0.18.1 they show correct price in 3.0.18)

What is the correct price? the price is in the parentparent?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: Milbo on November 08, 2016, 15:39:04 PM
C) Childs in dropdown show price 0.00 if the parent has no price set (This one appeared in 3.0.18.1 they show correct price in 3.0.18)

What is the correct price? the price is in the parentparent?

Please see first product "Manzanas" VM 3.0.18.1

http://renovada.comenaranjas.com/es/tienda/fruta-de-temporada.html

against same product in VM 3.0.18 http://www.comenaranjas.com/es/tienda/fruta-de-temporada.html

You can see the difference in the dropdown.


The price is set in each child but in 3.0.18.1 only shows price in the dropdown if parent has price. In 3.0.18.1 I set price to the parent product "peras"  and in that dropdown prices are shown.

Milbo

http://dev.virtuemart.net/attachments/download/1029/com_virtuemart.3.0.18.3_extract_first.zip

The parent price problem is solved. Somehow it was need that the parent price was set, anyway fixed now. I take a look on your products
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: Milbo on November 08, 2016, 21:15:23 PM
http://dev.virtuemart.net/attachments/download/1027/com_virtuemart.3.0.18.2_extract_first.zip

The parent price problem is solved. Somehow it was need that the parent price was set, anyway fixed now. I take a look on your products

Thanks that one is solved.

I guess you are making changes in the router, got this error while switching VM SEO off:

Notice: Undefined property: vmrouterHelper::$Jlang in components/com_virtuemart/router.php on line 1159

Fatal error: Call to a member function getTag() on null in components/com_virtuemart/router.php on line 1159


Issues remaining:

A) Childs not loading without full category tree checked or disabling VM SEO.

Issue is only present if you dont use categories in your VM urls, an issue with the router file?


B) Featured products appearing in unrelated parent/childs




Studio 42

@max
If you are in the router, please check or set correctly the menu itemid, this give a warning when the sessions is empty.(only visible in log file or on dev mode).

Milbo

Patrick, please take a look on the router. The itemid mapping got enhanced if there is no itemid, the constructor of the helper directly loads the homepage itemid as fallback
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Quote from: lindapowers on November 09, 2016, 08:40:04 AM
Quote from: Milbo on November 08, 2016, 21:15:23 PM
http://dev.virtuemart.net/attachments/download/1027/com_virtuemart.3.0.18.2_extract_first.zip

The parent price problem is solved. Somehow it was need that the parent price was set, anyway fixed now. I take a look on your products

Thanks that one is solved.

I guess you are making changes in the router, got this error while switching VM SEO off:

Notice: Undefined property: vmrouterHelper::$Jlang in components/com_virtuemart/router.php on line 1159

Fatal error: Call to a member function getTag() on null in components/com_virtuemart/router.php on line 1159

The constructor of the helper grants that this object is there

if ( $this->seo_translate ) {
$this->Jlang = VmConfig::loadJLang('com_virtuemart.sef',true);
} else {
$this->Jlang = JFactory::getLanguage();
}

So it seems some 3rd party software, which does not instanciate the helper correctly.

Quote from: lindapowers on November 09, 2016, 08:40:04 AM
Issues remaining:

A) Childs not loading without full category tree checked or disabling VM SEO.

Issue is only present if you dont use categories in your VM urls, an issue with the router file?


B) Featured products appearing in unrelated parent/childs

I cannot reproduce any of it and even did not understood it, checking your pages.[/code]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: lindapowers on November 09, 2016, 08:40:04 AM
Issues remaining:

A) Childs not loading without full category tree checked or disabling VM SEO.

Issue is only present if you dont use categories in your VM urls, an issue with the router file?


B) Featured products appearing in unrelated parent/childs

Quote from: Milbo on November 09, 2016, 13:12:30 PM


I cannot reproduce any of it and even did not understood it, checking your pages.


Hi

I've set up the  page so you can check again, this time with VM 3.0.18.3

http://renovada.comenaranjas.com/en/shop/seasonal-fruits.html First 6 products are generic childs, you can see switching between childs has no effect or randomly you get only the featured products.



SEO settings to reproduce issue:



Use full category tree checked makes the ajax work again, also disabling VM SEO.


Studio 42

I checked the links for your generic child variants.
THis are bad.
FOr this main product http://renovada.comenaranjas.com/en/shop/pears.html

When you have nothing in the Joomla session /en/shop.html/category/?virtuemart_product_id=165
after /en/shop.html?virtuemart_product_id=165
So the link do not get any category at all !
And i think that this is a router problem because last modification.

I think that now the problem is bigger as before and you need perhaps to set menu item links in Joomla for each main categories, else the router do not work properly.
But because now Virtuemart set category id from session in some case, this break the link too.

lindapowers

Quote from: Studio 42 on November 18, 2016, 13:06:58 PM
I checked the links for your generic child variants.
THis are bad.
FOr this main product http://renovada.comenaranjas.com/en/shop/pears.html

When you have nothing in the Joomla session /en/shop.html/category/?virtuemart_product_id=165
after /en/shop.html?virtuemart_product_id=165
So the link do not get any category at all !
And i think that this is a router problem because last modification.

I think that now the problem is bigger as before and you need perhaps to set menu item links in Joomla for each main categories, else the router do not work properly.
But because now Virtuemart set category id from session in some case, this break the link too.


Hi Patrick

Thanks for checking. Yes those concrete settings I copied in the screenshot omit the category and that seems to conflict with the ajax, thats why I always though it was a router issue.

In the repository Max's last change says "Added new function in router.php which takes care of loading ids or slugs with multilang using the vm config vm_lfbs" http://dev.virtuemart.net/projects/virtuemart/repository

Not sure if that one could solve the issue or is not related.

Regards

Studio 42

Hi manu,
The first problem, is that for same product, you don't get same URL when session is empty.
This is bad for SEO and of course can have other effects for links.
It's perhaps a nice feature to have short URLs, but if this not give duplicates entries. I know that VM have canonical URL, but i'm not sure that in this case, canonical is correct and not simply give some 404 errors for the users for more case as this.

Milbo

You do not need a menuitem per category, but you can use one.

But it makes sense to switcht the virtuemart view to the new category view, and please use this version.

http://dev.virtuemart.net/attachments/download/1030/com_virtuemart.3.0.18.4_extract_first.zip
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: Milbo on November 18, 2016, 19:29:33 PM
You do not need a menuitem per category, but you can use one.

But it makes sense to switcht the virtuemart view to the new category view, and please use this version.

http://dev.virtuemart.net/attachments/download/1030/com_virtuemart.3.0.18.4_extract_first.zip

Hi testing 3.0.18.4

Wasn't sure if you meant this but If I change the VM frontpage menu item to VM category menu item and ajax works perfectly.

If there is a menu item of type VM/Front Page ajax has issues, it doesn't load or loads featured or latest products added in unrelated parent/childs.

I tried also having both menu items, one for front page and one for category but it fails, if you have published the menu item for VM/Front page it causes issues.



So in the spanish version I changed the menu item VM/Front Page to VM/Category view and ajax seems to work fine http://renovada.comenaranjas.com/es/tienda/fruta-de-temporada.html

While on the english version the Menu Item is set to VM/Front Page which causes malfunction in ajax http://renovada.comenaranjas.com/en/shop/seasonal-fruits.html




About the VM Category view menu item:

Noticed settings for "show store description" and "show categories" doesn't seem to display the store description and categories in that menu item. Tried setting the VM subordinated item ID too. Also Show products of the selected category to NO will hide everything in the page- I guess this last one is normal if it doesnt show categories or store description.

As I see you intend to make the category view work also as frontpage which is great. Don't know if optionally or the VM/Front page is deprecated.

Milbo

Quote from: lindapowers on November 19, 2016, 11:50:37 AM
Quote from: Milbo on November 18, 2016, 19:29:33 PM
You do not need a menuitem per category, but you can use one.

But it makes sense to switcht the virtuemart view to the new category view, and please use this version.

http://dev.virtuemart.net/attachments/download/1030/com_virtuemart.3.0.18.4_extract_first.zip

Hi testing 3.0.18.4

Wasn't sure if you meant this but If I change the VM frontpage menu item to VM category menu item and ajax works perfectly.

If there is a menu item of type VM/Front Page ajax has issues, it doesn't load or loads featured or latest products added in unrelated parent/childs.

I mentioned it here, but not clearly enough https://virtuemart.net/news/latest-news/477-release-of-3-0-18-connecting-the-loose-ends
Quote
Since it is the last of its series, we added some of the membership features to the main version. So product variants work now also in the category browse view. Changing the ordering within a dropdown of a multivariant was quite painful. But we added a drag and drop for the children list, so it is very easy to adjust.

Quote from: lindapowers on November 19, 2016, 11:50:37 AM
I tried also having both menu items, one for front page and one for category but it fails, if you have published the menu item for VM/Front page it causes issues.

Yes the "virtuemart" frontpage view is deprecated. The virtuemart view was always just a category view for the top level category and displayed the products in groups. The new category view has now the options of the old frontpage virtuemart view. So you can now show on any category menu item grouped products.

So when the category view can do the same as the frontpage view, we dont need it anylonger. The reloading by ajax depends on the used view. When we are on the category browse view, we need another ajax, then the one in the productdetails. Some people want ajax in the productdetails, but no ajax in the category browse view. So the ajax is setup a bit different per view. From my point of view it makes no sense to add the stuff to the virtuemart view. We would just have doubled code. Bad for maintenance of the code and it is also likely to get copy/paste errors.

The version has an updater for the old category menu links. Patrick, you may notice that you can only change the category and manufacturer id per URL, before you could change anything per URL, this is blocked now. The params are taken from the menu. There is also an updater for the virtuemart view, but it is uncommented. We need more experience with it.

Quote from: lindapowers on November 19, 2016, 11:50:37 AM
Noticed settings for "show store description" and "show categories" doesn't seem to display the store description and categories in that menu item.
This can only work with the new layout files, because these options are new. So please try again without any override.

Quote from: lindapowers on November 19, 2016, 11:50:37 AM
Tried setting the VM subordinated item ID too. Also Show products of the selected category to NO will hide everything in the page- I guess this last one is normal if it doesnt show categories or store description.

As I see you intend to make the category view work also as frontpage which is great. Don't know if optionally or the VM/Front page is deprecated.

You dont need to set subordinated id. This is more for people, who had one virtuemart frontpage and one main category item. When you set a subordianted id, all following params are ignored and it takes the "main params" of the set menu item. Just leave it empty.
Before it was so, you clicked on a category or product from the frontpage. Then the router found the category for the product or just opened the category. So you had directly the "category settings".
Now there is no difference, you are already on a category view and when you click on another category, you would just keep the menu item with all settings. That means if you use the new category view with grouped products so that it looks like the old frontpage view, then you would have all the time grouped products.

The subordinated settings should set to your old category view settings and the normal settings like the frontpage. Then it is as before.

Quote from: lindapowers on November 19, 2016, 11:50:37 AM
Show products of the selected category to NO will hide everything in the page

This is an "error" in the old layout which was not a problem, yet. Just change around line 70 in default.php of the category browse view

if($this->showproducts){


to

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


Then it will work as intended.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/