Defaults:
Client Name: Enter Client’s Name
Site Id: Site ID will be provided by the Social Annex
Purpose of the Document
This document contains the code snippets for displaying the Visual Commerce module on different pages of the website, for the SPA (Single Page Application) environment.
Implementation Instructions for Visual Commerce
Firstly, add the following JScript to your Index page&callit, when your site loads for the first time(on the user's system).
|
<script type="text/javascript"> ( if (window.attachEvent) { window.attachEvent('onload', sa_async_load); |
Homepage
In order to display the Visual Commerce module on the homepage, you will have to follow the steps below:
- Add the following div on the homepage, where you want to display the image slider.
| <div id="sa_s22_instagram" class=”sa_s22_instagram_home”></div> |
- Call the following function, once the Homepage loads on the user’s system. It will display the Visual Commerce Homepage slider.
| var sa_page="1"; s22LoadIndexPage(sa_page) ; |
Product Page:
In order to display the Visual Commerce module on the product page, you will have to follow the steps below:
- Add the following div on the product page, where you wish to display the image slider.
| <div id="sa_s22_instagram" class=”sa_s22_instagram_product”></div> |
- Whenever the client loads the product page OR reinitializes the values of the sa_s22_product variable, the client should call the following function to display the Visual Commerce slider on the product page.
Function:
| var sa_s22_product = "PASS_PRODUCT_CODE" ; var sa_page="2"; s22LoadProductPage(sa_page,sa_s22_product); |
Note: In the above code, replace “PASS_PRODUCT_CODE” with the product id for the specific product page (implement it in the same way which you have implemented for the current Visual Commerce version).
Product Category Page:
In order to display the Visual Commerce module on the product category page, you will have to follow the steps below:
- Add the following div on the product category page, where you want to display the image slider.
| <div id="sa_s22_instagram" class=”sa_s22_instagram_category”></div> |
- Whenever the client loads the Category page OR reinitialize the values of sa_s22_instagram_category_type and sa_s22_instagram_category_code variables, then the client should call the following function to display the Visual Commerce Category page slider.
| var sa_s22_instagram_category_type = "PASS_CATEGORY_TYPE" ; var sa_s22_instagram_category_code ="PASS_CATEGORY_CODE"; var sa_page="3"; s22LoadCategoryPage(sa_page , sa_s22_instagram_category_type , sa_s22_instagram_category_code ); |
Note:
- In the above code, replace “PASS_CATEGORY_CODE” with the category id for the specific category page (implement it in the same way, which you have implemented for the current Visual Commerce version).
- Also, replace “PASS_CATEGORY_TYPE” with the specific category type (implement it in the same way, which you have implemented for the current Visual Commerce version).
Gallery Page
In order to display the Visual Commerce module on the Gallery page, you will have to follow the steps below:
- Add the following div between the header & footer of the gallery page (which you have created).
| <div id="sa_s22_instagram_gallery"></div> |
- Whenever the client loads the Gallery page, the client should call the following function to display the Visual Commerce Gallery
| var sa_page="7"; s22LoadGalleryPage(sa_page); |
Order History Page
In order to display the Visual Commerce module (i.e., image upload button) on the Order History page, you will have to follow the steps below:
- Pass Divs (with multiple product arrays) to Annex Cloud, where the client wishes to display the Visual Commerce upload button. Same as the client is currently providing for the current Visual Commerce version, refer to the following example.
| <div id="sa_track-25234168072-1" class="sa_s22_photoupload_product_holder" data-product- code="1014567372"> </div> |
- Whenever the Order History page loads, the client should call the following function (with multiple product arrays) to display the Visual Commerce Upload image button on the Order History Page.
| var sa_page= "9"; var sa_s22_multiple_products=compare_list_array; s22LoadOrderSummaryPage(sa_page, sa_s22_multiple_products); |
Note:
- In the above code, sa_s22_multiple_products is an array with a key like a Div_id and a value a ProductCode-index number.
Refer to the following example:
E.g.: sa_s22_multiple_products = [sa_ugc_compare-1: "1013876150-1",
sa_ugc_compare-2: "1045878961-2", sa_ugc_compare-3: "3267402-3",
sa_ugc_compare-4: "1016077810-4"]
Order Details Page.
In order to display the Visual Commerce module (i.e. image upload button) on the Order Details page, you will have to follow the steps below:
- Pass Divs (with multiple product arrays) to Annex Cloud, where the client wishes to display the Visual Commerce upload button. Same as the client is currently providing for the current Visual Commerce version, refer to the following example.
| <div id="sa_track-2" class="sa_s22_photoupload_product_holder" data- product-code="1014567372">div> |
- Whenever the Order Detail page loads, the client should call the following function (with multiple product arrays) to display the Visual Commerce Upload image button on the Order Details Page.
| var sa_page= "9"; var sa_s22_multiple_products=compare_list_array; s22LoadOrderDeatilPage(sa_page, sa_s22_multiple_products); |
Note:
- sa_s22_multiple_products is an array with a key like a Div_id and value as a ProductCode-index number.
E.g., sa_s22_multiple_products = [sa_track-2: "1014567372-2", sa_track-1:"1044341237-1"]
Product Compare Page
In order to display the Visual Commerce module on the product comparison page, you will have to follow the steps below:
- Pass Divs (with multiple product arrays) to Annex Cloud, where the client wishes to display the Visual Commerce upload button. Same as the client is currently providing for the current Visual Commerce version, refer to the following example.
| <div id="sa_ugc_compare-1" class="sa_s22_comapare_page_slider s22_multiple_product_1013876150" data-count="1" data-page- type="product" data-end="1"></div> |
- Whenever the Product Compare page loads, the client should call the following function (with multiple product arrays) to display the Visual Commerce multiple image sliders on the Product Compare Page.
| var sa_page= "2"; var sa_s22_multiple_products=compare_list_array; s22LoadMultipleProductsSlider(sa_page, sa_s22_multiple_products) |
Registry Page
In order to display the Visual Commerce module on the Registry page, you will have to follow the steps below:
- Add the following div between the header & footer of the Registry page.
| <div id="sa_s22_instagram"> |
- Whenever the Registry page loads, the client should call the following function to display the Visual Commerce module on the Registry page.
| var sa_page= "1"; var sa_instagram_user_email = PASS_USER_EMAIL; Var sa_instagram_registry_id = PASS_REGISTRY_ID; Var sa_instagram_registry_type = PASS_REGISTRY_TYPE ; var sa_instagram_registry_is_owner_view = 'PASS_REGISTRY_OWNER_VIEW_VALUE'; s22LoadRegistry(sa_page , sa_instagram_user_email, sa_instagram_registry_id, sa_instagram_registry_type, sa_instagram_registry_is_owner_view) |
Note:
- In the above code, replace PASS_USER_EMAIL with the registered user’s email id.
- Also, replace PASS_REGISTRY_ID with the user’s unique registry id.
- Also, replace PASS_REGISTRY_TYPE with the type of registry.
- Also, replace PASS_REGISTRY_OWNER_VIEW_VALUE with 1 or 0; Pass‘1’ if logged in to a user watching own registry and pass ‘0’ if logged in to a user watching another registry.