A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

K Khan
May 3, 2013
  4403
(1 votes)

Programing changes required while Upgrading Episerver Commerce R2 to R2 SP1 and R2SP2 - Part 2

I will be thankful if you can add your experiences also in comments so others developers will have an idea of all issues in one basket. It will help you to estimate time required for upgrading also depending on your projects.

7: error related to loading EPiServer.Factory dll
Disable the processPaymentActivity in POSaveChangesWorkflow if you  have the error related to loading EPiServer.Factory dll.

8: WOrkflow changes required if using some custom workflows
Add the SplitShipment activity to CartPrepareWorfklow. Remove any payments / shipment before calling CartPrepareWorkflow.

9: Backward compatability issue.
In Commerce R2SP1, the CalculateTotalActivity calculates the ExtendedPrice following PlacePrice.
item.ExtendedPrice = item.PlacedPrice * item.Quantity - item.LineItemDiscountAmount - item.OrderLevelDiscountAmount;
subTotal += item.PlacedPrice * item.Quantity - item.LineItemDiscountAmount;

It proved a nightmare for me as all taxes and discounts were wrong and it took long to understand this. In 1.0 SP1, the ExtendedPrice assessed by ListPrice.
item.ExtendedPrice = item.ListPrice * item.Quantity - item.LineItemDiscountAmount -item.OrderLevelDiscountAmount;
subTotal += item.ListPrice * item.Quantity - item.LineItemDiscountAmount;

if using custom cartprepare workflows then change the code in Custom CarePrepareWorkflow back to ListPrice to show the correct price. Check Front Site which field you are using using also.

10: R2SP2 setup always fails if there is some failure first time.
Issue: If the SP2 automated update fails then the Tools.zip file is removed during the rollback routine. Once this file has been removed any future attempts to run the update will fail due to this file being missing. Therefore before continuing make a backup of this file.

Fix: For R2SP2 Backup ‘<website root>\MediachaseECF\Tools.zip’

11: Commerce Manager Issue:
Issue: On Migrating to R2SP2 I got an issue in Commerce Manager. It was not loading Meta classes and was giving exception as below
[IndexOutOfRangeException: ParameterIndex]   System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +6277902   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +249   System.Data.SqlClient.SqlDataReader.get_Item(String name) +23   Mediachase.MetaDataPlus.Configurator.MetaField.GetList(MetaClass metaClass) +404   Mediachase.Commerce.Manager.Core.MetaData.Admin.MetaClassesControl.BindItemsGrid(Int32 id) +646

Fix: Deploy Some SPs manually on DB. Find Unzip Mediachase.ECF.SDK.5.2.zip under C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce 1.1.2.62\MediachaseECF and Unzip it at location e.g. E:\InstallSP2\Mediachase.ECF.SDK.5.2 and execute below scripts
C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce 1.1.2.62\Setup\cms_db_upgrade.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_ApplicationSystem_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_BusinessFoundation_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_CatalogSystem_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_MarketingSystem_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_MetaDataSystem_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_OrderSystem_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_Reporting_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_SecuritySystem_update.sql
E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_Users_upgrade.sql
C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce 1.1.2.62\Setup\ecf_products_ProductsQuery.sql

May 03, 2013

Comments

K Khan
K Khan May 3, 2013 10:20 AM

Part 1:
http://world.episerver.com/en/Blogs/K-Khan-/Dates/2013/5/Programing-changes-required-while-Upgrading-Episerver-Commerce-R2-to-R2SP1-and-R2SP2---Part-1/

Please login to comment.
Latest blogs
Looking back at Optimizely in 2025

Explore Optimizely's architectural shift in 2025, which removed coordination cost through a unified execution loop. Learn how agentic Opal AI and...

Andy Blyth | Dec 17, 2025 |

Cleaning Up Content Graph Webhooks in PaaS CMS: Scheduled Job

The Problem Bit of a niche issue, but we are building a headless solution where the presentation layer is hosted on Netlify, when in a regular...

Minesh Shah (Netcel) | Dec 17, 2025

A day in the life of an Optimizely OMVP - OptiGraphExtensions v2.0: Enhanced Search Control with Language Support and Synonym Slots

Supercharge your Optimizely Graph search experience with powerful new features for multilingual sites and fine-grained search tuning. As search...

Graham Carr | Dec 16, 2025

A day in the life of an Optimizely OMVP - Optimizely Opal: Specialized Agents, Workflows, and Tools Explained

The AI landscape in digital experience platforms has shifted dramatically. At Opticon 2025, Optimizely unveiled the next evolution of Optimizely Op...

Graham Carr | Dec 16, 2025