Artifi.PreviewPopUp(integrationValues)
PreviewPopup method is used to open preview of saved product (Product which is customized or added to cart) in a popup. Here, end-user can not modify the design.
This method can be used when user customizes a product and add that product to the cart, and may want to see the final design of the product.
You have to provide the link to the user to view preview of the product and call "PreviewPopup" method on click event of the link. When user will click on the link, it will open preview of the product in a popup.
Request Information
Parameters
Name | Description |
integrationValues | integrationValues should be the object and should contain the Artifi data, which will include the following values. This values are not case sensitive.
productCode: The product whose preview is to be shown, will have a code or master sku. You have to provide that code or master sku in this parameter. Whenever you will call this method, user can see the preview of customized product. This parameter represents the code of the product of which preview is to be shown.
websiteId: This is the website with which product whose code specified in "productcode" parameter, is associated. Admin user of Artifi can create one or more websites and can assign products to each of the website. The Id of the website with which specified product is associated should be specified in this parameter.
userId: This will be the Id of your e-commerce website's user. The user can be registered user or guest. If the user is registered with e-commerce website, pass the user id in this parameter and if the user is not registered with your ecommerce website, create a temporary id for the user and pass that temporary id in this parameter. The non registered user will be called as guest user. This will be the unique user id.
isGuest [Optional]: User of your e-commerce website can be guest or registered user and this parameter is to determine whether the user is guest or registered. If the user is not registered with your website, create temporary id for the user and pass that user id to "userid" parameter and that time "isGuest" parameter will be "true". If the value is not specified, it will consider its value as "false" and treat the user as registered user.
Width [Optional]: Width of popup window in which preview of the customized product is to be shown.
Height [Optional]: Height of popup window in which preview of the customized product is to be shown.
designId : Design id will be Id of the customized product. The product which is customized/designed using Artifi (Product customization tool) and saved or added to cart is called as customized product. When this customized product's id is specified, it will open the preview of particular customized product. This means, when you will call this method, you will get to see preview if customized product whose id is specified in this parameter.
sku [Optional]: A product may have different variants, for example, different color or sizes. "sku" represents the code/sku of specific variant of the product. If this parameter is specified, then whenever the method will be called, user can see preview of that product variant. And if sku is not specified, Artifi will open the preview of product whose code or master sku specified in parameter "productcode", i.e., priority will be given to "sku".
webApiclientKey : When any company gets registered with Artifi, Artifi will generate a special and unique key for that company which will be called as client key. This client key will be found in registered company's profile tab in Artifi Account. This client key will be used for client(company) authentication and will be called as WebApiClientKey.
|
On Failure
On failure, this method will return the following response based on parameters.
If the productCode is passed as null or not provided, then it will give message.
"Product code should not be empty or null."
If the websiteId is passed as 0 or not provided, then it will give message.
"Website Id should not be empty or null."
If the userId is passed as 0 or not provided, then it will give message.
"User Id should not be empty or null."
If the sku is passed as null or not provided, then it will give message.
"SKU should not be empty or null."
If the webApiclientKey is passed as null or not provided, then it will give message.
"Invalid webApiclientKey."
If the userId does not exist, then it will give the message.
"Invalid UserId."
If the customizedProductId is present but not belong to the given user id, then it will give the message.
"Customized Product Id / Design Id does not belong to this user."
If the productCode is present but not belong to given website id, then it will give the message.
"Product is not assigned to website."
If the customizedProductId does not exist, then it will give the message.
"Invalid customizedProductId / DesignId."
If the websiteId does not exist, then it will give the message.
"Invalid website Id."