Gigya Job Openings

SalesForce Commerce Cloud Advanced Customization

Skip to end of metadata
Go to start of metadata

« Back to Gigya Cartridge for SalesForce Commerce Cloud

Overview

Gigya's cartridge for Salesforce Commerce Cloud offers several advanced implementation and customization options. To review the flow of data between Gigya and Demandware, see GConnector Data Flow. Note the different APIs used when implementing RaaS or Social Login: 

 

Customizing User Interface Texts

The Gigya Cartridge adds user interaction forms and user messages to your store. To change the default texts that appear on the forms and the user messages, edit the following files:
  • gigya_metadata.xml – located under \int_gigya\cartridge\templates\resources
  • gigya.properties – located under \int_gigya\metadata
     
After saving your changes, import the gigya_metadata.xml file using the Business Manager.

Gigya Debug Log

The Gigya Cartridge includes the option of logging errors to debug your site. The log stores the errors recorded by the system over the past 5 days, with a separate file for each day. 

To set the log level:

  1. Navigate to Administration > Operations > Custom Log Settings
  2. Under "Gigya", select the log level: 
  3. Save your settings. 

To review the log file: 

  1. Log into the Demandware Business Manager.
  2. Click Administration > Site Development > Development Setup. 
  3. In the WebDAV Access section, click the Log Files link.
  4. Sign in and scroll down to the files named custom-Gigya-blade2-2-appserver-.log – there are up to 5 Gigya log files:
  5. Click on one of the log files to open it.  The logs are unformatted text files, which show the errors encountered:

Account Updated Hook

The cartridge includes a ‘hook_gigya_raas_profile_update’ hook in accountUpdateHook.ds that is fired every time an account is updated, enabling you to dynamically change variable values that are passed to Drupal and/or override Gigya module functionality. To implement the hook: 

  1. Describe hook_gigya_raas_profile_update inside the hooks.json file of the core cartridge.

  2. Implement the hook script on the client side: 

    In this example, args.customer contains the current Demandware customer, and args.accountInfo contains user info received from Gigya.

How to Configure an Unsupported Data Center

Gigya offers several Data Centers worldwide to support customers in different locations. Each of your sites will be using a specific Gigya Data Center.

The current version of the Gigya Cartridge for Demandware supports the following data centers: US, Europe, Australia, China and Russia.

In case a new Data Center becomes available and you need to use it, you can configure it manually as follows:

  • In your Demandware Business Manager , go to Administration > Site Development > System Object Definitions > Site Preferences > Attribute Definitions > gigya_dataCenter.
  • Enter the Data Center's ID (for example, the ID of the US Data Center is "us1") and its display value (such as "United States") in the appropriate input fields.
  • The new Data Center is now available to be selected in the Site Preferences. In your Demandware Business Manager, go to Site > Site Preferences > Custom Preferences > Gigya > Data Center and select the new Data Center from the drop-down list.
  • Click Apply.

Now all calls to Gigya will be directed to the new Data Center.

Cartridge Components

The int_gigya cartridge consists of the following components:

Controllers

GigyaRaaS.js – controllers used with Registration-as-a-Service

  • GigyaRaaS-LoginSuccess – Called after a successful Gigya login. The workflow will create a new account, or log in the user to an existing account.
  • GigyaRaaS-ProfileUpdate - Called to update user info on Gigya and SFCC. 
  • GigyaRaaS-CallRaaSHook – Called in order to customize account info on login and registration. The hook_gigya_raas_profile_update hook should be defined inside the hooks.json file in the core cartridge. Implementation of the script is on the client side. See example in the following images:


SalesForce Commerce Cloud Scripts

General Scripts

  • gigyaServiceInit.js - This file contains necessary methods for HTTP calls. 
  • libGigyaUtils.js – This script encapsulates the Configuration Manager 'singleton'. Singleton pattern ensure that only a single instance of the class may exist in application, it limits the number of instances of a particular object to just one. Singletons are useful in situations where system-wide actions need to be coordinated from a single central place. Singletons reduce the need for global variables.
  • gigya_setDataCenterSelectionFlag.js – This file verifies the setting of the correct data center in Business Manager.
  • libInheritance.js – This script provides inheritance support and is inspired by base2 and Prototype.
  • gigya_onPurchaseEvents.js – This file implements the On Purchase Event feature that notifies Gigya whenever a purchase is made by sending the order products count and total value information. It also contains the Enable purchase notifications to Gamification feature.
  • gigya_getReactionsJSON.js – Retrieves a list of gigya_ReactionType objects and returns then in JSON format.

