TomatoCart v1.1.8.1 to v1.1.8.4.1 Upgrade Guide

The upgrade guide is a step-by-step tutorial to help users to upgrade TomatoCart v1.1.8.1 to v1.1.8.4.1. If you had customized the core code, please don’t apply these changes because the upgrade action may override your modifications. So, it is strongly recommended not to touch the core code. Otherwise, the featured upgrade will be very difficult. For the v2.0, you could freely customized the code because the customized code and core code could be separated in the system framework. This is the key reason why we have to implement the v2.0.

If you are using the v1.1.8 rather than v1.1.8.1, please download the security patch to upgrade to v1.1.8.1.

If you are still using the v1.1.7, please read the TomatoCart v1.1.7 to v1.1.8 Upgrade Guide

Note: Always backup the complete system including the database and files before you do the upgrade.

Upgrade Steps


1. Database Upgrade

Execute the following sql in your database:

Note: if you had changed the table names (prefix) “toc_” with your tables prefix, please replace the following “toc_” prefix with your own prefix. To check prefix, you can open your database and check beginning of all TomatoCart tables. If you did not use prefix, replace with empty.

alter table toc_products_variants_groups add sort_order int(5) NOT NULL default 0 after products_variants_groups_name;
alter table toc_products_variants_values add sort_order int(5) NOT NULL default 0 after products_variants_values_name;
update toc_configuration set use_function='osc_cfg_use_get_encrypted_password', set_function='osc_cfg_set_password_field' where configuration_key='SMTP_PASSWORD';

2. File Upgrade

– If you are using the default glass gray template and didn’t modify any template code, please do the file upgrade as follows:

  1. Download upgrade package from http://www.tomatocart.com/downloads/download-tomatocart.html
  2. Open archive and copy all contents to your TomatoCart directory. You need to override directories and files except the includes/configure.php and ext/piwik/config/config.ini.php if your copy process request confirmation. (Note: if you have modified any core file, this action may override your modifications.)

– If you plan to use the bootstrap template in the v1.1.8.4.1, please do the file upgrade as above. After that, you just need to install the bootstrap template under admin panel > Templates and set it as the default template for your live store.

– If you customized the glass gray template or installed the other template implemented by third-party, you need to do some manual changes according to the following step3 – Template Upgrade.

3. Template Upgrade

Please following the instructions to upgrade template. It is based on glass gray template and can be applied to all other v1.x templates.

templates/#template#/content/index/product_listing.php

– Replace the following code:

if ($Qfilterlist->numberOfRows() > 1) {
echo '
' . $osC_Language->get('filter_show') . ' ';
if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {
echo osc_draw_hidden_field('manufacturers', $_GET['manufacturers']);
$options = array(array('id' => '', 'text' => $osC_Language->get('filter_all_categories')));
} else {
echo osc_draw_hidden_field('cPath', $cPath);
$options = array(array('id' => '', 'text' => $osC_Language->get('filter_all_manufacturers')));
}
//whether the products attributes filter and the category/manufacturer filter is linked
if (defined('PRODUCT_LINK_FILTER') && (PRODUCT_LINK_FILTER == '1')) {
if (isset($_GET['products_attributes']) && is_array($_GET['products_attributes'])) {
foreach($_GET['products_attributes'] as $att_value_id => $att_value) {
echo osc_draw_hidden_field('products_attributes[' . $att_value_id . ']', $att_value);
}
}
}

– With:

if ($Qfilterlist->numberOfRows() > 1) {
//products listing page for specific manufactuer
if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {
$action = osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $_GET['manufacturers']);
//product listing page for specific category
}else {
$action = osc_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath);
}
echo '
' . $osC_Language->get('filter_show') . ' ';
if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {
//pass the manufacturers param as seo is disabled
if (!$osC_Services->isStarted('sefu')) {
echo osc_draw_hidden_field('manufacturers', $_GET['manufacturers']);
}
$options = array(array('id' => '', 'text' => $osC_Language->get('filter_all_categories')));
} else if (isset($_GET['cPath']) && !empty($_GET['cPath'])) {
//pass the cPath param as seo is disabled
if (!$osC_Services->isStarted('sefu')) {
echo osc_draw_hidden_field('cPath', $_GET['cPath']);
}
$options = array(array('id' => '', 'text' => $osC_Language->get('filter_all_manufacturers')));
}
//whether the products attributes filter and the category/manufacturer filter is linked
if (defined('PRODUCT_LINK_FILTER') && (PRODUCT_LINK_FILTER == '1')) {
if (isset($_GET['products_attributes']) && is_array($_GET['products_attributes'])) {
foreach($_GET['products_attributes'] as $att_value_id => $att_value) {
echo osc_draw_hidden_field('products_attributes[' . $att_value_id . ']', $att_value);
}
}
}

