Support non-USD currencies in the "Change price in cart" action
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3501302. --> Reported by: [starlight-sparkle](https://www.drupal.org/user/3804225) Related to !17 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The "Change price in cart" action hard-codes USD as the price. This means it cannot be used when the shop is not based on USD.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Create a shop with any non-USD currency e.g. SGD</li> <li>Create a product with two variations in the shop, both with non-USD price</li> <li>Create an ECA rule: add to cart event, conditionally check if the product variation matches the first variation, change price action</li> <li>Add both product variations to cart and navigate to cart page</li> <li>Observe WSOD resulting from trying to calculate total of USD and non-USD prices</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Use the recently added <code>CurrencyActionTrait</code> from <a href="https://www.drupal.org/project/eca_commerce/issues/3426536">#3426536: Action for adding an adjustment to order </a> to add support for other currencies to the action.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p>New select options will be added to the "Change price in cart" action to allow selection of currency or token.</p> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <p>New field to store the currency configured for the action.</p> > Related issue: [Issue #3374485](https://www.drupal.org/node/3374485) > Related issue: [Issue #3426536](https://www.drupal.org/node/3426536)
issue