Registration-as-a-Service Scripts

  • gigya_getRaaSAccountInfo (function in GigyaRaaS.js)– This function retrieves user account data using the accounts.getAccountInfo method.

Static

  • css\gigya.css – Site Genesis specific styles used to style the cartridge modules
  • images\sharebutton.png – Image used for the share module button.

JavaScript

  • Demandware.Gigya.Comments.js – Invokes the Comments plugin.
  • Demandware.Gigya.js – Contains common utility script methods.
  • Demandware.Gigya.Ratings.js – Invokes the Ratings & Comments plugin.
  • Demandware.Gigya.Reactions.js – Invokes the Reactions bar plugin.
  • Demandware.Gigya.Share.js – Invokes the Share plugin.
  • Demandware.Gigya.ShareBar.js – Invokes the Share Bar plugin.
  • Demandware.Gigya.Game.Achievements,js – Invokes the Game Mechanics achievements plugin.
  • Demandware.Gigya.Game.ChallengeStatus – Invokes the Game Mechanics challenge status plugin.
  • Demandware.Gigya.Game.Leaderboard – Invokes the Game Mechanics Leaderboard plugin.
  • Demandware.Gigya.Game.UserStatus – Invokes the Game Mechanics user status plugin.

Templates

  • account\gigya_logout.isml – Contains the logout module template.
  • account\gigya_redirect_login.isml – Redirect logic used to refresh the last page visited.
  • components\game\gigya_achievements.isml – Game Mechanics achievements module.
  • components\game\gigya_challengeStatus.isml – Game Mechanics challenge status module
  • components\game\gigya_gameModules.isml – A template containing the game mechanic modules. It is used to demonstrate the display of the game mechanic modules.
  • components\game\gigya_Leaderboard.isml – Game mechanic Leaderboard.
  • components\game\gigya_userStatus.isml – Game mechanic user status.
  • components\header\gigya_head.isml – Head module that gets placed in the site header element. Includes items needed at the global level (e.g. script, styles, global variables, etc…).
  • components\gigya_comments.isml – Markup template for the comments module.
  • components\gigya_emptyview.isml – An empty template required for the Order share functionality.
  • components\gigya_getAdditionalParameters.isml – this is the template for the gigyaadditionalparams module.
  • components\gigya_raas_containers.isml – Contains a list of registration, profile and login containers, required for RaaS login flow.
  • components\gigya_ratings_product.isml – Contains a ratings module that is configured to be used on the Site Genesis product page.
  • components\gigya_ratings.isml – Markup template for the ratings module.
  • components\gigya_reactions_product.isml – Contains a reactions module that is configured to be used on the Site Genesis product page.
  • components\gigya_reactions.isml – Markup template for the reactions module.
  • components\gigya_share_order.isml – Contains a share module that is configured to be used on the Site Genesis order confirmation page.
  • components\gigya_share_product.isml – Contains a share module that is configured to be used on the Site Genesis product page.
  • components\gigya_share.isml – Markup template for the share module.
  • components\gigya_sharebar_product.isml – Contains a share bar module configured to be used on a Site Genesis product page.
  • components\gigya_sharebar.isml – Markup template for the share bar module.
  • Gigya\modules.isml – Contains the cartridge module definitions.

Properties

  • templates\resources\gigya.properties – text resources used by the cartridge.
  • int_gigya_controllers.properties – cartridge properties.

Metadata and Custom Objects

  • gigya_metadata.xml – Contains the importation schema for the custom site preferences and custom objects.
  • Gigya_services.xml - Contains the importation schema for the Web Services configuration. 
  • gigya_custom_objects.xml – An xml import file containing a sample set of gigya_ReactionType objects.

Use Cases

Registration-as-a-Service

Registration Using a Social Identity

