Closed sebfie closed 1 year ago
I also got the warning :
Alpine Expression Error: Unexpected token ':'
Expression: "https://noir-et-blanc.test/media/catalog/product/cache/6db3a2e61d6c3f8d79721fd61c656d51/p/r/pro-ject_t1.webp"
If you upgraded to the latest version of this NextGenImages module, did you make a 100% sure that you also removed the old non-supported version of the compatibility module? And did you also make sure to upgrade the WebP2 module? Unfortunately, I'm unable to reproduce the problem.
The error you get seems to be a JS error. In the browsers I personally work with, the browser (Chrome, Firefox, Edge) also reports more details like line number. What is the HTML causing this error? An error is just an error. Only with more details we can add more conclusions. By the way, in AlpineJS, using a :
(colon) is supported - hence, you have only provided an error that is making zero sense.
Yes, I removed the compatible module.
So In you case : view/frontend/templates/hyva/picture.phtml
is used ? and not view/frontend/templates/picture.phtml
? Where is the logical to switch to hyva/picture.phtml
?
If you set for example :
:srcset="http://via.placeholder.com/640x360"
I got the warning on the <img>
or <source>
tag
You will have I guess the warning.
I'm not still not getting what you are trying to do. Indeed, there is a file view/frontend/templates/hyva/picture.phtml
and it is not being used. The reason that it is not being used is that it is not supposed to being used. The file view/frontend/templates/picture.phtml
is working in my Hyva instances just fine. If you started to hack things, could you please first undo those hacks? The documentation of the current Yireo WebP2 / NextGenImages modules mention compatibility with Hyva but don't mention copying files - so the errors you are getting are not due to the modules, but due to your copying action.
Is view/frontend/templates/picture.phtml
really working for you? Even on category page and swatch pictures switch?
With this template, the main image is not switching when clicking swatch images.
Using view/frontend/templates/hyva/picture.phtml
made it work !
I feel like I need to be defending myself, but yes, I have tested for this and in my case swatch images are working perfectly fine. I have never encountered the errors you posted. The current version of Yireo_NextGenImages is 0.5.0 and the current version of Yireo_Webp2 is 0.13.3.
Naturally, there is the possibility of me having coded something that does not work in your shop, or you having coded something in your shop that doesn't work with my modules. But my voluntary task for creating these modules and supporting them, can only go so far.
Sorry, maybe my english is not as good as my mind :p ! But I do not accuse you, i am just trying to understand what is not working for me.
I am 100% sure the issue come from me and I am searching why !
I am using Yireo_NextGenImages
on 0.5.0
and Yireo_Webp2 on 0.13.3
I will try on a blank magento 2 with hyva to find the issue and will report it here, maybe it will help someone else !
No problem. Let me know if you find anything.
Hi again,
I installed your module on my empty magento 2 with hyva :
"yireo/magento2-next-gen-images": "^0.5.0",
"yireo/magento2-webp2": "^0.13.3"
And Image switching from Image Swatch is not working :
https://share.cleanshot.com/9Hp9hXHq
If I replace vendor/yireo/magento2-next-gen-images/view/frontend/templates/picture.phtml
with the content of vendor/yireo/magento2-next-gen-images/view/frontend/templates/hyva/picture.phtml
it's working :
https://share.cleanshot.com/xXmfDwtW
The main difference is this :
$srcsetAttribute = $block->getIsDataSrc() ? ':data-srcset' : ':srcset';
Alpinejs : 3.12.3
Hyva theme : 1.3.2
Are you able to reproduce this ?
Could you please close this issue? Because the question on a JS error was never being addressed and/or reproduced? And the question on copying templates was already closed as well.
Could you then create a new ticket with a title "Color swatches are not working for me"? I don't want people to be confused with the name of this ticket which has nothing to do with the current state of the ticket.
If color swatches are not working, and perhaps I would be able to reproduce it, then still somebody with knowledge needs to invest time to add a fix. Unfortunately, I don't earn anything with these extensions and I suspect that you are getting paid for building the entire project. Let's see who is able to move quicker.
Yes sure, I will make a PR ! Thank you
Hello,
I installed your last module version and it does not use the template
view/frontend/templates/hyva/picture.phtml
. Do we have to configure something? I did not find any documentation about that.As temp fix, I created
view/frontend/templates/picture.phtml
in my theme.