Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preselecting variant article by ID on clientside #198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

heural
Copy link
Contributor

@heural heural commented Nov 25, 2022

No description provided.

@@ -158,10 +158,14 @@ AimeosCatalogDetail = {
*/
selectVariant() {
const product = $('article.product');

const urlProductId = window.location.pathname.split('/').pop();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this wont't work in all environments as the variable may not be part of the path or has a prefix.
To solve that problem, we could move the PHP code to the modify() method which can then update a section in the cached HTML:
https://aimeos.org/docs/latest/frontend/html/create-subparts/#modify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants