Home Documentation PAPs Installation (Premium Version) Basic Product Attribute Pictures Installation (OpenCart)
Basic Product Attribute Pictures Installation (OpenCart)

Fresh Installation


Step 1 - Apart from the 'NOT_FOR_UPLOAD' folder, copy all the files and folders (even if some are empty) from the distribution zip file to their respective places in your Open Cart store.

NOTE: You should only upload the admin-side language file which applies to your store's admin component language.

NOTE: The default PAPs directory structure is for Open Cart v1.5.x. If you are using Open Cart v1.4.x, please make the following changes:

In the following folders:

admin/view/template/catalog

and

catalog/view

rename the 'paps' folder to 'paps_oc_1.5.x' and rename the 'paps_oc_1.4.x' folder to 'paps'.


Step 2 - Backup your database, and then run the code in the file NOT_FOR_UPLOAD/sql/paps_v7.0.sql using your favorite database interface program.

REMEMBER: do not add any database table prefixes to the PAPs database table names.

IMPORTANT - It is strongly recommended that before proceeding with the next step, you should upload your full PAPs license key file to the web root directory of your online store otherwise the code will generate error messages in your product pages and PAPs admin page.


Step 3 - You now need to edit some files in your existing Open Cart installation:

i) Open the file: admin/controller/common/header.php

BELOW this line (OpenCart 1.4.x): $this->data['title'] = $this->document->title;

OR

BELOW this line (OpenCart 1.5.x): $this->data['title'] = $this->document->getTitle();

add the following lines:

//BOF PAPs
$this->data['text_paps'] = $this->language->get('text_paps');
$token='';
if(isset($this->session->data['token']))$token= '&token=' . $this->session->data['token'];
$this->data['paps'] = HTTPS_SERVER . 'index.php?route=catalog/paps' . $token;
//EOF PAPs


ii) Open the file: admin/language/english/common/header.php

before the final ?> add the following:

$_['text_paps'] = 'Product Attribute Pictures';//PAPs

Repeat this for any corresponding language files in the admin/language/ directory.

iii) Open the file: admin/view/template/common/header.tpl

on line 10 (or anywhere inside the 'head' HTML tag), add the following: <link rel="stylesheet" href="/view/template/catalog/paps/includes/paps.css" type="text/css">

around line 78 BELOW the line <li><a href="/<?php echo $information; ?>"><?php echo $text_information; ?></a></li>

add the following: <li><a href="/<?php echo $paps; ?>"><?php echo $text_paps; ?></a></li>

iv) Open the file: catalog/view/theme/YOUR_TEMPLATE_NAME/template/checkout/cart.tpl

Find this line (OpenCart 1.4.x): <td align="center"><a href="/<?php echo str_replace('&', '& amp;', $product['href']); ?>"><img src="/<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></td>

OR

Find this line (OpenCart 1.5.x): <td class="image"><?php if ($product['thumb']) { ?> <a href="/<?php echo $product['href']; ?>"><img src="/<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" /></a> <?php } ?></td>

and REPLACE it with this:

<td align="center">
<?php
//BOF Product Attribute Pictures
$paps_thumb_width = '75px';
require('catalog/view/paps/includes/modules/paps_layout/paps4cart.php');
//EOF Product Attribute Pictures
?>
</td>


NOTE: the value assigned to '$paps_thumb_width' above will determine the size of PAPs thumbnails associated with product option selections made in the product page as they will appear in the shopping cart page if you set 'Show PAPs in Cart' to 'Yes' in the PAPs admin page.

v) Open the file: catalog/view/theme/YOUR_TEMPLATE_NAME/template/product/product.tpl

Find this line: <?php if ($options) { ?> (on OpenCart 1.5.x this is on line 56)

and immediately ABOVE it add the following:

<?php
//BOF Product Attribute Pictures
require_once('catalog/view/paps/includes/modules/paps_layout/includes/classes/paps_delegate.php');
$paps_delegate = new paps_delegate($product_id, $this->config->get('config_language_id'));
//EOF Product Attribute Pictures
?>


Find this line: <?php foreach ($options as $option) { ?> (on OpenCart 1.5.x this is originally on line 60)

and immediately BELOW it add the following:

<?php
//BOF Product Attribute Pictures
if(!$paps_delegate->allowAttributeSelection($option['option_id'])){
//EOF Product Attribute Pictures
?>


BOF FOR OPENCART v1.4.x:

Find these lines: <?php } ?>
</table>
</div>
<?php } ?>
<?php if ($display_price) { ?>


and immediately ABOVE them add the following:

<?php
//BOF Product Attribute Pictures
}else{
?>
<tr>
<td>
Select '<b><?php echo $option['name']; ?></b>' option below.
<input id="selattr<?php echo $option['option_id']; ?>" type="hidden" name ="option[<?php echo $option['option_id']; ?>]" value="<?php echo $option['option_value'][0]['option_value_id']; ?>"></td>
</tr>
<?php
}
//EOF Product Attribute Pictures
?>


EOF FOR OPENCART v1.4.x:

BOF FOR OPENCART v1.5.x:

Find these lines:
<?php } ?>
</div>
<?php } ?>
<div class="cart">


and immediately ABOVE them add the following:


<?php
//BOF Product Attribute Pictures
}else{
?>
<div>
Select '<b><?php echo $option['name']; ?></b>' option below.
<input id="selattr<?php echo $paps_delegate->getOCid($option['option_id']); ?>" type="hidden" name ="option[<?php echo $paps_delegate->getOCid($option['option_id']); ?>]" value="<?php echo $paps_delegate->getOCvid($option['option_value'][0]['option_value_id']); ?>">
</div>
<?php
}
//EOF Product Attribute Pictures
?>


EOF FOR OPENCART v1.5.x:



NOTE - the following code from the lines above: Select '<b><?php echo $option['name']; ?></b>' option below. will appear in the default Open Cart attributes box instead of the native dropdown box to instruct users to make attribute selections via PAPs images if attribute selection via PAPs is enabled in PAPs admin. You can change the text/language used here as required.

Find this line (for OpenCart 1.4.x): <div class="tabs">

OR

Find this line (for OpenCart 1.5.x): <div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>

and immediately ABOVE it add the following:

<?php //BOF Product Attribute Pictures ?>
<div><table><?php include_once('catalog/view/paps/includes/modules/paps.php'); ?></table></div>
<?php //EOF Product Attribute Pictures ?>


IMPORTANT - The code above determines the position of the PAPs display in the product page. The default positioning is just above the tabbed information area but you can experiment with putting it in different places. The ultimate look and feel of the PAPs display area will also depend on your selected settings in PAPs admin, e.g. the position of the thumbnails relative to the enlarged (selected) picture etc. NOTE - If you want to enable automatic price updating and/or the 'detach from enlarged image' thumbnails position in your product info page, please see the Optional Installation Steps section.


Step 4 - Ensure the following folders are fully writeable:

image/paps
image/paps/linked
image/paps/fonts
image/paps/swatch_enl
image/paps/swatch_enl/tmp
image/paps/tmp



IMPORTANT: If you get a white/blank page when trying to access the PAPs admin panel then the Ioncube Loader required to run PAPs has not been properly installed on your server. Please go to http://[yourdomainname]/ioncube/loader-wizard.php for details on how to solve this issue.

Once you have your installation running properly, please delete the loader-wizard.php file for security reasons.

Installation is now complete.

 
Share

Copyright © 2012 Product Attribute Pictures. All Rights Reserved.