Shopware 6.7.10 Update: Troubleshooting Faulty Logos in PDF Documents
Shopware 6.7.10 Update: Troubleshooting Faulty Logos in PDF Documents
Updating an e-commerce platform like Shopware can sometimes introduce unexpected visual glitches, particularly in critical areas like generated PDF documents. This community discussion addresses a common issue encountered by users after upgrading to Shopware 6.7.10: logos in PDF documents (such as invoices) appearing misaligned and cropped.
The Problem: Misaligned and Cropped Logos Post-Update
After upgrading from Shopware 6.7.9.1 to 6.7.10, user "hallo3" reported that their company logo in PDF documents was no longer displayed correctly. The logo appeared shifted to the right and was significantly cut off, often resembling a square crop of the original rectangular image. This problem emerged immediately after the update, pointing to changes introduced in Shopware 6.7.10.
Initial Diagnosis and Core Changes
Initially, "hallo3" speculated the issue might be due to "breaking changes" in dompdf 3.x's CSS handling. However, "alexander.wolf" clarified that dompdf 3.x was already present in Shopware 6.7.9.1, effectively ruling out a direct dompdf version upgrade as the cause. Instead, "alexander.wolf" hinted at previous changes in Shopware's core logo class, suggesting the issue was related to Shopware's internal handling of document logos.
The Root Cause: Document Template CSS Overhaul
The most precise diagnosis came from "Andreas_147", who pinpointed specific modifications in the standard CSS of Shopware's document templates as the likely culprit. According to "Andreas_147", two key changes were introduced:
- Positioning Shift: The logo container (
.logo-container) was changed to align right (float: right) instead of the previous left alignment. - Cropping Behavior: To fit the logo into a new, predefined grid, fixed square dimensions were assigned to the logo image, coupled with the CSS property
object-fit: cover;. This property scales a rectangular image to fill a square container, cropping any parts that extend beyond its boundaries.
Proposed CSS Solution for Restoration
"Andreas_147" provided a comprehensive CSS snippet to override these new default styles and restore the logo's original alignment and proportions. This custom CSS should be added to your document's stylesheet (e.g., via a custom plugin or theme):
/* 1. Das Logo wieder nach links setzen */
.logo-container {
float: left !important;
text-align: left !important;
}
/* 2. Das Abschneiden verhindern und die originale Proportion nutzen */
.logo-container img,
img.logo {
width: auto !important; /* Hebt die feste Breite auf */
max-width: 280px !important; /* Hier deine gewünschte maximale Breite eintragen */
height: auto !important; /* Hebt die feste Höhe auf */
max-height: 80px !important; /* Hier deine gewünschte maximale Höhe eintragen */
object-fit: contain !important; /* Verhindert das harte Abschneiden (Alternative zu cover) */
}
This CSS aims to reset the logo container to float left, align text left, override fixed width/height to maintain aspect ratio, set max-width and max-height for responsive sizing, and change object-fit to contain to prevent cropping.
Challenges and Further Considerations
Despite the detailed explanation, "hallo3" reported difficulties in making the provided CSS work, noting they couldn't find a .logo-container class in their templates. This suggests that individual shop configurations, custom themes, or third-party plugins might introduce variations in template structure or conflicting styles, making a universal fix challenging. The discussion concludes without a publicly confirmed resolution for "hallo3", but the insights into the underlying CSS changes remain highly valuable for anyone troubleshooting similar logo issues after a Shopware 6.7.10 update.
Key takeaway: If you encounter similar logo issues in Shopware 6.7.10 documents, thoroughly inspect your document template's HTML and CSS. Look for changes related to float, position, width, height, and object-fit properties applied to your logo or its container. Custom CSS overrides, as suggested, are often the path to resolution, but may require careful adaptation to your specific template structure.