PHP
For PHP development, we provide a Composer package, which has source code available in our public Github.
tip
In order to provide full insights, Faslet requests that you implement both the Size Me Up Virtual Assistant on the Product Page and Order Tracking on the Thank You page. To validate your installation, please see our Integration Checklist
Installation
To use this project in your own, pull down this plugin with
composer require faslet/faslet
Size Me Up Virtual Assistant (Product page)
Example usage
use Faslet\Widget;
$widget = new Widget(SHOP_ID);
$widget
->withBrand(BRAND_IDENTIFIER)
->withProductId(PRODUCT_IDENTIFIER)
->withProductImage(PRODUCT_IMAGE_URL)
->withProductName(PRODUCT_NAME);
$widget
->addColor(COLOR_1_ID, COLOR_1_NAME)
->addColor(COLOR_2_ID, COLOR_2_NAME)
$widget
->addVariant(VARIANT_1_ID, VARIANT_1_SIZE_LABEL, VARIANT_1_IN_STOCK, VARIANT_1_SKU, VARIANT_1_COLOR_ID, VARIANT_1_PRICE, VARIANT_1_IMAGE_URL)
->addVariant(VARIANT_2_ID, VARIANT_2_SIZE_LABEL, VARIANT_2_IN_STOCK, VARIANT_2_SKU, VARIANT_2_COLOR_ID, VARIANT_2_PRICE, VARIANT_2_IMAGE_URL)
// An example add to cart redirect url. Note that %id% will be replaced by the module with the variant id given above
$widget->withAddToCartRedirect("https://example.com/add-to-cart?variantId=%id%", "%id%");
and then to render the HTML
echo $widget->buildWidget();
Order Tracking (After checkout/Thank You page)
Example usage
use Faslet\OrderTracking;
// GET THIS FROM YOUR FASLET REPRESENTITIVE
$orderTracking = new OrderTracking(SHOP_ID);
$orderTracking
->withOrderNumber(ORDER_NUMBER)
->withPaymentStatus(ORDER_STATUS);
$orderTracking
->addProduct(PRODUCT_ID, VARIANT_ID, PRODUCT_NAME, VARIANT_NAME, PRODUCT_PRICE_TIMES_QUANTITY, QUANTITY, VARIANT_SKU)
and then to render the HTML
echo $orderTracking->buildOrderTracking();
Examples
In the project's Github Repository, you can find an example implementation.
Help
In case of any questions, please don’t hesitate to contact us on support@faslet.me