Open Catalog Interface (Oci) : For Virtuemart
Open Catalog Interface (Oci) : For Virtuemart
Table of Contents
Term declaration ........................................................................................................................ 3
OCI for VirtueMart .................................................................................................................... 4
Installation .............................................................................................................................. 4
Autologin .................................................................................................................................... 5
Administrator ......................................................................................................................... 5
Frontend ................................................................................................................................. 6
Calling kh_autologin .......................................................................................................... 6
Test mode ........................................................................................................................... 6
Vmoci ......................................................................................................................................... 7
Administrator ......................................................................................................................... 7
Frontend ................................................................................................................................. 8
Test mode ............................................................................................................................... 8
Customizing ............................................................................................................................... 9
What means customizing within kh_vmoci ........................................................................... 9
The standard template ............................................................................................................ 9
Where are the templates ......................................................................................................... 9
Edit a template. ....................................................................................................................... 9
Which fields in the template are available ....................................................................... 10
Templates to users ................................................................................................................ 11
License ..................................................................................................................................... 13
Page 2 of 13
Term declaration
The Open Catalog Interface (OCI) is the interface between catalogs and SAP Business-toBusiness Procurement. SAPs Open Catalog Interface uses standard Internet protocols. It has
already been implemented between several catalog applications and SAP Business-to-Business
Procurement.
Page 3 of 13
Installation
Install and activate the Plugins kh_autologin and kh_vmoci.
Page 4 of 13
Autologin
Administrator
Parameter
Url redirect
Description
Which page should be invoked
after login?
Password
Debug
Debug mode
Values
Empty
Any page from Joomla: e.g.
Index.php
unencrypted
encrypted
SAP standard is unencrypted
no
yes
Only for testing
Page 5 of 13
Frontend
Calling kh_autologin
Parameter
URL
Description
Url of the own Page
Username
Username
Password
Password
Hook_Url
Values
http://www.myshop.com/index.php
index.php must be specified
USER
user
USERNAME
username
SAP standard is USERNAME
passw
PASSW
password
PASSWORD
SAP standard is PASSWORD
hook_url
HOOK_URL
SAP standard is HOOK_URL
Name of user
Password
Will be created by the system
Test mode
If you call the catalog with HOOK_URL=test, then the OCI-data will be shown.
URL: MyShop/index.php?USERNAME=xxx&PASSWORD=xxx&HOOK_URL=test
Page 6 of 13
Vmoci
Vmoci sends the order data to the Hook_url.
Important:
Vmoci injects Code in the thankyou-Page from VirtueMart. Therefore, the ordering
process has to end with the thankyou-page of VirtueMart.
With basic knowledge of PHP you can determine the fields and the format for transmit.
For each user you can define their own template.
Please read the section Customizing.
Administrator
Parameter
Automatic
transfer
Description
If YES: transfers data without clicking
the send button.
Values
Yes
No
Time
Milliseconds
Debug
No
Yes
Only for testing
Page 7 of 13
Frontend
The OCI will be shown in the thankyou page of Virtuemart.
If automatic sending is no, the user have to click the send button.
Test mode
When HOOK_URL has the value test, the "reflector for testing forms" shows the order data.
Page 8 of 13
Customizing
What means customizing within kh_vmoci
With a template, you can determine which data the OCI sends. With simple PHP functions you
can also determine the format of data.
Edit a template.
Open the template default.tpl.php or copy it to a new template and open it.
<form id="kh_vmOciSendForm" action=" <?php echo $hook_url ?>" method="post"
target="_top">
standard parameter
<input type="hidden" name="~OkCode" value="ADDI" />
<input type="hidden" name="~target" value="_top" />
<input type="hidden" name="~Caller" value="CTLG" />
<?php
$counter = 1;
foreach( $rows as $row )
{
?>
In the foreach construct, you can determine the data for each product of the order. E.g.
<input type="hidden" name="NEW_ITEM-DESCRIPTION[<?php echo $counter ?>]"
value="<?php echo substr($row->order_item_name,0,40) ?>" />
<input type="hidden" name="NEW_ITEM-QUANTITY[<?php echo $counter ?>]"
value="<?php echo number_format($row->product_quantity, 3, '.', '') ?>" />
<input type="hidden" name=NEW_ITEM-UNIT[<?php echo $counter ?>]"
value="<?php echo substr($row->product_unit,0,3) ?>" />
<input type="hidden" name="NEW_ITEM-PRICE[<?php echo $counter ?>]"
value="<?php echo number_format($row->product_item_price, 3, '.', '') ?>" />
<input type="hidden" name="NEW_ITEM-PRICEUNIT[<?php echo $counter ?>]"
value="1" />
<input type="hidden" name="NEW_ITEM-CURRENCY[<?php echo $counter ?>]"
value="<?php echo $row->order_item_currency ?>" />
More data..
<?php $counter++; ?>
<?php } //end for ?>
<input type="button" class="button" value="<?php echo $button_text ?>"
id=kh_submitoci name=kh_submitoci onClick="kh_vmocisendform()">
</form>
Page 9 of 13
Page 10 of 13
Templates to users
!!
Only necessary if different customers want different transmitted data.
Otherwise simply edit default.tpl.php.
!!
If necessary, you can specify a template for each user.
Is no template specified, kh_vmoci use default.tpl.php.
To assign a template to an user, the following steps have to be executed.
1. In VirtueMart -> Configuraterion -> Shopper Fields insert a new field with the name
kh_oci .
!! Attention!!
There is a bug in VM!
a. The new field will inserted with index 0.
If you delete the field (e.g. wrong name) and insert an new field, then you have
two fields with index 0.
At worst, you have to correct the index in the database table jos_vm_userfield in
the column ordering.
Page 11 of 13
2.
Insert new users in VirtueMart -> Ordes & Shoppers -> Shoppers -> Additional
Information and write the name of the template without extensions into the field kh_oci
(e.g. mytemplate).
Page 12 of 13
License
GNU General Public License
Page 13 of 13