user098
user098

Reputation: 23

how to configure external image server path in Hybris

We are working on to move our current e-commerce system to Hybris e-commerce.

In current system, external image server is used to feed for all product images used on product list/details pages. So I am looking for ways to configure these product images path (located for external server) in Hybris. I searched Hybris wiki but couldn't find much helpful info.

So i want to know where and how to configure external image server path so that all modules which uses product images can pick the correct path and display images accordingly. If some has done this sort of things before or has an idea, kindly help me.

Upvotes: 2

Views: 2317

Answers (2)

alain.janinm
alain.janinm

Reputation: 20065

In PCM cockpit, if you need to display product image that is on remote server you can follow these steps (i don't know if it's the best solution but at least it works) :

  1. Add an attribute "pcmUrl" in the Product definition (items.xml)
  2. Add to this attribute and attribute handler : <persistence type="dynamic" attributeHandler="pcmUrlAttribute" />
  3. Declare the bean : <bean id="pcmUrlAttribute" class="mypackage.PcmUrlAttributeHandler"/>
  4. Define the PcmUrlAttributeHandler class that will contains the logic to retrieve the URL of the image on your remote server. The class has to implements DynamicAttributeHandler<String, ProductModel>
  5. Now you have to customize the Product Cockpit. It's not so easy (my opinion) so I won't explain all steps here but basically you have to find out the view you want to customize and set:

    <imageslot> <property qualifier="Product.pcmUrl" /> </imageslot>

Upvotes: 1

Benoit Vanalderweireldt
Benoit Vanalderweireldt

Reputation: 2989

Look at example media's URL for default apparel store they are configured with :

media.apparel-de.http=http://apparel-de.local:9001

media.apparel-de.https=https://apparel-de.local:9001

Upvotes: 0

Related Questions