Scenarios:

  • User doesn’t have a SalesForce Commerce Cloud account linked to any social identity.
  • User doesn’t use an e-mail address that is already registered to a SalesForce Commerce Cloud user account for login.

Registration-as-a-Service

If a user tries to log in with their Facebook account, the Login screen-set will be displayed. A SalesForce Commerce Cloud account will be automatically created and tied to the Facebook account

If a user tries to log in with their Twitter account, they will be prompted to the Complete your registration screen-set to fill out additional account information which will be used to create a SalesForce Commerce Cloud account and also will link the SalesForce Commerce Cloud account to the Twitter account.

 

Login using Social Identity

Scenarios:

  • Social Identity that has been linked to a SalesForce Commerce Cloud account.

If a user clicks on a desired social network icon from the Login screen-set, and will enter their social identity credentials, the user will be logged into their SalesForce Commerce Cloud account.

Linking to an Existing Account

Use case 1: Linking to an existing SalesForce Commerce Cloud account:

Scenarios:

  • User registers on the site with an account with an email address, for example: test@yahoo.com.

 

The user logs in with a social provider where they are registered with the same email (test@gmail.com). Because there is already a SalesForce Commerce Cloud account created with this email address, the user is redirected to the link account screen-set.

If the user is the owner of the SalesForce Commerce Cloud account, that they previously created, they will provide the password and be logged in. If the user doesn’t provide the correct password, the user will remain on the Link Account screen-set.

Use case 2: Linking to an existing social account:

Pre-conditions:

  • The user logs in with a social provider that has the address email: test@yahoo.com. At this point there is a SalesForce Commerce Cloud shadow user created, but the user doesn’t actually know about it.

After this creation, if the user will attempt to login with another social account that has the same test@yahoo.com address, the link account functionality will start again. The user will be navigated to Link Account screen-set (as seen before). After the second identity is present in Gigya, the user will be able to log in with both providers, and also with the SalesForce Commerce Cloud user account.

Socialize Plugins

Share Product /Order/Bar

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Share Product / Order / Bar module was added, these should work properly:

  • After a user performs a share-worthy action, a share pop-up dialog is presented, encouraging the user to post their action to social networks. The user is given an option to choose on which social network they want to post the content, edit their personal message, and get a sneak preview of the feed item their social network friends will see.
  • The user does the same type of activity in the site (automatic share); their action will be shared on pre-selected social networks, without prompting the Share plugin. When the share activation receives the user's permission. The user gets an option to choose to "Never share this", meaning never prompt the Share plugin on a certain type of activity in the site.
  • The Share Bar plugin allows you to easily place in your site a bar with different buttons for sharing content to social destinations. The Share Bar plugin is built out of one or more buttons, arranged horizontally in a bar. Each button represents a direct bookmark destination, a general share button, or an email button.
  • Once a user clicks on a direct bookmark button, the window of the provider will be opened for direct bookmarking. Once a user clicks on the general share button, the Simple Share mode of the Share plugin will popup, enabling your user to share and bookmark content and site activities to selected social destinations. The Share Bar buttons may be displayed with or without counters, representing the number of shares.

Ratings and Comments

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Ratings and Comments module was added, these should work properly:

  • The Rating & Reviews plugins give customers an easy way to provide feedback on product and content across the site, and then share that feedback with friends in their social networks. The Rating & Reviews platform includes two plugins:
    • The Rating Plugin
    • The Review Plugin – Comments Plugin. The plugin presents:
      • A "Write a comment" canvas – has two states: when the current user is logged in and when they are logged out.
      • Comments stream

Reactions Bar

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Reaction Bar module was added, this should work properly:

  • The Reactions plugin allows users to react to content in the site and share their reaction to social networks. The Reactions plugin is built out of one or more buttons, arranged horizontally in a bar. Each button represents a "reaction" to the content, such as 'LOL', 'Amazing', etc.
  • Once a user clicks on a reaction button, a mini Share plugin will pop up to suggest to them to share their reaction to the social networks. The user is given an option to choose to which social networks they want to post the content. When the user presses the "OK" button, Gigya will publish the user's reaction to each of the social networks that the user selected. The reaction buttons may be displayed with or without counters, representing the number of times a certain reaction to an item was clicked.

Game Mechanics

User Status

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the User Status module was added, this should work properly:

  • User Status plugin enables users to view their current status in a specific challenge, and control their privacy settings.
  • Each site may have one or more challenges, and each challenge has defined levels. Each level has a badge associated with it, and a level title. A user may achieve a level in a certain challenge by performing actions and accumulating points for these actions.

Leaderboard

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Leaderboard module was added, this should work properly:

  • Leaderboard plugin displays the top ranking users in a specific challenge. Note: the Leaderboard will only display users who have a name, email or provider.
  • Each site may have one or more challenges, and each challenge has defined levels. Each level has a badge associated with it, and a level title. A user may achieve a level in a certain challenge by performing actions and accumulating points for these actions. The user's points can then be used to calculate the user's rank compared to the rest of the challenge's users.

Challenge Status

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Challenge Status module was added, this should work properly:

  • Challenge Status plugin enables users to view all the badges, both locked and unlocked, of the specified challenge.
  • Each site may have one or more challenges, and each challenge has defined levels. Each level has a badge associated with it, and a level title. A user may achieve a level in a certain challenge by performing actions and accumulating points for these actions.

Achievements

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Achievements module was added, this should work properly:

  • Achievement plugin enables users to view their currently achieved level, badge image and title per challenge.
  • Each site may have one or more challenges, and each challenge has defined levels. Each level has a badge associated with it, and a level title. A user may achieve a level in a certain challenge by performing actions and accumulating points for these actions.

Notifications

Scenarios:

  • User must be logged in with the SalesForce Commerce Cloud social media linked account.

If the user navigates to the site location where the Notifications module was added, this should work properly:

  • Notifications plugin notifies the user of their latest achievement, and allows them to share this to their social networks.
  • The plugin is displayed as a popup window on the right hand corner of the page, and appears whenever the user unlocks a new level of any of the active challenges.
  • Each site may have one or more challenges, and each challenge has defined levels. Each level has a badge associated with it, and a level title. A user may achieve a level in a certain challenge by performing actions and accumulating points for these actions.

Custom Code

Custom code added to SiteGenesis

When in Site Preferences the Login Container ID. Register Container ID, and Profile Container ID custom attributes are set up, then the configuring DIV IDs for each screen (login, registration, and edit profile) are enabled. For this, in the following ISML files there must be configured the div ID’s:

 pt_giftregistry, pt_orderhistory, pt_wishlist, 
pt_checkout, pt_orderconfirmation, pt_content, pt_error, pt_compare, 
pt_productdetails, pt_contentsearchresult, 
pt_productsearchresult_content, pt_account pt_productsearchresult_nohits 

In the previous ISML files, inside the div with an ID of 'primary' before the <isreplace/> element add the following:

<isinclude template="components/gigya_raas_containers">

 

In the homepage.isml file, add the following code after the <div id="oc"></div>:

<isinclude template="components/gigya_raas_containers">

 

When RaaS is enabled, then the login forms create account buttons, and the personal data links should be replaced with the links that use the accounts.showScreenSet method to present RaaS's screen-set.

