Hybris初始搭建完成,请教Apparel Store定制及URL修改方法
Hey there! Let’s walk through customizing your Apparel Store in Hybris step by step—super manageable once you know the right tools and spots to use.
You’ve got two solid options here: manual deletion (great for small datasets) or batch removal with ImpEx (way faster for large catalogs).
Manual Removal via Backoffice
- Log into your Hybris Backoffice and navigate to the Product Perspective (or Product Cockpit if you’re on an older version).
- Leave the search bar empty and hit search—this pulls up every product in the catalog.
- Check the top checkbox to select all products, then click the Remove button in the toolbar. Confirm the deletion when prompted.
Batch Removal with ImpEx (Recommended)
- Write a simple ImpEx script to wipe all products at once:
REMOVE Product;code[unique=true] ;* - Go to the ImpEx Import section in Backoffice, paste this script, and run the import. This will delete every product in one go—no clicking required.
Let’s start with categories first (since products need to be linked to them), then move on to adding products.
2.1 Create Custom Product Categories
- Head to the Classification Perspective in Backoffice (or Category Cockpit).
- Click New and select Category.
- Fill in the key details:
Code: A unique identifier (e.g.,custom-outdoor-gear—this is used for linking products later).Name: Add multi-language names if needed (e.g., English: "Custom Outdoor Gear", Chinese: "自定义户外装备").- Parent Category: Choose where this category lives (usually under the Root Category unless you’re building a nested structure).
- Save the category, and repeat this for all your required category levels.
2.2 Add Your Own Products
Again, two options: manual for single products, ImpEx for bulk imports.
Manual Product Creation
- In the Product Perspective, click New and select Product (or a custom product type if you’ve extended the base Product).
- Fill in essential fields:
Code: Unique product SKU (e.g.,OUTDOOR001).Name: Multi-language product names.Category: Link to the custom category you created earlier.Price: Add pricing details in the Price tab (set currency and value for each market you support).- Extra fields: Fill in
Description, upload product images, or add attributes as needed.
- Save the product when done.
Bulk Product Import with ImpEx
- Write an ImpEx script to import multiple products at once. Example:
INSERT_UPDATE Product;code[unique=true];name[lang=en];name[lang=zh];category(code);price(Currency,value)[default=USD,unique=true] ;OUTDOOR001;Waterproof Hiking Boots;防水登山靴;custom-outdoor-gear;149.99 ;OUTDOOR002;Lightweight Camping Tent;轻量化露营帐篷;custom-outdoor-gear;299.99INSERT_UPDATEmeans it will update products if they exist, or create them if not.category(code)links each product to your custom category using its unique code.
- Run this script in the ImpEx Import section to bulk-add all your products.
You can do this either via Backoffice for quick changes, or via config files for persistent, environment-specific settings.
Option 1: Backoffice Configuration
- Go to the Website Perspective in Backoffice.
- Find the
apparelstoresite and open its details page. - Navigate to the URL Patterns tab, then modify the
URL Patternfield. For example, change/apparelstoreto/custom-outdoor-store. - Save the changes, then restart your Hybris server to apply the new URL.
Option 2: Configuration File Modification (Persistent)
- Open your Hybris
local.propertiesfile (located inhybris/config/). - Add or update these lines with your custom URL:
website.apparelstore.http=http://localhost:9001/custom-outdoor-store website.apparelstore.https=https://localhost:9002/custom-outdoor-store - Save the file, then restart your Hybris server.
- Optional: Double-check your storefront’s spring configuration files (in
commercewebservices/web/webroot/WEB-INF/config/spring/custom/) to ensure the URL mappings align with your new custom URL.
Quick Note
Always back up your Hybris database and config files before making these changes—better safe than sorry if something goes wrong!
内容的提问来源于stack exchange,提问作者CHOLA

