Author Topic: Choose a variant duplicated in generic childs  (Read 2450 times)

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Choose a variant duplicated in generic childs
« on: September 29, 2015, 16:22:53 pm »
Hi

Using vm 3.0.1.0 joomla 3.4.4

Using generic child variants gives us double "choose variant" message per product in the category browse and the product details.

I understand the "add to cart" button turns in to "choose variant" but the dropdown box already shows the "choose a variant" text.

I think the button should be removable from view since the text is already present in the dropdown.

This is easy to check in the demo itself:

http://demo.virtuemart.net/product-variants/generic-child-cart-variant-detail


Looks even more strange in our website:

http://comenaranjas.com/en/shop/seasonal-fruits.html


I dont know why the demo doesnt show the dropdown selection box in this view http://demo.virtuemart.net/product-variants I guess cause joomla 2.5

But please notice that the customer gets duplicated message per product.


Regards

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2460
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Choose a variant duplicated in generic childs
« Reply #1 on: September 30, 2015, 08:05:42 am »
Hello

This has been around for a while, at some point the text "Choose a variant" was "editable" and this made even less sense. I have removed this on my site and I think I used css to do it, but I could have made an override. I don´t have access to the code right now, If no one else comes back to you on this I will send my solution tonight.

Nice template, by the way :)

have a nice one

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Choose a variant duplicated in generic childs
« Reply #2 on: September 30, 2015, 15:58:31 pm »
It is not joomla.

You can configure the generic variant differently. In your case it would make most sense to modify a bit the function getAddToCartButton, which just calls

return self::renderVmSubLayout('addtocartbtn',array('orderable'=>$orderable));

So a simple override of addtocartbtn should work.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Choose a variant duplicated in generic childs
« Reply #3 on: September 30, 2015, 16:44:40 pm »
Thanks guys, yes ill try that,

Jorgen your code will help a lot yes ;)

Is the file to modify vm-ltr-site.css?

Firebug points me to that one.

Regards ;)

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2460
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Choose a variant duplicated in generic childs
« Reply #4 on: September 30, 2015, 23:26:38 pm »
Hello lindapowers

I almost forgot about this.

If I remember it right this simple css should hide the "Choose a variant' :

Code: [Select]
span.addtocart-button-disabled, input.addtocart-button-disabled {
display: none;
}

Add this code in a css file that is loaded after the VM css files.
I don´t see any other changes, report back if it doesn´t work for You.

regards

Jörgen @ Kreativ Fotografi


Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Choose a variant duplicated in generic childs
« Reply #5 on: October 01, 2015, 00:07:13 am »
Hello lindapowers

I almost forgot about this.

If I remember it right this simple css should hide the "Choose a variant' :

Code: [Select]
span.addtocart-button-disabled, input.addtocart-button-disabled {
display: none;
}

Add this code in a css file that is loaded after the VM css files.
I don´t see any other changes, report back if it doesn´t work for You.

regards

Jörgen @ Kreativ Fotografi




Hi thanks for help, I tried it but adding the code had no effect.

I tried directly in the code of /components/com_virtuemart/assets/css/vm-ltr-site.css:

Around line 320

Code: [Select]
.browse-view span.addtocart-button-disabled, .featured-view span.addtocart-button-disabled, .latest-view span.addtocart-button-disabled, .topten-view span.addtocart-button-disabled, .recent-view span.addtocart-button-disabled, .related-products-view span.addtocart-button-disabled, .browse-view span.addtocart-button-disabled, .addtocart-button-disabled {
  display: inline-block;
  padding: 12px;
  border: 1px solid #ddd;
  font-size: 16px;
  border-radius: 4px;
  margin: 0;
  color: #aaa;
  width: 192px;
  box-sizing: border-box;
  text-align: center;
}

I change the display to none, and hides it but when you choose a variant the add to cart button doesnt appear either.


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Choose a variant duplicated in generic childs
« Reply #6 on: October 01, 2015, 01:48:13 am »
btw, did you check the parameters of the customfield? I mean of the "prototype" ? As far as I know, there is an option for that.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Choose a variant duplicated in generic childs
« Reply #7 on: October 01, 2015, 06:24:45 am »
btw, did you check the parameters of the customfield? I mean of the "prototype" ? As far as I know, there is an option for that.

Hi Max I tried different settings but cant find anything related in the parameters.

I understand that a parent product not ordeable changes the add to cart button to "choose variant", an option would be great, I though there was too but cant find it and if some guys are using custom code maybe is missing indeed.

I just see this:





I get a different behaviour in joomla 3.5 from the joomla 2.5 demo:


Product details
Demo: http://demo.virtuemart.net/product-variants/generic-child-cart-variant-detail you see the "choose a variant" button when no child is selected yet.

Website http://comenaranjas.com/en/shop/seasonal-fruits/apples-kg-detail.html Button is hidden until you select a variant.


Category view

I think in the demo  there is no selection dropdown box for the generic child variant cause the layout is set to "ontop" instead of "addtocart" http://demo.virtuemart.net/product-variants


I can't change those settings in the demo to check but setting "ontop" in my website hides the dropdown box too (even in the product details view).










Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2460
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Choose a variant duplicated in generic childs
« Reply #8 on: October 01, 2015, 08:52:09 am »
Hello again

I have looked through my overrides and can´t find any more Changes in any of the other files thay should be needed for this to work. I made the same changes using Your layout and it seemed to work. Is it possible You added the css rule in the wrong place ? This should not be overridden. I have added this in the css file called template.php in my modified joomlaxtc template. This gets loaded as the last file of the css files and after VM3 css files.

My solution is a band aid and if Max comes up with a better solution that would be great.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Choose a variant duplicated in generic childs
« Reply #9 on: October 01, 2015, 13:31:09 pm »
The combination of display parent and parent orderable decide imho if the 0 option is added.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Choose a variant duplicated in generic childs
« Reply #10 on: October 01, 2015, 19:51:01 pm »
The combination of display parent and parent orderable decide imho if the 0 option is added.
Problem is when your parent is not ordeable or dont want it displayed in the list, but even trying that combination didnt work for us.

Our parents are basicly category holders with no price, not ordeables or displayed. An option here would be great or ideally the system should hide the duplicated button"choose a variant" in the category view at least.

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Choose a variant duplicated in generic childs
« Reply #11 on: October 02, 2015, 07:15:37 am »
Hello again

I have looked through my overrides and can´t find any more Changes in any of the other files thay should be needed for this to work. I made the same changes using Your layout and it seemed to work. Is it possible You added the css rule in the wrong place ? This should not be overridden. I have added this in the css file called template.php in my modified joomlaxtc template. This gets loaded as the last file of the css files and after VM3 css files.

My solution is a band aid and if Max comes up with a better solution that would be great.

regards

Jörgen @ Kreativ Fotografi

Hi I cant find a template.php for mine but tried in several css and I even have a parameter in the template to add custom code but strangely when adding it the code was reflected in the page.

Anyway checking the SVN http://dev.virtuemart.net/projects/virtuemart/repository I saw Max added this:

"customfield generic child is now shown in category browse view"

-----------------------------------

But I'm a bit confused with the fix since we already have it visible in browse view and I believe you too since we are talking precisely about hiding the button in category browse view.


Regards

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2460
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Choose a variant duplicated in generic childs
« Reply #12 on: October 02, 2015, 07:56:52 am »
Hello

Quote
Hi I cant find a template.php for mine but tried in several css and I even have a parameter in the template to add custom code but strangely when adding it the code was reflected in the page.

Could not really follow this, have You got the css working ? There could be something with Your template that prevents it, but as I said before I just added and tested with the F12 debugger in Explorer and the fix worked, just have to put it in the right file. Doesn´t Yagendo suggest a file to use for custom css ? joomlaxtc suggests a file called template.php, but Yagendo may have completely different solution.

Quote
"customfield generic child is now shown in category browse view"

As soon as I choose a Child it redirects to the details view, so Max comment should be ok. You can only see the Child choises in the drop down list of browse view. I don´t actually see the selected generic Child in the browse view. I am using VM3.0.8, so there maybe an enhancement in 3.0.10 that Max is talking about. Have not checked this out yet.

regards

Jörgen @ Kreativ Fotografi

Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Choose a variant duplicated in generic childs
« Reply #13 on: October 02, 2015, 09:24:12 am »
Hello

Quote
Hi I cant find a template.php for mine but tried in several css and I even have a parameter in the template to add custom code but strangely when adding it the code was reflected in the page.

Could not really follow this, have You got the css working ? There could be something with Your template that prevents it, but as I said before I just added and tested with the F12 debugger in Explorer and the fix worked, just have to put it in the right file. Doesn´t Yagendo suggest a file to use for custom css ? joomlaxtc suggests a file called template.php, but Yagendo may have completely different solution.

Quote
"customfield generic child is now shown in category browse view"

As soon as I choose a Child it redirects to the details view, so Max comment should be ok. You can only see the Child choises in the drop down list of browse view. I don´t actually see the selected generic Child in the browse view. I am using VM3.0.8, so there maybe an enhancement in 3.0.10 that Max is talking about. Have not checked this out yet.

regards

Jörgen @ Kreativ Fotografi



Hi, I'm not sure if Max is talking about reloading the child in the category view browse, that would be amazing and was requested months ago but I think he said that would require other files to be modified, javascript and not just the customfields.php

I do see the child in the category browse view but when choosed im redirected to the detail view.

In order to see it I just had to change the position in the properties of the custom field to "addtocart"

Yagendoo have a parameter in the template to add aditional code, thats where I tried too but the code appeared written in the frontpage.

You have a link to your page to check your generic child variants in frontpage?


Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2460
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Choose a variant duplicated in generic childs
« Reply #14 on: October 02, 2015, 10:22:52 am »
Hello lindapowers

Of course, the website is in Swedish, have had some issues when switching between languages so German and English is unfortunately inactivated at the moment.

Here is a link to step rings, they have a lot of variants, any of the Products will do, but "Step up ringar" is a good example.
http://cms.kreativfotografi.se/index.php?option=com_virtuemart&view=category&virtuemart_category_id=137&lang=sv


regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)