Add the following changes to headercustomerinfo.isml template:

  1. Before and after the <isscript> add the following lines:

    <isinclude template="util/modules"/>
    <isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}"
    scope="page"/>
    if (sitePrefs.gigya_enabled === true) {
    	var libGigyaUtils = 
    	require("int_gigya_controllers/cartridge/scripts/lib/libGigyaUtils"),
    	accountMgr        = libGigyaUtils.getGigyaAccount();
    }

     

     

  2. In the “// user has no session” section before links = [{…}]; put the “if-else” statements and copy-paste each “links” array into it:

    if (sitePrefs.gigya_enabled === true &&
    sitePrefs.gigya_userManagementSustem.value === 2) {
    //copy-paste links = [{…}]; here
    } else {
    //copy-paste links = [{…}]; here
    }
  3. In the // User has no session section, add the following:

    href: “#”,
    raas : accountMgr.raasValues(sitePrefs.gigya_webScreenSetID,
    sitePrefs.gigya_profileMobileScreenSetID, null, sitePrefs.gigya_loginContainerID)

    and

    href: “#”,
    raas : accountMgr.raasValues(sitePrefs.gigya_webScreenSetID, sitePrefs.gigya_mobileScreenSetID, sitePrefs.gigya_registerScreenID, sitePrefs.gigya_RegisterContainerID)
    
    



  4. Replace the loop for user links:

    <isloop items="${links}" var="link">
    <a class="${link.class}" href="${link.href}" title="${Resource.msgf('global.goto.label', 'locale', null, link.title)}">${link.title}</a>
    </isloop>

    with

    <isif condition="${sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 2}">
    	<isloop items="${links}" var="link">
    	<a class="${link.class}" href="${link.href}" 
    	title="${Resource.msgf('global.goto.label', 'locale', null, link.title)}" onclick="gigya.accounts.showScreenSet(${JSON.stringify(link.raas)});"> ${link.title}</a>
    	</isloop>
    <iselse/>
    <isloop items="${links}" var="link">
    	<a class="${link.class}" href="${link.href}" title="${Resource.msgf('global.goto.label', 'locale', null, link.title)}">${link.title}</a>
    </isloop>
    </isif>

     

  5. Add the following changes to the accountlogin.isml template:

    <isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/>
    
        <isif condition="${sitePrefs.gigya_enabled === true}">
            <isif condition="${pdict.Error == true}">
                <isif condition="${sitePrefs.gigya_languageCode === 'en'}">
                    <span class="gigya-error clearfix"> ${Resource.msg('gigya.serverdown.message','gigya','')}</span>
                <iselse/>
                    <span class="gigya-error clearfix"> ${Resource.msg('gigya.serverdown.message','gigya_' + sitePrefs.gigya_languageCode,'')}     </span>
                </isif>
            </isif>
        </isif>



    <isif condition="${sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 2}">
    	<a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'${sitePrefs.gigya_webScreenSetID}'<isif condition="${!empty(sitePrefs.gigya_mobileScreenSetID)}">
    	, mobileScreenSet:'${sitePrefs.gigya_mobileScreenSetID}'</isif>, startScreen:'${sitePrefs.gigya_registerScreenID}'
    	<isif condition="${!empty(sitePrefs.gigya_RegisterContainerID)}">, containerID:'${sitePrefs.gigya_RegisterContainerID}'</isif>});">
    	${Resource.msg('global.createnowbutton','locale',null)} </a>
    	<iselse/>
    	<button type="submit" value="${Resource.msg('global.createbutton','locale',null)}" name="${pdict.CurrentForms.login.register.htmlName}">
    	${Resource.msg('global.createnowbutton','locale',null)}
    	</button>
    </isif>
    

     

     

     

  6. Add the following changes to the logininclude.isml template:

    Wrap the existing <div class="login-box login-account">…</div> with: 

    <isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/>
    <isif condition="${sitePrefs.gigya_enabled === false || (sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 0)}">
    // div class="login-box login-account">…</div>
    </isif>

     

  7. Add the following changes to the accountnavigation.isml template:

  8. Replace the existing line <iscontentasset aid="account-nav-registered"/> with :

     

    <isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/>
        <isif condition="${sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 2}">
            <span class="toggle">My Account</span>
            <ul>
                <li><a href="#" class="gigyaProfileUpdateScreen">Personal Data</a></li>
                <li><a title="Manage your billing and shipping addresses" href="${URLUtils.url('Address-List')}">Addresses</a></li>
                <li><a title="Manage Credit Cards" href="${URLUtils.url('PaymentInstruments-List')}">Payment Settings</a></li>
            </ul>
            <iscontentasset aid="account-raas-nav-registered"/>
        <iselse/>
            <iscontentasset aid="account-nav-registered"/>
        </isif>
    


    Please note that the account-raas-nav-registered is a clone of the existing account-nav-registered asset. The only lines that must be removed are:

    <span class="toggle">My Account</span>
    <ul>
    <li><a title="Show or update your personal information" href="$httpsUrl(Account-EditProfile)$">Personal Data</a></li>
    <li><a title="Manage your billing and shipping addresses" href="$httpsUrl(Address-List)$">Addresses</a></li>
    <li><a title="Manage Credit Cards" href="$httpsUrl(PaymentInstruments-List)$">Payment Settings</a></li>
    </ul>
    



  9. In the accountoverview.isml template, replace the existing line <iscontentasset aid="account-landing"/> with:

    <isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/>
        <isif condition="${sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 2}">
            <iscontentasset aid="account-landing-raas"/>
        <iselse/>
            <iscontentasset aid="account-landing"/>
        </isif>
    

    Please note that the account-landing-raas is a clone of the existing account-landing asset. The only lines that must be replaced are:

    <li>
        <a title="Show or update your personal information" href="$httpsUrl(Account-EditProfile)$">
            <img height="48" width="48" src="images/myaccount_personaldata.png?$staticlink$" alt="Personal Data"/>
            Personal Data
        </a>
        <p>Show or update your personal information</p>
    </li>
    

    with: 

    <li>
        <a title="Show or update your personal information" href="#" class="gigyaProfileUpdateScreen">
            <img height="48" width="48" src="images/myaccount_personaldata.png?$staticlink$" alt="Personal Data"/>
            Personal Data
        </a>
        <p>Show or update your personal information</p>
    </li>
    



  10. Add the following lines to the checkoutlogin.isml template:

     

    <isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/>
    <isscript>
        if (sitePrefs.gigya_enabled === true) {
            var libGigyaUtils = require("int_gigya_controllers/cartridge/scripts/lib/libGigyaUtils"),
                accountMgr    = libGigyaUtils.getGigyaAccount(),
                gigyaPolicies = accountMgr.getPolicies();
        }
    </isscript>
    

     


    Replace the existing code: 

    <button type="submit" value="${Resource.msg('global.createbutton','locale',null)}" name="${pdict.CurrentForms.login.register.htmlName}">
    	<span>${Resource.msg('global.createnowbutton','locale',null)}</span>
    </button>

    with: 

    <isif condition="${sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 2 && gigyaPolicies.statusCode === 200}">
    <a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'${sitePrefs.gigya_webScreenSetID}'<isif condition="${!empty(sitePrefs.gigya_mobileScreenSetID)}">
    ,mobileScreenSet:'${sitePrefs.gigya_mobileScreenSetID}'</isif>
    , startScreen:'${sitePrefs.gigya_registerScreenID}'<isif condition="${!empty(sitePrefs.gigya_RegisterContainerID)}">
    , containerID:'${sitePrefs.gigya_RegisterContainerID}'</isif>});">
    ${Resource.msg('global.register','locale',null)}
    </a>
    <iselse/>
    <button type="submit" value="${Resource.msg('global.createbutton','locale',null)}" name="${pdict.CurrentForms.login.register.htmlName}">
    <span>${Resource.msg('global.createnowbutton','locale',null)}</span>
    </button>
    </isif>
    




  11. Add the following changes to the confirmation.isml template in order to increment the Purchase counter for the current user:

     

    <isinclude url="${URLUtils.url('GigyaRaaS-RecordPurchase',
    'productQuantityTotal', pdict.Order.productQuantityTotal.toString(), 
    'adjustedMerchandizeTotalGrossPrice', pdict.Order.totalGrossPrice.value.toString())}"/>



  12. Add the following changes to the cartridge/scripts/util/Resource.ds script of the core cartridge in order to trigger the profile update screen:

    gigyaRaaSProfileUpdate : URLUtils.url('GigyaRaaS-ProfileUpdate').toString()

 

 

