[BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class

Started by razor7, May 16, 2017, 16:55:54 PM

Previous topic - Next topic

razor7

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

GJC Web Design

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

razor7

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

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:

<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

//
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

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

Milbo

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

razor7

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

After testing in a new site with protostar template i see it is NOT FIXED.

Joomla 3.7.4
VM 3.2.3.9587

The only workout is the solution i stated before.
https://www.prototype.com.gr/el/products-gr/components/ram/190-30-kg1333-8g-detail