templates/#template#/content/products/info.php

– Replace the following code:

echo '' . $osC_Language->get('section_heading_reviews') . '(' . $osC_Reviews->getReviewsCount($osC_Product->getID()) . ')';

– With:

echo '' . $osC_Language->get('section_heading_reviews') . '(' . $osC_Reviews->getTotal($osC_Product->getID()) . ')';

– Replace the following code:

if ($osC_Reviews->getReviewsCount($osC_Product->getID())==0) {

– With:

if ($osC_Reviews->getTotal($osC_Product->getID())==0) {

– Replace the following code:

echo osc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $osC_Product->getID() . '&action=process');

– With:

echo osc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $osC_Product->getID() . '&action=process', 'SSL');

– Replace the following code:

<div class="clearfix captcha">
                  <div class="captcha-image"><?php echo osc_image(osc_href_link(FILENAME_PRODUCTS, 'reviews=show_captcha'), $osC_Language->get('captcha_image_title'), 215, 80, 'id="captcha-code"'); ?></div>
                  <div class="captcha-field clearfix">
                    <div><?php echo osc_link_object(osc_href_link('#'), osc_image('ext/securimage/images/refresh.png', $osC_Language->get('refresh_captcha_image_title')), 'id="refresh-captcha-code"'); ?></div>
                    <p><?php echo $osC_Language->get('enter_captcha_code'); ?></p>
                    <div><?php echo osc_draw_input_field('captcha_code', '', 'size="22"'); ?></div>
                  </div>
                  <script type="text/javascript">
                    $('refresh-captcha-code').addEvent('click', function(e) {
                      e.stop();

                      var reviewsController = '<?php echo osc_href_link(FILENAME_PRODUCTS, 'reviews=show_captcha', 'AUTO', true, false); ?>';
                      var captchaImgSrc = reviewsController + '&' + Math.random();

                      $('captcha-code').setProperty('src', captchaImgSrc);
                    });
                  </script>
                </div>

– With:

<?php
    if ((ACTIVATE_CAPTCHA === '1') && ($osC_Customer->isLoggedOn() === false) ) {
 ?>
                <div class="clearfix captcha">
                  <div class="captcha-image"><?php echo osc_image(osc_href_link(FILENAME_PRODUCTS, 'reviews=show_captcha'), $osC_Language->get('captcha_image_title'), 215, 80, 'id="captcha-code"'); ?></div>
                  <div class="captcha-field clearfix">
                    <div><?php echo osc_link_object(osc_href_link('#'), osc_image('ext/securimage/images/refresh.png', $osC_Language->get('refresh_captcha_image_title')), 'id="refresh-captcha-code"'); ?></div>
                    <p><?php echo $osC_Language->get('enter_captcha_code'); ?></p>
                    <div><?php echo osc_draw_input_field('captcha_code', '', 'size="22"'); ?></div>
                  </div>
                  <script type="text/javascript">
                    $('refresh-captcha-code').addEvent('click', function(e) {
                      e.stop();

                      var reviewsController = '<?php echo osc_href_link(FILENAME_PRODUCTS, 'reviews=show_captcha', 'AUTO', true, false); ?>';
                      var captchaImgSrc = reviewsController + '&' + Math.random();

                      $('captcha-code').setProperty('src', captchaImgSrc);
                    });
                  </script>
                </div>
<?php
  }
?>

templates/#template#/content/products/new.php

– Replace the following code:

echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name')), 'id="productImage' . $Qproducts->value('products_id') . '"');

– With:

echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name')), 'id="img_ac_productsnew_' . $Qproducts->value('products_id') . '"');

templates/#template#/content/products/specials.php

– Replace the following code:

echo '<div style="margin-top: 10px; float:left; width: 33%; text-align: center">' .
                   '<span style="display:block; height: 32px; text-align: center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_id')), $Qspecials->value('products_name')) . '</span>' . 
                   osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_id')), $osC_Image->show($Qspecials->value('image'), $Qspecials->value('products_name'))) . 
                   '<span style="display:block; padding: 3px; text-align: center"><s>' . $osC_Currencies->displayPrice($Qspecials->value('products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</s> <span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qspecials->value('specials_new_products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</span>' .
                   osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'))) .
                 '</div>';

– With:

echo '<div style="margin-top: 10px; float:left; width: 33%; text-align: center">' .
                   '<span style="display:block; height: 32px; text-align: center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_id')), $Qspecials->value('products_name')) . '</span>' . 
                   osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_id')), $osC_Image->show($Qspecials->value('image'), $Qspecials->value('products_name')), 'id="img_ac_specials_'. $Qspecials->value('products_id') . '"') . 
                   '<span style="display:block; padding: 3px; text-align: center"><s>' . $osC_Currencies->displayPrice($Qspecials->value('products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</s> <span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qspecials->value('specials_new_products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</span>' .
                   osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_specials_' . $Qspecials->value('products_id') . '"')) .
                 '</div>';

– Replace the following code:

<span style="float: right;"><?php echo $Qspecials->getBatchPageLinks('specials', 'page'); ?></span>

– With:

<span style="float: right;"><?php echo $Qspecials->getBatchPageLinks('page', 'specials'); ?></span>

templates/#template#/javascript/milkbox/milkbox.js

– Replace the following code:

if(a.rel && a.rel.test(/^milkbox/i) && a.href.split('?')[0].test(/\.(gif|jpg|png)$/i)){

– With:

if(a.rel && a.rel.test(/^milkbox/i) && a.href.split('?')[0].test(/\.(gif|jpeg|jpg|png)$/i)){

templates/#template#/modules/content/upcoming_products.php

– Replace the following code:

<h6><?php echo $osC_Box->getTitle(); ?></h6>

<?php echo $osC_Box->getContent(); ?>

– With:

<div>
  <h6><?php echo $osC_Box->getTitle(); ?></h6>

  <div><?php echo $osC_Box->getContent(); ?></div>
</div>

templates/#template#/stylesheet.css

Add the following code at the bottom of stylesheet.css

/* Pagination */
.pagination {
  margin: 10px 0;
}
.pagination ul {
  display: inline-block;
  margin-bottom: 0;
  margin-left: 0;
}
.pagination ul > li {
  display: inline;
}
.pagination ul > li > a{
  border: 1px solid #EEEEEE;
  color: #333333;
  display: inline-block;
  padding: 4px 10px;
  text-decoration: none;
  margin: 0 3px;
}

.pagination ul > li > span {
  background: #FFFFFF;
  border: 1px solid #3288C2;
  color: #3288C2;
  display: inline-block;
  font-weight: normal;
  padding: 4px 10px;
  text-decoration: none;
}

.pagination ul > li > a:hover, .pagination ul > li > a:focus {
  background-color: #F5F5F5;
}

.listingPageLinks .pagination {float:right;}
.listingPageLinks .totalPages {float:left;}
.listingPageLinks .totalPages {line-height:24px;height:24px}
.listingPageLinks .totalPages {margin: 10px 0;}

After completing the upgrade, please don’t forget to clear all the cache under admin panel > Tools > Cache Control. You could also delete all the cache files in the includes > work directory directly.

Done.

Looking for quality TomatoCart Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , | Posted under TomatoCart | RSS 2.0

Author Spotlight

Jack Yin

Jack Yin

TomatoCart Developer & Co Founder - Arvixe Web Hosting / TomatoCart Community Liaison

Leave a Reply

Your email address will not be published. Required fields are marked *


− 3 = 6

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>