aimeos / ai-client-html

Aimeos e-commerce HTML client components
https://aimeos.org
GNU Lesser General Public License v3.0
154 stars 58 forks source link

Improved preselecting variant article by ID for selection products #197

Closed heural closed 1 year ago

heural commented 1 year ago

Without productId in "prefixes", the aimeos cache had the same page cache for diffrent productId´s. So the productId has to be involved into the cachr generation.

aimeos commented 1 year ago

Your original PR has been improved and the parameter name renamed to d_articleid: https://github.com/aimeos/ai-client-html/commit/5ce36db5ba5b9b7e03106ae0ad9e1aa24b3f5b80

heural commented 1 year ago

Your original PR has been improved and the parameter name renamed to d_articleid: 5ce36db

Ok, but in https://github.com/aimeos/ai-client-html/blob/87b852c3ada3dded7f872f32a85f9e7ce9f97423/src/Client/Html/Catalog/Detail/Standard.php#L73 there should be d_articleid added, otherwise the cache does not add the variant sites, only the "first" requested is in cache.

aimeos commented 1 year ago

Is it possible to add all variants in the HTML node data- attribute and let the JS code select the right one depending on the attribute so it's JS-only and cache friendly? Otherwise, there might be 2-100 times more cache entries for each selection product depending on the number of articles of the selection product.