Author Topic: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class  (Read 380 times)

razor7

  • Jr. Member
  • **
  • Posts: 298
    • MGSCreativa - Professional VM!
Hi! Today I received a scary email from VM saying that upgrade to J! 3.7.1, to be released soon, will be mandatory and because of that, I need to upgrade to VM 3.2.2.

I have upgraded my dev site and enabled Enable legacy layouts in config, but the product details break because of some sort of issue with the extra fields.

I do want to upgrade my overriden VM layouts in my template but can't find a comprehensive guide to do so.

Do you have detailed VM templates migration steps?

Thanks!
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26038
  • Always on vacation
    • Jenkin Hill Internet
Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
« Reply #1 on: May 16, 2017, 18:04:03 pm »
The only templte mods I'm aware of were l;isted here:  http://forum.virtuemart.net/index.php?topic=136826.msg478498#msg478498

But as configuration is greatly enhanced now, more people seem to have issues with config than with templates.
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.3.9579 on Joomla 3.7.3 PHP 7.0.19

Testing VMVM3.2.4 on J!3.7.3

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7485
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
« Reply #2 on: May 16, 2017, 18:44:43 pm »
basically you need to compare the stock VM templates with yours and update accordingly

as own template "templates" tend to only be styling it is often easier just to dump the stock ones in your over rides and restyle them like the previous ones
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

razor7

  • Jr. Member
  • **
  • Posts: 298
    • MGSCreativa - Professional VM!
Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
« Reply #3 on: May 17, 2017, 02:35:05 am »
Hi! Thaks for all the replies!

Sadly my template migration didn't end up well. If I access a product details, and select an extra fields dropdown item, the page gets reloaded through ajax but it only displays the product image.

I'm totally confused, because, for testing purposes, I have set beez template to spanish lang and custom template to english. If I load a product in spanish, the custom field dropdown reloads the page just fine, no errors, no console error, no PHP errors, nada!

If I try the same product with the custom template, it fails as described above, on custom field change, ajax request, then displays product image only.

I know that given the above test the issue should be the template, but I can't find the source of the issue, because no errors are shown (JS nor PHP)

If you can take a look, please review this two URLs

Beez template, working just fine (try to change dropdown "PerĂ­odo de Soporte y Actualizaciones")
https://it.mgscreativa.com.ar/mgs/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=24&virtuemart_product_id=138&Itemid=1218&lang=es

Custom template, doesn't work (try to change dropdown "Support and Updates Period")
https://it.mgscreativa.com.ar/mgs/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=24&virtuemart_product_id=114&Itemid=1238&lang=en

Thanks in advise!


MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

razor7

  • Jr. Member
  • **
  • Posts: 298
    • MGSCreativa - Professional VM!
Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
« Reply #4 on: May 17, 2017, 14:33:06 pm »
Well, I think I found a bug...

In my template, I have enabled display of related products, and after render I get related products blocks generated by /components/com_virtuemart/sublayouts/related.php like this:

Code: [Select]
<div class="product-field product-field-type-R">
    <span class="product-field-display">
        <div class="product-container">
            <div class="vm-product-media-container">
                <a href="/mgs/index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=74&amp;virtuemart_category_id=12&amp;Itemid=1238&amp;lang=en" title="MercadoPago" target="_blank"><img src="/mgs/images/stories/virtuemart/product/resized/logo-mercadopago9_295x295.png" alt="logo-mercadopago9"  />
                    MercadoPago
                </a>
            </div>
        </div>
    </span>
</div>
<div class="product-field product-field-type-R">
    <span class="product-field-display">
        <div class="product-container">
            <div class="vm-product-media-container">
                <a href="/mgs/index.php?option=com_virtuemart&amp;view=productdetails&amp;virtuemart_product_id=156&amp;virtuemart_category_id=26&amp;Itemid=1238&amp;lang=en" title="XE" target="_blank"><img src="/mgs/images/stories/virtuemart/product/resized/logo-xe_295x295.png" alt="logo-xe"  />
                    XE
                </a>
            </div>
        </div>
    </span>
</div>

Notice the <div class="product-container">, that prevents /components/com_virtuemart/assets/js/dynupdate.js to work properly arround line 42 Virtuemart.container.html(el.html());, at this point jQuery found more than one el as stated on line 39 var el = $(data).find(Virtuemart.containerSelector);

I fixed it by renaming <div class="product-container"> to  <div class="related-product-container"> in my /html/com_virtuemart/sublayouts/related.php override
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

johnkont

  • Beginner
  • *
  • Posts: 11
  • A beginner
//
Notice the <div class="product-container">, that prevents /components/com_virtuemart/assets/js/dynupdate.js to work properly arround line 42 Virtuemart.container.html(el.html());, at this point jQuery found more than one el as stated on line 39 var el = $(data).find(Virtuemart.containerSelector);

I fixed it by renaming <div class="product-container"> to  <div class="related-product-container"> in my /html/com_virtuemart/sublayouts/related.php override
//

This is the solution to my problem with multi variant custom field i have the last 2 months.
Thank you very much!!!!!!!!

razor7

  • Jr. Member
  • **
  • Posts: 298
    • MGSCreativa - Professional VM!
You're welcome!
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store