TomatoCart v1.1.4 to v1.1.5 Upgrade Guide!

From TomatoCart Wiki

Jump to: navigation, search

The upgrade guide is a step-by-step tutorial to help users to upgrade TomatoCart v1.1.4 to v1.1.5. If you have not yet updated to v1.1.4, please review its upgrade guide before applying these changes.

Note: Always backup the complete system before you do the upgrade.

Contents

Update Steps

1. Datebase Upgrade

There isn't any modification in database.

2. File Upgrade

Upload and overwrite the complete source files except: the includes/configure.php, ext/piwik/config/config.ini.php and the templates/glass_gray. It needs some manual changes in the template system if you have make some changes to the template files.

3. Template Upgrade

Please following the instructions to upgrade system. It is based on glass_gray template and can be applied to all other v1.1.1 templates.

  • templates/#template#/index.php

    Go to line 334 and add the following code:

                 <?php  
                    if ($osC_Services->isStarted('google_analytics')) { 
                      echo SERVICES_GOOGLE_ANALYTICS_CODE; 
                    } 
                 ?>
               
  • templates/#template#/content/index/category_listing.php

    Go to line 23 and replace the code as follows:

    if (isset($cPath) && strpos($cPath, '_')) { 
    // check to see if there are deeper categories within the current category 
          $category_links = array_reverse($cPath_array); 
          for($i=0, $n=sizeof($category_links); $i<$n; $i++) { 
            $Qcategories = $osC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id'); 
            $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); 
            $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); 
            $Qcategories->bindInt(':parent_id', $category_links[$i]); 
            $Qcategories->bindInt(':language_id', $osC_Language->getID()); 
            $Qcategories->execute(); 
    
            if ($Qcategories->valueInt('total') < 1) { 
              // do nothing, go through the loop 
            } else { 
              $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by sort_order, cd.categories_name'); 
              $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); 
              $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); 
              $Qcategories->bindInt(':parent_id', $category_links[$i]); 
              $Qcategories->bindInt(':language_id', $osC_Language->getID()); 
              $Qcategories->execute(); 
              break; // we've found the deepest category the customer is in 
            } 
          } 
        } else { 
          $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by sort_order, cd.categories_name'); 
          $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); 
          $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); 
          $Qcategories->bindInt(':parent_id', $current_category_id); 
          $Qcategories->bindInt(':language_id', $osC_Language->getID()); 
          $Qcategories->execute(); 
        } 
                  

    With:

    if (isset($cPath) && strpos($cPath, '_')) { 
    // check to see if there are deeper categories within the current category 
          $category_links = array_reverse($cPath_array); 
          for($i=0, $n=sizeof($category_links); $i<$n; $i++) { 
            $Qcategories = $osC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = :language_id'); 
            $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); 
            $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); 
            $Qcategories->bindInt(':parent_id', $category_links[$i]); 
            $Qcategories->bindInt(':language_id', $osC_Language->getID()); 
            $Qcategories->execute(); 
    
            if ($Qcategories->valueInt('total') < 1) { 
              // do nothing, go through the loop 
            } else { 
              $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name'); 
              $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); 
              $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); 
              $Qcategories->bindInt(':parent_id', $category_links[$i]); 
              $Qcategories->bindInt(':language_id', $osC_Language->getID()); 
              $Qcategories->execute(); 
              break; // we've found the deepest category the customer is in 
            } 
          } 
        } else { 
          $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name'); 
          $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES); 
          $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); 
          $Qcategories->bindInt(':parent_id', $current_category_id); 
          $Qcategories->bindInt(':language_id', $osC_Language->getID()); 
          $Qcategories->execute(); 
        } 
                  
  • templates/#template#/content/products/info.php

    Go to line 495 and replace the code as follows:

    new TocVariants({ 
        combVariants: $$('tr.variantCombobox select'), 
        variants: <?php echo $toC_Json->encode($osC_Product->getVariants()); ?>, 
        productsId: <?php echo $osC_Product->getID(); ?>, 
        displayQty:  <?php echo (PRODUCT_INFO_QUANTITY == '1') ? 'true' : 'false'; ?>, 
        lang: { 
          txtInStock: '<?php echo addslashes($osC_Language->get('in_stock'));?>', 
          txtOutOfStock: '<?php echo addslashes($osC_Language->get('out_of_stock')); ?>', 
          txtNotAvailable: '<?php echo addslashes($osC_Language->get('not_available')); ?>', 
          txtTaxText: '<?php echo addslashes($osC_Language->get('including_tax')); ?>' 
        } 
      }); 
                  

    With:

    new TocVariants({ 
        combVariants: $$('tr.variantCombobox select'), 
        variants: <?php echo $toC_Json->encode($osC_Product->getVariants()); ?>, 
        productsId: <?php echo $osC_Product->getID(); ?>, 
        allowCheckout: <?php echo (STOCK_ALLOW_CHECKOUT == '1') ? 'true' : 'false'; ?>, 
        displayQty:  <?php echo (PRODUCT_INFO_QUANTITY == '1') ? 'true' : 'false'; ?>, 
        hasSpecial: <?php echo $osC_Product->hasSpecial() ? 1 : 0; ?>, 
        unitClass: '<?php echo $osC_Product->getUnitClass(); ?>', 
        lang: { 
          txtInStock: '<?php echo addslashes($osC_Language->get('in_stock'));?>', 
          txtOutOfStock: '<?php echo addslashes($osC_Language->get('out_of_stock')); ?>', 
          txtNotAvailable: '<?php echo addslashes($osC_Language->get('not_available')); ?>', 
          txtTaxText: '<?php echo addslashes(( (DISPLAY_PRICE_WITH_TAX == '1') ? $osC_Language->get('including_tax') : '' )); ?>' 
        } 
      });
                  

    Go to line 511 and replace the code as follows:

    var miniImages = $$(".mini"); 
      if (miniImages.length > 0) { 
        miniImages.each(function(img) { 
          img.addEvent('mouseover', function(e) { 
            if ($defined(e)) {e.preventDefault();} 
             
            var oldImg = $$('.mojozoom_imgctr').getElement('img').get('src'); 
            if (oldImg != this.get("large-img")) { 
              img = $$('.mojozoom_imgctr').getElement('img'); 
              img.set('src', this.get("large-img")); 
               
              new Fx.Tween($('product_image'), { 
                 duration: 10, 
                 property: 'opacity' 
              }).start(0).chain(function() { 
                $('product_image').src = this.get("product-info-img"); 
                $('product_image').fade('in'); 
              }.bind(this)); 
            } 
          }); 
        }, this); 
      }
                  

    With:

    var imgElem = $$('.mojozoom_imgctr').getElement('img'); 
      var miniImages = $$(".mini"); 
      if (miniImages.length > 0) { 
        miniImages.each(function(img) { 
          img.addEvent('mouseover', function(e) { 
            if ($defined(e)) {e.preventDefault();} 
    
            var oldImg = imgElem.get('src'); 
            if (oldImg != this.get("large-img")) { 
              img.set('src', this.get("large-img")); 
               
              new Fx.Tween($('product_image'), { 
                 duration: 10, 
                 property: 'opacity' 
              }).start(0).chain(function() { 
                $('product_image').src = this.get("product-info-img"); 
                $('product_image').fade('in'); 
              }.bind(this)); 
            } 
          }); 
        }, this); 
      }
                  
  • templates/#template#/stylesheet.css

    Go to line 284 and replace the code as follows:

    #navigationInner li:hover, #navigationInner li.navVisited:hover { 
      display: block; 
      color: #FFFFFF; 
      text-decoration: none; 
      background: url(images/nav_hover_visited.png) repeat-x left top; 
    }
                  

    With:

    #navigationInner a:hover, #navigationInner a.navVisited:hover { 
      display: block; 
      color: #FFFFFF; 
      text-decoration: none; 
      background: url(images/nav_hover_visited.png) repeat-x left top; 
    }
                  

    Go to line 304 and replace the code as follows:

    #navigationInner li:hover span.navLeftHook { 
      background: url(images/nav_hover_left.png) no-repeat left top; 
      z-index: 10; 
    }
                  

    With:

    #navigationInner a:hover span.navLeftHook { 
      background: url(images/nav_hover_left.png) no-repeat left top; 
      z-index: 10; 
    }
                  

    Go to line 318 and replace the code as follows:

    #navigationInner li:hover span.navRightHook { 
      background: url(images/nav_hover_right.png) no-repeat left top; 
    }
                  

    With:

    #navigationInner a:hover span.navRightHook { 
      background: url(images/nav_hover_right.png) no-repeat left top; 
    }
                  

    Go to line 331 and replace the code as follows:

    #navigationInner ul li:hover span.navHoverDownHook { 
      background: url(images/nav_hover_down_arrow.png) no-repeat left top; 
    }
                  

    With:

    #navigationInner ul a:hover span.navHoverDownHook { 
      background: url(images/nav_hover_down_arrow.png) no-repeat left top; 
    }