Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!
You are here: The ProductCart Encyclopedia » Apparel Add-on » Remove Orphaned Sub-Products and Fix Other Database Issues
Remove Orphaned Sub-Products and Fix Other Database Issues
Overview
You can use the following script to fix database issues related to Apparel products. These issues are often the result of using the Product Import Wizard (some fields might have been setup incorrectly). They could also be due to flaws in the software that have not yet been found. The script performs 3 tasks, but can be safely executed even if you aren't certain that your database needs to be “fixed”:
- FIRST Task: Fix storefront errors due to option groups order not set
The script updates option groups order at the parent product level. Option groups must be ordered, otherwise there is a problem in the storefront. - SECOND Task: Remove incorrectly setup sub-products from the Control Panel (orphaned sub-products)
It loads all the products that are setup as Parent Products and then removes from the Control Panel sub-products whose parent is not in that list. Those records remain in the database, but with the removed field turn on (set to -1). - THIRD task: Hide sub-products from the storefront
If the active field is set to YES (-1), then some queries could mistake sub-products as stand-alone products in the storefront. Instead, sub-products should only be displayed within a Parent Product page. So the script sets the active field to 0 for sub-products.
Executing the script
- Requirement: ProductCart v3.x and above, with Apparel Add-on
- Download: Download the script
- Unzip the script and upload it to your Control Panel folder
- Load the page in the browser address field
- You must be the store administrator to load this script
Trace: • Saved Shopping Carts • Technical Notes • Display Twitter Updates on your ProductCart Storefront • Page Not Found Template for ProductCart • Adding "Welcome <Customer Name>!" message to your store's design • How to hide prices for Not For Sale products • How to Delete Multiple (Inactive) Products • ProductCart v4 Upgrade Instructions • Custom Input Fields • Remove Orphaned Sub-Products and Fix Other Database Issues