VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: razor7 on May 16, 2017, 16:55:54 PM

Title: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class
Post by: razor7 on May 16, 2017, 16:55:54 PM
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!
Title: Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
Post by: jenkinhill 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.
Title: Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
Post by: GJC Web Design 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
Title: Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
Post by: razor7 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!


Title: Re: Detailed guide to migrate VM templates from 3.0.18.x to to 3.2.2
Post by: razor7 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:

<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
Title: Re: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class
Post by: johnkont on July 20, 2017, 15:20:27 PM
//
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!!!!!!!!
Title: Re: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class
Post by: razor7 on July 22, 2017, 02:28:14 AM
You're welcome!
Title: Re: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class
Post by: Milbo on July 25, 2017, 20:41:23 PM
This is already fixed in the most recent version uploaded on dev.virtuemart.net (vm3.2.3.xyz)
Title: Re: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class
Post by: razor7 on July 25, 2017, 20:48:16 PM
Great! Many many thanks!
Title: Re: [BUG] VM 3.2.2 related.php sublayout adds "product-container" as container class
Post by: johnkont on July 27, 2017, 12:15:52 PM
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 (https://www.prototype.com.gr/el/products-gr/components/ram/190-30-kg1333-8g-detail)