Blog

Blog je mesto gde možeš da čitaš o navikama IT-evaca, najavama IT dešavanja, aktuelnostima na tržištu, savetima i cakama kako da uspeš na ovom dinamičnom polju.
Mi pratimo trendove, na tebi je da se zavališ u fotelju i čitaš :)

16.01.2023. ·
10 min

Increasing your Revenue with Abandoned Cart Feature

Email marketing is a way to promote products or services through email. It is used as a top digital media channel, and it is important for customer acquisition and retention. In this blog, we will build a mechanism that will collect data from an abandoned cart along with a visitor's email address, store it into a custom object, so that after a certain time we can use that data to notify our customers through email that they have uncompleted orders. We will achieve this with Salesforce Commerce Cloud, using some built-in functionalities in business manager and writing a custom code to support it. STORING INFORMATION ABOUT ABANDONED CARTS As we don't have any system object to store the data for all incomplete orders, we need to create our own custom object type. Following the path Administration > Site Development > Custom Object Types, we can find all the custom object types that are already created. To create a new one, we need to click New and provide an ID, which needs to be unique. A Key Attribute is also a unique identifier for the object type. From the dropdown menu, select a Storage Scope that determines whether it is assigned to a specific site or the entire organization. In the image below, you can see what we used for our case. After that, we need to go to the Attribute Definitions tab and add fields that will store information about a specific order. That information is the customer's email address, the cart's total price, an indication if the customer is a registered user or a guest, and a JSON object containing the cart's data before the customer decided to abandon it. We will achieve that by clicking on New and then defining the attribute by choosing a unique ID, a preferred Display Name, and an appropriate Value Type, and clicking Apply. In our case, for the customer’s email, the Value Type will be a String type, for totalPrice a Number, registeredCustomer Boolean, and for the JSON object a Text type. You can check out one example in the image below. To make it work, we also need to group the attributes that we created by going to the Attribute Grouping tab and creating a new Attribute Group by choosing an ID that is unique for this type and an arbitrary name. In our case, the ID will be ‘default’ and the name is ‘Default’, and after that, we click Add. Now we need to assign our attributes to the newly created group. Clicking the Edit link, we will be redirected to the Assign Attribute Definition page where we need to click the three-dot button, and now we have a popup that contains all the attributes of this object type. In our case, we will choose our new attributes along with the type ID required to identify the object later in the code. Now, by clicking the Select button, we have assigned the attributes. In addition, we will add a new Site Preferences group so the feature can be configurable. Firstly, we need to go to Administration -> System Object Types and search for SitePreferences. In the Site Preferences, we need to add two Attribute Definitions. AbandonedCartEnabled is a Boolean that tells us if the feature is enabled or not, and abandonedCartEmail is the email address from where we will be sending the objects. After that, we need to go to Attribute Grouping, create a new group called Abandoned Cart and add all three attributes to it. Now, we will need to set the values for the attributes by going to Merchant Tools->Custom Preferences. Find Abandoned Cart and add the values you want to the two fields as shown in the image below. After all these steps are done successfully, we have our custom object type and site preferences created in the business manager, and now we need to do some coding to implement it on our site. After all these steps are done successfully, we have our custom object type and site preferences created in the business manager, and now we need to do some coding to implement it on our site. CREATING AND HANDLING CUSTOM OBJECTS Firstly, we will create a helper with functions for handling the objects that will be used later in the code. The createNewObject function is used to initially create the custom objects and store them in the database. Start with mapping fields of the product that are important for restoring the basket afterwards, followed by creating a unique ID, which is created by merging the basket UUID and Date.now() timestamp. Now, by calling createCustomObject from customObectjMgr and passing the name of the object as the first parameter and the ID as the second, it will create it and store it in the custom object. Now we need to fill the object fields, and to do that, we will wrap it in a Transaction so it can be saved to the DB. Besides that, we will need to store the basket UUID and the abandoned cart ID to the session that will be used to make sure that we already created an object for the session and prevent it from making another one each time we enter the checkout process. For deleteObject we will just need the ID of the custom object, and by calling the remove() function and passing that ID, it will delete the object. Also, we need to delete the previously stored data from the session. UpdateCartInfo will be used when adding, removing and updating lineItems on the basket level. For that one, we will again just need the ID of the custom object to get it with the getCustomObject function, and similar to createNewObject, we will map the product and update the object by wrapping it all into a transaction. Similar to updating the cart, we will create the updateEmail function that will be used if a guest user changes it at the beginning of the checkout process. For this example, the object will be created in two cases, one for guest customers as soon as we know their email addresses, and one for logged customers at the moment of creating the basket. To cover the guest customer scenario, we need to extend the CheckoutServices.js controller from the base cartridge by using the server.extend function with a module.superModule parameter and appending the 'SubmitCustomer' endpoint. After we check if the feature is enabled in Site Preferences, we will check if the custom object is already created by looking into the data from the session and update the email to make sure it is the latest one. Now, if the basket is available, we will use our custom function createNewObject to create our custom object. Now, as we covered guest users, we need to cover the second case, and that is the registered customer. As we know the customer’s email right away, we will create the object as soon as they add a product to the basket. To achieve that, we will need to extend the AddProduct, RemoveProductLineItem and UpdateQuantity endpoint. As the helpers are already created, the logic is pretty straightforward for all endpoints. So, basically again making sure that the feature is enabled in Site Preferences, that the customer logged in, and if we have the current basket already saved in the session, we can decide whether we should call createNewObject or updateCartInfo. We have just one specific case here and that is when removing a product from the cart, we need to check if the basket is empty, in which case we will call the deleteObject function to delete the whole custom object. The email is sent only if the customer has abandoned the cart, so we need to make sure to delete the object if the customer actually places the order. So, we will now append the PlaceOrder endpoint the same way as we did with the last one using another custom-made function. All custom objects that we created can be found by going to site > Custom Objects > Custom Object Editor, finding our object type name from the list, and hitting the find button. It should be noted that on this page, with the right permissions, we can edit, add and remove our object manually, but these functionalities should be used just for testing purposes while implementing the code. One thing we need to keep in mind is that we have limits set for the number of created object types to 300 and a total of 400,000 custom objects, with a warning at 240,000. Now that we have the procedure to save all the necessary data, we can create a job that runs once at a time, fetches the objects one by one, and sends an email with the cart content to every customer for which we have created an object 15 days before the job executed, and after the email is successfully sent, deletes the custom object to make sure we don't exceed the limit we mentioned above. It is also recommended to set a retention on the custom object itself so we prevent sending really old abandoned carts to customers. CREATING A JOB A good practice when making some integrations is to create a new cartridge and name it with a prefix int as I have done in this example. Now, the first thing that needs to be done is to configure a step type by creating a JSON file as shown below. (više)

