1. Go to this page and download the library: Download textalk/webshop-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$api = Connection::getInstance('default', array('webshop' => 22222));
// Save a handle to the API for a single Articlegroup:
$articlegroup = $api->Articlegroup(1347891);
// Get all names:
// These are all equivalent:
//
// * $api->Articlegroup(1347891)->get('name')
// * $api->Articlegroup->get(1347891, 'name')
// * $api->call('Articlegroup.get', array(1347891, 'name'))
var_dump(
$articlegroup->get('name')
);
// Will produce:
// array(1) {
// 'name' =>
// array(2) {
// 'en' =>
// string(3) "Men"
// 'sv' =>
// string(4) "Herr"
// }
// }
// This line won't actually DO anything, so it won't crasch:
$scissor = $api->IDontKnow("What I'm doing");
// But this will:
$scissor->run();
// -->
// PHP Fatal error: Uncaught exception 'Textalk\WebshopClient\Exception\MethodNotFound' with message 'IDontKnow.run: Method not found: No API for IDontKnow
// On request: {"jsonrpc":"2.0","method":"IDontKnow.run","id":"7089b561-9252-4a0a-b45b-15a873509571","params":["What I'm doing"]}' in /home/liljegren/textalk-webshopclient-php/lib/Exception.php:32
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.