Benny's Shopware Notebook
  • Introduction
    • How to Get in Touch
  • ddev for Shopware
    • Less than 5 Minutes Install with ddev and Symfony Flex
    • Storefront and Admin Watchers with ddev
    • Message Queue Setup with ddev
    • Contribute with ddev
    • Performance Tweaks
    • RabbitMQ with ddev
    • phpstan pro with ddev
    • Fetch Media from Production or Staging Server
  • Hosting
    • Setting up a Cloud Server with ddev
    • How to Trouble-shoot and Evaluate Environment Variables
    • Media URLs Out Of Sync between Servers
    • RabbitMQ
    • Running Shopware CE with PaaS
    • SFTP-Users
    • Basic-Auth for Shopware 6 with nginx
    • How to Avoid Failed Systemd Units
    • JWT-Secrets as Environment Variables
  • Deployment
    • Close-to-Zero Downtime Deployment
    • Docker-Images for Deployment with Gitlab-Runners
    • PHP Cache Related Issues
  • Development
    • Patching the Core
    • How to Discover Available Updates?
    • Local Testing of Shopware Commercial Features
  • Administration
  • Database
  • Migration
    • Side Effects
Powered by GitBook
On this page

Was this helpful?

  1. Migration

Side Effects

This page describes unexpected side effects resulting from "un-conventional" source data.

After having run a Shopware migration (say from Shopware 5 to Shopware 6), sometimes "funny" thinsgs happen. Products are not visible in the storefront, or they are displayed but can't purchased. Things like this - I call them "side effects".

max_purchase = 0 in Shopware 5

max_purchase = 0 is a valid setting in Shopware 5 for articles and simply means that a customer can purchase a number of items of a product limited only by available stock.

However, after migration, max_purchase = 0 in Shopware 6 means that a customer cannot purchase even a single item of this product.

As a result, you will see ProductOutOfStockError errors ("The product <name> is no longer available") in your logs when trying to a add the product to the cart. In the storefront on the product detail page you will note that the product cannot be added to the cart at all (the 'Add-to-basket' button is hidden).

To solve this problem with a quick fix, run this SQL after migration (as always, backup your DB before):

UPDATE product SET max_purchase = NULL WHERE max_purchase = 0;
PreviousMigration

Last updated 11 months ago

Was this helpful?