PHP SDK
Introduction
We have developed a ready to use PHP library to allow you to connect your shop with our service in less than one.
How install it ?
Using composer
Our plugin is available via compose. Just run the following command to install it
composer require cartsguru/cartsguru
Using our git
You can download the library follow this url https://bitbucket.org/market-wave/cartsguru-lib-php
How to use it
#1 - Create a CartsGuruController class
Our SDK expose a CartsGuru class that you should extend to adapt it to your needs: - override the constructor to set your API credentials. - override adaptCart, adaptOrder and adaptProduct to convert your data into our API models. You can find documentation about cart model and order model
Example of class
#2 - Use it !
Send your cart
A cart must be sent on each update.
Send your orders
An order must be sent when it is created or state change.
Add online retargeting feature
You should insert the tag on each page that the visitor can access
FAQ
How carts are identified ?
We must distinguish two kind of cart : identified and non identified. When the visitor is logged in, we speak about identified cart. You must set the accountId field with the user email on this case. When the visitor is anonymous, it's a non identified cart. And so, you should set the visitorId field using the value of the cookie trkcg_vid
Last updated