BVH Logo Trusted Shop Logo

prudsys IREUS PHP connector

prudsys IREUS general documentation

You can use prudsys IREUS within your online store in a very simple and fast way even without a prepared IREUS connector. Our general documentation describes how it works. If you have a PHP based online store you can use our simple API - the prudsys IREUS PHP connector - to use IREUS even faster.

 

prudsys IREUS PHP connector

The PHP connector was developed for shop systems that do not have the prudsys IREUS connector. This connector provides you with a simple API to use IREUS in PHP-based shop systems.

Example 1:

Provision of product data in the IREUS format from a product array

<?php

// Create a prudsys IREUS product csv file
// from an array and output it
echo Ireus_Controller_Export::getInstance()
         ->createProductsCsv($products);

?>

Example 2:

Provision of product data in the IREUS format from an extisting CSV file

<?php

// Read an existing csv-file into an array
$products = Ireus_Model_Csv::readFile($yourfile);

// Create a map of array keys:
// IREUS keys => Existing CSV file keys
$keymap = array(
    "pid" => "product_id",
    "netUnitPrice"  => "price",
    …
);

// Create the prudsys IREUS product csv file
// and output it
echo Ireus_Controller_Export::getInstance()
         ->setProductColumns($keymap)
         ->createProductsCsv($products);

?>

Example 3:

Defining the IREUS event to call up recommendations on product detail pages

<?php

// Define prudsys IREUS JavaScript Event
// and output it
echo Ireus_View_Client::getEvent(
    ‘product‘,
    array(
        ‘reid‘ => $reid,
        ‘sid‘ => $sid,
        ...
    )
);

?>

Example 4:

Inserting JavaScript code for execution of the IREUS events and displaying recommendations

<?php

// Define prudsys IREUS JavaScript Call
// and output it
echo Ireus_View_Client::getCall();

?>