<isif condition="${sitePrefs.gigya_enabled === true && sitePrefs.gigya_userManagementSystem.value === 2 && httpClient.statusCode === 200}"> 

<a title="${Resource.msg('global.login','locale',null)}"<a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'${sitePrefs.gigya_webScreenSetID}'<isif condition="${!empty(sitePrefs.gigya_profileMobileScreenSetID)}">, mobileScreenSet:'${sitePrefs.gigya_mobileScreenSetID}'</isif><isif condition="${!empty(sitePrefs.gigya_loginContainerID)}">, containerID:'${sitePrefs.gigya_loginContainerID}'</isif>});">mobileScreenSetID)}"> 

${Resource.msg('global.login','locale',null)}

</a>

<iselse>

<a title="${Resource.msg('global.login','locale',null)}" href="${URLUtils.https('Account-Show')}" class="user-login">

${Resource.msg('global.login','locale',null)}

</a>

</isif>

-             instead of the register link:

<a title="${Resource.msg('global.register','locale',null)}" href="${URLUtils.https('Account-StartRegister')}" class="user-register">

,${Resource.msg('global.register','locale',null)} 

</a> 

, there must be used the following code, if RaaS is enabled:

<isif condition="${sitePrefs.gigya_userManagementSystem.value === 2 && httpClient.statusCode === 200}">

