How to add support of IFRAME feature to the Moneybookers payment add-on in CS-Cart 2.1.4 (only in this version).
These instructions are applicable to Community, Professional and Multi-Vendor editions:
- Upload the ‘mb-iframe.zip’ archive file (attached to this post) to the root CS-Cart directory and unpack it there.
- Open the “controllers/customer/checkout.php” CS-Cart file in a text editor and replace the following part of the code:
<br />
$view->assign('payment_info', $payment_info);
```<br />
<br />
with this one:<br />
<br />
```php
<br />
$view->assign('payment_info', $payment_info);<br />
// [mb]<br />
if (!empty($payment_info['params']['iframe_mode']) && $payment_info['params']['iframe_mode'] == 'Y') {<br />
$view->assign('iframe_mode', true);<br />
}<br />
// [/mb]<br />
```<br />
<br />
Then the following part of the code:<br />
<br />
```php
<br />
fn_add_breadcrumb(fn_get_lang_var('landing_header'));<br />
}<br />
```<br />
<br />
with this one:<br />
<br />
```php
<br />
fn_add_breadcrumb(fn_get_lang_var('landing_header'));<br />
// [mb]<br />
} elseif ($mode == 'process_payment') {<br />
if (fn_allow_place_order($cart) == true) {<br />
$order_info = $cart;<br />
$order_info['items'] = $cart['products'];<br />
$order_info = fn_array_merge($order_info, fn_check_table_fields($cart['user_data'], 'orders'));<br />
$order_info['order_id'] = $order_id = TIME . "_" . (!empty($auth['user_id']) ? $auth['user_id'] : 0);<br />
<br />
list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id'], '');<br />
if ($is_processor_script) {<br />
set_time_limit(300);<br />
$index_script = INDEX_SCRIPT;<br />
$mode = MODE;<br />
fn_define('IFRAME_MODE', true);<br />
<br />
include(DIR_PAYMENT_FILES . $processor_data['processor_script']);<br />
<br />
fn_finish_payment($order_id, $pp_response, array());<br />
fn_order_placement_routines($order_id);<br />
}<br />
}<br />
}<br />
// [/mb]<br />
```<br />
<br />
3. Edit the "skins/basic/admin/views/payments/components/cc_processors/moneybookers_ew.tpl" and "skins/basic/admin/views/payments/components/cc_processors/moneybookers_qc.tpl" files and replace the following part of the code:<br />
<br />
```php
<br />
<div class="form-field"><br />
<label for="return_url_target_{$payment_id}">{$lang.return_url_target}:</label><br />
<select name="payment_data[processor_params][return_url_target]" id="return_url_target_{$payment_id}"><br />
<option value="1" {if $processor_params.return_url_target == '1'}selected="selected"{/if}>_top</option><br />
<option value="2" {if $processor_params.return_url_target == '2'}selected="selected"{/if}>_parent</option><br />
<option value="3" {if $processor_params.return_url_target == '3'}selected="selected"{/if}>_self</option><br />
<option value="4" {if $processor_params.return_url_target == '4'}selected="selected"{/if}>_blank</option><br />
</select><br />
</div><br />
<br />
<div class="form-field"><br />
<label for="cancel_url_target_{$payment_id}">{$lang.cancel_url_target}:</label><br />
<select name="payment_data[processor_params][cancel_url_target]" id="cancel_url_target_{$payment_id}"><br />
<option value="1" {if $processor_params.cancel_url_target == '1'}selected="selected"{/if}>_top</option><br />
<option value="2" {if $processor_params.cancel_url_target == '2'}selected="selected"{/if}>_parent</option><br />
<option value="3" {if $processor_params.cancel_url_target == '3'}selected="selected"{/if}>_self</option><br />
<option value="4" {if $processor_params.cancel_url_target == '4'}selected="selected"{/if}>_blank</option><br />
</select><br />
</div<br />
```<br />
<br />
with this one:<br />
<br />
```php
<br />
{* [mb] *}<br />
<div class="form-field"><br />
<label for="iframe_mode_{$payment_id}">{$lang.iframe_mode}:</label><br />
<select name="payment_data[processor_params][iframe_mode]" id="iframe_mode_{$payment_id}"><br />
<option value="N" {if $processor_params.iframe_mode == 'N'}selected="selected"{/if}>{$lang.disabled}</option><br />
<option value="Y" {if $processor_params.iframe_mode == 'Y'}selected="selected"{/if}>{$lang.enabled}</option><br />
</select><br />
</div><br />
{* [/mb] *}<br />
```<br />
<br />
4. Edit the "skins/CUSTOMER_SKIN_DIR/styles.css" file by additin the following code to the end of the file:<br />
<br />
```php
<br />
/* [mb] */<br />
.payment_method_iframe {<br />
z-index: 1000; <br />
background-color: #C0C0C0; <br />
position: relative; <br />
top:-820px; <br />
left:0px; <br />
height:820px; <br />
width:100%; <br />
filter:alpha(opacity=90); <br />
-moz-opacity: 0.90; <br />
opacity: 0.90;<br />
}<br />
.payment_method_iframe_label {<br />
position: relative; <br />
top:410px; <br />
padding: 10px 10px 10px 10px; <br />
height: 50px;<br />
}<br />
.payment_method_iframe_text {<br />
vertical-align: middle; <br />
text-align:center; <br />
font-weight:bolder; <br />
position:relative; <br />
top: 20px;<br />
}<br />
.payment_method_iframe_box {<br />
height:820px; <br />
overflow:hidden;<br />
}<br />
/* [/mb] */<br />
```<br />
<br />
5. Make a backup copy of the "skins/CUSTOMER_SKIN_DIR/views/checkout/components/steps/step_four.tpl" file and replace this file with the "step_four.tpl" file located in the CS-Cart root directory (it will be there after unpacking the archive at step 1).<br />
<br />
6. Log in to the CS-Cart administration panel.<br />
<br />
7. Clean up the CS-Cart cache by opening the following link in the browser:<br />
<br />
```php
<br />
http://www.your_domain.com/admin.php?cc<br />
```<br />
<br />
where "www.your_domain.com" is the actual domain of your store and "admin.php" is the actual file name of your administrator script (if it was renamed for security reasons).<br />
<br />
8. Open the "Administration" > "Database" page, then click the "Restore" tab. You will see the "t_moneybookers_ewqc.sql" file in the list. Select it and click the "Restore" button.<br />
<br />
9. Open the "Administration" > "Payment methods", click on the "edit" link next to a payment method, then select "Moneybookers Quick Checkout" or "Moneybookers eWallet" in the "Processor" select box. Then click the "Configure" tab. Enable the "iFrame mode" setting there.<br />
<br />
After that the Moneybookers payment gateway will be displayed in the IFRAME on the last checkout page (when the defined payment method is selected).<br />
<br />
This functionality will be added to the next CS-Cart release as well.<br />
<br />
If you have any problems with enabling this feature, please contact our support team via our [URL=http://helpdesk.cs-cart.com]Customer Help Desk[/URL].<br />
<br />
Thank you.<p><a href="127.0.0.1/uploads/monthly_06_2011/post-5-13081580068327.ipb">mb-iframe.zip</a></p>