Portal Engine
Version 3.x > Portal Engine > E-Comm product images View modes: 
User avatar
Member
Member
gavin.bates - 1/5/2009 10:45:44 AM
   
E-Comm product images
Afternoon!

Is it possible to set up the e-commerce (Kentico v3.1) so that when creating a product and selecting its image, browse searches files on the CMS itself rather than the user's computer? like how an image is inserted into a text region (browse server)

I cannot find the field within the standard document type.

Thanks

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 1/6/2009 2:50:07 PM
   
RE:E-Comm product images
Hi Gavin,

you will need to force usage of image selector instead of image uploader.
This can be done by forcing the condition

if (CMS.CMSEcommerce.SKUInfoProvider.UseMetaFileForProductImage)

to be false, e.g. replacing the condition text with "false" (therefore use the selector instead of uploader) at line #296 in <webApp>\CMSDesk\Tools\Ecommerce\Products\NewProduct.aspx.cs. This will force the image selector to be used even for the product editing form.

Moreover, cleaner solution could be probably done by setting the appropriate key value (UseMetaFileForProductImage) in web.config file, but I'm not sure. I'll try to find out.

Regards,
Zdenek Cetkovsky, Kentico.

User avatar
Member
Member
gavin.bates - 1/7/2009 4:01:10 AM
   
RE:E-Comm product images
Thanks Zdenek

C# is not one of my strongest languages so still having some issues,

I have modified the code how I understand it...

if (CMS.CMSEcommerce.SKUInfoProvider.UseMetaFileForProductImage)
{
// Display meta file uploader
plcMetaFile.Visible = true;
ucMetaFile.ObjectID = mProductId;
ucMetaFile.ObjectType = ECommerceObjectType.SKU;
ucMetaFile.Category = MetaFileInfoProvider.OBJECT_CATEGORY_IMAGE;
ucMetaFile.InitUploader();
}
else
{
// Display image selector
plcImagePath.Visible = true;
}

...trying different combinations of setting true to false in the above code, but the most that was achieved is removing the image browse section completly when generating/editing a product.

Do I need to take the browse function from somewhere where it works as required and try replacing it within the aspx.cs file for it to browse the sites files rather than a person's own computer?

Sorry if i have mis-understood something.

Thanks

Gavin

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 1/7/2009 12:46:31 PM
   
RE:E-Comm product images
Hi Gavin,

yes, I meant to change the condition to force execution of the "else" branch. Changing the .Visible value assignments is't the solution...

However, I've finally found the proper a correct way to enable product image selector:

Please use the appropriate key settings for CMSUseMetaFileForProductImage in web.config, like mentioned in:
http://devnet.kentico.com/docs/ecommerceguide/web_config_settings.htm

That means, you need to add following line into the <appSettings> section in your web.config file:

<add key="CMSUseMetaFileForProductImage" value="false" />


Please note that the changed code in the NewProduct.aspx.cs should be reverted to the original state to work properly.

Kind regards,
Zdenek Cetkovsky

User avatar
Member
Member
gavin.bates - 1/8/2009 3:15:42 AM
   
RE:E-Comm product images
That was easy enough! works a treat.

Thanks Zdenek