<a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'${sitePrefs.gigya_webScreenSetID}'<isif condition="${!empty(sitePrefs.gigya_mobileScreenSetID)}">, mobileScreenSet:'${sitePrefs.gigya_mobileScreenSetID}'</isif>, startScreen:'${sitePrefs.gigya_registerScreenID}'<isif condition="${!empty(sitePrefs.gigya_RegisterContainerID)}">, containerID:'${sitePrefs.gigya_RegisterContainerID}</isif>});"> 

${Resource.msg('global.register','locale',null)}

</a>

<iselse>

<a title="${Resource.msg('global.register','locale',null)}" href="${URLUtils.https('Account-StartRegister')}" class="user-register">

${Resource.msg('global.register','locale',null)}

</a>

</isif>

-             instead of the personal data link:

<a href="${URLUtils.https('Account-Show')}" title="${Resource.msg('global.accountlink','locale',null)} " class="user-account">

   <isprint value="${pdict.CurrentCustomer.profile.firstName}"/>

   <isprint value="${pdict.CurrentCustomer.profile.lastName}"/>

</a> 

, there must be used the following code, if RaaS is enabled:

<isif condition="${sitePrefs.gigya_userManagementSystem.value === 2 && httpClient.statusCode === 200}">

<a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'${sitePrefs.gigya_profileWebScreenSetID}'<isif condition="${!empty(sitePrefs.gigya_profileMobileScreenSetID)}">, mobileScreenSet:'${sitePrefs.gigya_profileMobileScreenSetID}'</isif>

<isif condition="${!empty(sitePrefs.gigya_profileContainerIDRegisterContainerID)}">, containerID:'${sitePrefs.gigya_profileContainerIDRegisterContainerID}'</isif>});"> 

<isprint value="${pdict.CurrentCustomer.profile.firstName}"/>

<isprint value="${pdict.CurrentCustomer.profile.lastName}"/>

</a>

<iselse>

<a href="${URLUtils.https('Account-Show')}" title="${Resource.msg('global.accountlink','locale',null)} " class="user-account">

<isprint value="${pdict.CurrentCustomer.profile.firstName}"/>

<isprint value="${pdict.CurrentCustomer.profile.lastName}"/>

</a>

</isif>

 

In the logininclude.isml file, in order to hide the login form, there must be put at the top of the file the following condition:

<isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/> 

<isif condition="${sitePrefs.gigya_enabled === true || (sitePrefs.gigya_enabled === false && (sitePrefs.gigya_userManagementSystem.value == '1' || sitePrefs.gigya_userManagementSystem.value == '0'))}">

 

At the bottom of the logininclude.isml file, put the isif tag: </isif> 

 

Also, in the Account-Show page, there must be replaced the create account button, with the register RaaS link, so update lines

<button type="submit"value="${Resource.msg('global.createbutton','locale',null)}"

 name="${pdict.CurrentForms.login.register.htmlName}">

 ${Resource.msg('global.createnowbutton','locale',null)} </a> 

</button>

In the accountlogin.isml file with the next lines<iselse/>

:

<isset name="sitePrefs" value="${dw.system.Site.current.preferences.custom}" scope="page"/> 

<isif condition="${sitePrefs.gigya_enabled === true}">

<isif condition="${sitePrefs.gigya_userManagementSystem.value == '0' || sitePrefs.gigya_userManagementSystem.value == '1'}">

<button type="submit" value="${Resource.msg('global.createbutton','locale',null)}" name="${pdict.CurrentForms.login.register.htmlName}"> 

${Resource.msg('global.createnowbutton','locale',null)} 

</button> 

</isif>