HelloWorld
0
13.01.2023. ·
5 min

4G i 5G umrežavanje vozila u automobilskim komunikacijama

Umrežavanje i automobili su dva pojma koja sve češće viđamo u istom kontekstu. Ako pogledamo trendove kojima se teži u automobilskoj industriji primetićemo povećavanje broja kontrolera koji se nalaze unutar vozila. Današnji moderni automobili su preplavljeni kontrolerima koji su međusobno umreženi, koji sarađuju, i na taj način ostvaruju „inteligentno“ ponašanje vozila kao celine. Još jedan trend je, pored umrežavanja kontrolera unutar vozila, povezivanje vozila sa ostatkom sveta, odnosno sa onim što ga okružuje. Kad to kažemo, mislimo na povezivanje vozila sa mobilnim telefonom, sa udaljenim serverima, sa call centrima, sa drugim vozilima, sa saobraćajnom infrastrukturom, i slično. Zato pojam umrežavanja vozila razlikujemo spram domena, odnosno prostora, u kojem uređaje umrežavamo: (više)

HelloWorld
0
13.01.2023. ·
1 min

Meetup: “Kako je raditi kao Product Manager?“

U četvrtak, 19. januara, u 18h, u InspiraHub-u, pričamo sa Tatjanom Ivošević, a tema predavanja biće koncipirana oko objašnjenja uloge Product Managera u timu, zadataka koje obavlja dok razvija proizvod, kao i odgovornosti koje ima. (više)

HelloWorld
0
12.01.2023. ·
2 min

Apple je developerima napokon omogućio veću slobodu u određivanju cena aplikacija

Apple je developerima pružio dodatnih 700 cenovnih tačaka koje mogu da koriste prilikom određivanja cena svojih aplikacija unutar App Store-a.  (više)

11.01.2023. ·
2 min

Predstavljamo nove profile poslodavaca na HelloWorld.rs

U zavisnosti od toga koliko dugo koristiš naš sajt, sa rečenicom “držimo korisnike kao malo vode na dlanu” si se susreo jednom ili sto jednom, dragi korisniče. Da to nije samo fraza, govore manja i veća unapređenja funkcionalnosti na sajtu, a sve u skladu sa očekivanjima i potrebama naših korisnika. To nas dovodi do teme iz naslova – promena u profilu poslodavca. (više)

10.01.2023. ·
2 min

Mračna strana autonomije

Loše strane samoorganizacije u agilnom načinu poslovanja Jačanje autonomije i uklanjanje formalnog hijerarhijskog liderstva je glavni prioritet u agilnom svetu. Želimo timove koji samostalno oblikuju svoj svakodnevni rad i preuzimaju odgovornost, jer znamo da najbolji rezultati proizilaze iz samoorganizovanih timova (11. princip Agilnog manifesta). (više)

HelloWorld
0
10.01.2023. ·
1 min

ITAF joins an elite class of Microsoft Solution Partners for Modern Work

We are excited to announce that ITAF has become a Microsoft Solutions Provider for Modern Work. This designation recognizes our ability to help our customers navigate their digital transformation journey and leverage their Microsoft investment to drive growth and gain efficiency. (više)

HelloWorld
0
10.01.2023. ·
2 min

Otvorene prijave za .NET WinterWorkshop program

.NET WinterWorkshop je program zimskih interaktivnih radionica koje kombinuju različite metode učenja – praktične zadatke, video kurseve kao i saradnju sa mentorima, iskusnim Najnerima. Osmišljen je tako da kombinuje najbolje iz hibridnog okruženja, rad od kuće i povremene prilike za kolaboraciju uživo, iz kancelarije Levi9 u Zrenjaninu. (više)

HelloWorld
0
10.01.2023. ·
1 min

IT kompanije iz prve ruke: Jelena Petrović, TX services

Kako je raditi u IT kompanijama, šta nude, a šta očekuju pričaćemo u formi kratkih video intervjua sa predstavnicima IT firmi koje posluju u Srbiji. (više)

Da ti ništa ne promakne

Ako želiš da ti stvarno ništa ne promakne, prijavi se jer šaljemo newsletter svake dve nedelje.