Three files need to be edited.
1. AdminDir/themes/new-theme/public/order_create.bundle.js
unminify this JavaScript here: https://unminify.com/
find:
key: "renderFoundProducts",
change to:
key: "renderFoundProducts", value: function (e) { (0, o.default)(e).forEach(function (e) { var t = e.name; var tr = e.reference; 0 === e.combinations.length && (t += " - " + e.formattedPrice), c(a.default.productSelect).append('<option value="' + e.productId + '">' + tr+ ': '+t + "</option>"); }); },
2. src/Core/Domain/Product/QueryResult/FoundProduct.php
add reference variable:
change __construct to:
public function __construct( int $productId, string $reference, string $name, string $formattedPrice, float $priceTaxIncl, float $priceTaxExcl, float $taxRate, int $stock, string $location, bool $availableOutOfStock, array $combinations = [], array $customizationFields = [] ) { $this->productId = $productId; $this->reference = $reference; $this->name = $name; $this->formattedPrice = $formattedPrice; $this->priceTaxIncl = $priceTaxIncl; $this->priceTaxExcl = $priceTaxExcl; $this->taxRate = $taxRate; $this->stock = $stock; $this->location = $location; $this->availableOutOfStock = $availableOutOfStock; $this->combinations = $combinations; $this->customizationFields = $customizationFields; }
add new function after getProductId():
/** * @return string */ public function getReference(): string { return $this->reference; }
3. src/Adapter/Product/QueryHandler/SearchProductsHandler.php
add reference to FoundProduct:
4. Come back here and give me a Like by clicking the gray heart below my posts 😄