Add supplier_reference_to_display to ProductLazyArray#40450
Open
drhide16 wants to merge 3 commits into
Open
Conversation
|
Hello @drhide16! This is your first pull request on PrestaShop repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
PululuK
reviewed
Jan 5, 2026
Comment on lines
+470
to
+474
| $supplierRef = Db::getInstance()->getValue( | ||
| 'SELECT supplier_reference | ||
| FROM ' . _DB_PREFIX_ . 'product_attribute | ||
| WHERE id_product_attribute = ' . $idProductAttribute | ||
| ); |
Member
There was a problem hiding this comment.
Hi @drhide16 , thanks !
This is not the best place to put this query, can you please move to Product object model and use ProductPresenter ?
Hlavtox
requested changes
Jan 5, 2026
Contributor
Hlavtox
left a comment
There was a problem hiding this comment.
Please, use same logic as in getReferenceToDisplay, so we load the combination data only once. :-)
Expose supplier reference for products and combinations in front-office templates with dynamic update support when changing combinations. Changes: - Add supplier_reference to getAttributesParams() SELECT query - Add supplier_reference to getAttributesInformationsByProduct() SELECT query - Add getSupplierReferenceToDisplay() method with LazyArrayAttribute - Add supplier_reference_to_display to embedded attributes whitelist
ed67d45 to
25f5761
Compare
Hlavtox
reviewed
Jan 6, 2026
Co-authored-by: Daniel Hlaváček <daniel.hlavacek@hotmail.cz>
Hlavtox
previously approved these changes
Jan 6, 2026
Contributor
|
I re-run test failed but it's ok for me. |
Touxten
previously approved these changes
Jan 9, 2026
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change exposes the supplier reference for products and combinations in the same way reference_to_display works. The value is automatically updated when changing combinations via JavaScript.
supplier_reference_to_displayproperty toProductLazyArrayto expose supplier reference for products and combinations in front-office templates, with dynamic update support when changing combinations (same behavior asreference_to_display).2. Add combinations with different supplier references
3. In theme template
product-details.tpl, add:{if $product.supplier_reference_to_display}<span>{$product.supplier_reference_to_display}</span>{/if}4. Visit product page and change combinations - verify supplier reference updates dynamically