OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
869 stars 436 forks source link

Ultimo (1.19.1) partially working but "Zoom" extension stopped working after upgrading to PHP 8.2 #3059

Closed LuizSantos22 closed 1 year ago

LuizSantos22 commented 1 year ago

Summary (*)

 Install OpenMage 19.5.0-rc1 
+ legacy Library/extensions package (zip file provided along with OM)
+ Ultimo (1.19.1 - latest version for M1) - One of the most used Magento theme 
+ PHP8.2 (deactivate pdo_mysql and activate nd_pdo_mysql extension)

Examples (*)

After installing PHP 8.2 we need to deactivate "pdo_mysql" and activate "nd_pdo_mysql" extension to make Ultimo theme work. After that, almost everything works, except (so far in my tests) the "Zoom" extension that deals with product images at product page, it stays blank.

Proposed solution

The temporary "workaround" is deactivating "Zoom" extension at system/config/Zoom it will make the product image show up again at frontend but the issue is that every time you click in another image, it will pop up new window to show the image, just like the old default theme

My idea with this report is having a more elegant solution for this issue. Most of the errors with this theme were fixed by the trick mentioned above, by changing the extension for PHP 8.2. But it would be nice if someone could fix this little issue with "Zoom" extension to make this perfect. And yes, I tried to leave only "lightbox" enabled, it doesn't work.

kiatng commented 1 year ago

Are there any error messages? This can provide clue to whether the error is caused by OM or Ultimo. If it is OM, we should be able to fix it. If it is Ultimo, you can notify them of the issue.

LuizSantos22 commented 1 year ago

@kiatng Sadly the company behind Ultimo does not exist anymore. They just stopped providing support and it was taken down from Themeforest, which is a pitty as in my opinion it is the best theme ever made for M1, a bit complex to understand but highly customizable. Setting it even in a shared cPanel hosting with Litespeed on + Cloudflare + Zaraz runnig scripts on cloud the store loads really fast! I guess the issue is these two PHP extensions: pdo_mysql and "nd_pdo_mysql" In PHP 7.4 it does not matter which one you set, it works out of th box In PHP 8.2 if pdo_mysql extension is activated, the site does not function if you change to "nd_pdo_mysql" 99% of the site works, just the Zoom extesion that deals with pictures at the product page does not work. It stays blank. If you deactivate the extension, Ultimo uses the "default" product picture extension (given by Magento default theme) and it works, but is is not elegant as eveytime you click in another picture it opens a new window.

I am still investigating I don't see any error but if you want, I can provide a test environment.

justinbeaty commented 1 year ago

@LuizSantos22 do you want to ask them if they will open source the theme?

LuizSantos22 commented 1 year ago

@justinbeaty For what I know, the company does not operate anymore. Their last twitter comment was in 2017.

LuizSantos22 commented 1 year ago

@kiatng and @justinbeaty In my investigations about PHP8.2 I see that product page image when handled by RWD theme, works fine I mean, it is not as pretty as Cloudzoom but it does the job, apart from the fact that Cloudzoom version used is outdated

So I have checked out this path app/design/frontend/ultimo/default/template/infortis/cloudzoom/product/view/media.phtml

Looking at the code I get:

    <?php else: //Module disabled. Show images in Magento default style ?>

        <p class="product-image" style="max-width: <?php echo $imgWidth; ?>px;">
            <img src="<?php echo $helpImg->getImg($_product, $imgWidth, $imgHeight); ?>" alt="<?php echo $this->escapeHtml($this->getImageLabel());?>" title="<?php echo $this->escapeHtml($this->getImageLabel());?>" itemprop="image" />
        </p>

    <?php endif; ?>

I guess this code is the fallback in case CloudZoom is disabled

How can I make it to fall back to "rwd theme" rather than "default theme"?

Regards

kiatng commented 1 year ago

@LuizSantos22 To fallback to rwd, add a file app\design\frontend\ultimo\default\etc\theme.xml with the following content:

<theme>
    <parent>rwd/default</parent>
</theme>

More info here.

But I doubt it will fix your issue.

kiatng commented 1 year ago

If you want to replace CloudZoom with rwd zoom, you need to update the layout template of app\design\frontend\ultimo\default\layout. In the dir, you need to search for and update this handle:

<catalog_product_view translate="label">

by removing the associated block (/infortis/cloudzoom) with name="product.info.media". Then couple with the fallback directive in my last comment above, it may do what you intended to do.

addison74 commented 1 year ago

For about 10 years I have been aware of Magento 1 themes. When I bought the first theme from Template Monster I noticed a lot of issues, fortunately the developers helped me to solve them, but I was disappointed by the lack of intensive testing of the products for sale. I could say that Ultimo was the best-selling of them, but with many problems. Porto would probably be maintained, but otherwise the shutters have been drawn. Theme Forest removed a lot of themes for Magento 1. It is best to start from scratch based on the RWD theme by adding a lot of features inspired by popular themes from Wordpress, Joomla, Magento 2. You can add Tailwind, Bootstrap, AlpineJS and many other libraries that are active projects on GitHub.

Regarding CloodZoom feature, I think it is a relic of the past. When the majority of visitors of a website use smartphones, the specific features related to the desktop are no longer necessary, but simplicity and visibility. I used EcommerceTeam CloudZoom extension for a while then gave up using another implementation. I recommend using or not lightGallery with main image. The rest of the images (colors, detailed) are placed in a carousel that takes the entire width of the main container. Clicking on any of them does not change the image of the product, but enlarges with lightGallery. For the mobile version, at a certain size of the viewport, these containers can be hidden and only a carousel with all the images in it is visible. You can try MagicToolbox products but I don't like extension with encrypted files.

As a golden rule, when compatibility issues arise and you can't solve them, you either replace them with something else, or completely abandon that whole framework. If OpenMage / Mage One did not continue Magento 1 in a few years, users were forced to migrate to something else due to new versions of PHP.