View Full Version : I have lost some functionality with upgrade can anyone help?
HappyChristmas
29-10-09, 12:30
Hi,
I wonder if i can pick a few brains. I recently updated www.happychristmas.com with the new ShopWindow software (V3).
With a little help from AW I got it working however the new version is missing certain product and search info. In more detail...
The product information text has disappeared from the product list pages
&
The product search bar at the top of the product list page is now missing key fields like categories and price brackets which help users drill down.
click here for examples... http://www.happychristmas.com/Shopping/productlist.php?rb=4-235
As you can see from the results 208k returns with no way of narrowing the search is not great!
Has anyone else experienced this? Does anyone know how to get this stuff back?
Please help me out.
Thanks,
Richard
Hey,
I could be way off the mark here but I read your post as if you are looking for the refine by functionality on the productlist page (category, price, merchant and brand).
If so, these can be turned on an off in the constants.inc.php. They are by default set to false.
Cheers
HappyChristmas
30-10-09, 11:09
Nope all set to true...
define('REFINE_BRAND', true);
define('REFINE_PRICE', true);
define('REFINE_CATEGORY', true);
define('REFINE_MERCHANT', true);
here is the code from the product_display_list.php could there be a problem there?
<?php
/**
*
* ShopWindow Toolset
*
* Copyright (C) 2008 Digital Window Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
require_once(HOME_PATH.'classes'.DIRECTORY_SEPARAT OR.'class.shopcore.php');
require_once(HOME_PATH.'classes'.DIRECTORY_SEPARAT OR.'class.smarty_sw.php');
// init ShopCore
if ( !is_object($oShopCore) ) {
$oShopCore = new shopcore();
}
// init Smarty
if ( !is_object($oSmarty) ) {
$oSmarty= new smarty_sw();
}
// load env vars into params obj
$oShopCore->syncApiParams($oProductDisplayListParams);
if ( ADULT_CONTENT === false ) {
$oProductDisplayListParams->bAdult = false;
}
# Get the products
$aProducts = $oShopCore->oApiProductList->getProductList($oProductDisplayListParams);
# Get additional API objects
$oMerchantParams = new stdClass();
$oCategoryParams = new stdClass();
if ( is_array($aProducts) ) {
// Loop around products adding merchant and category id to our param objects //
foreach ($aProducts as $oProduct) {
$oMerchantParams->aMerchantIds[] = $oProduct->iMerchantId;
$oCategoryParams->aCategoryIds[] = $oProduct->iCategoryId;
}
}
// get merchants & categories
$aMerchants = $oShopCore->oApiMerchant->getMerchant($oMerchantParams);
$aCategories = $oShopCore->oApiCategory->getCategory($oCategoryParams);
if ( is_array($aCategories) ) {
// add links to objects
foreach ( $aCategories as $oCategory ) {
$oCategory->sLink = $oShopCore->buildLink(P_PRODUCTLIST, '', '', $oCategory->iId);
}
}
if ( is_array($aProducts) ) {
foreach( $aProducts as $oProduct ) {
$oProduct->sLink = $oShopCore->buildLink(P_PRODUCT, $oProduct->iId);
$oProduct->sBuyLink = $oShopCore->buildLink(P_GOTO, $oProduct->iId, $oProduct->iMerchantId);
// assign objects
$oProduct->oMerchant = $aMerchants[$oProduct->iMerchantId];
$oProduct->oCategory = $aCategories[$oProduct->iCategoryId];
}
}
$oShopCore->buildBreadCrumb();
# SMARTY ASSIGN
$oSmarty->assign('sBreadCrumbText', $oShopCore->getBreadCrumb(false));
$oSmarty->assign('sBreadCrumbHtml', $oShopCore->getBreadCrumb());
$oSmarty->assign('aProducts', $aProducts);
?>
This is the standard out of the box file vor v3. Notice that you are missing the refine building. Hopefully that will help.
Cheers
<?php
/**
*
* ShopWindow Toolset
*
* Copyright (C) 2009 Digital Window Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
require_once(HOME_PATH.'classes'.DIRECTORY_SEPARAT OR.'class.shopcore.php');
require_once(HOME_PATH.'classes'.DIRECTORY_SEPARAT OR.'class.smarty_sw.php');
// init ShopCore
if ( !isset($oShopCore) || !is_object($oShopCore) ) {
$oShopCore = new shopcore();
}
// init Smarty
if ( !is_object($oSmarty) ) {
$oSmarty= new smarty_sw();
}
// load env vars into params obj
$oShopCore->syncApiParams($oProductDisplayListParams);
$oProductDisplayListParams->aColumnsToReturn = array( 'sAwImageUrl','sDescription', 'sPromotion' );
$oProductDisplayListParams->sSortMode = API_SORT_MODE;
// Build list of refine bys to use //
$aEnabledRefineBys = array();
if (REFINE_PRICE) {
$aEnabledRefineBys[] = 1;
}
if (REFINE_BRAND) {
$aEnabledRefineBys[] = 2;
}
if (REFINE_MERCHANT) {
$aEnabledRefineBys[] = 3;
}
if (REFINE_CATEGORY) {
$aEnabledRefineBys[] = 4;
}
$oProductDisplayListParams->iEnabledRefineBy = $aEnabledRefineBys;
# Get the products
$aProducts = $oShopCore->oApiProductList->getProductList($oProductDisplayListParams);
# Get additional API objects
$oMerchantParams = new stdClass();
$oCategoryParams = new stdClass();
if ( is_array($aProducts) ) {
// Loop around products adding merchant and category id to our param objects //
foreach ($aProducts as $oProduct) {
$oMerchantParams->aMerchantIds[] = $oProduct->iMerchantId;
$oCategoryParams->aCategoryIds[] = $oProduct->iCategoryId;
}
}
// get merchants & categories
$aMerchants = $oShopCore->oApiMerchant->getMerchant($oMerchantParams);
$aCategories = $oShopCore->oApiCategory->getCategory($oCategoryParams);
if ( is_array($aCategories) ) {
// add links to objects
foreach ( $aCategories as $oCategory ) {
$oCategory->sLink = $oShopCore->buildLink(P_PRODUCTLIST, '', '', $oCategory->iId);
}
}
if ( is_array($aProducts) ) {
foreach( $aProducts as $oProduct ) {
$oProduct->sLink = $oShopCore->buildLink(P_PRODUCT, $oProduct->iId);
$oProduct->sBuyLink = $oShopCore->buildLink(P_GOTO, $oProduct->iId, $oProduct->iMerchantId);
// assign objects
$oProduct->oMerchant = $aMerchants[$oProduct->iMerchantId];
$oProduct->oCategory = $aCategories[$oProduct->iCategoryId];
}
}
$oShopCore->buildBreadCrumb();
# SMARTY ASSIGN
$oSmarty->assign('sBreadCrumbText', $oShopCore->getBreadCrumb(false));
$oSmarty->assign('sBreadCrumbHtml', $oShopCore->getBreadCrumb());
$oSmarty->assign('aProducts', $aProducts);
?>
HappyChristmas
30-10-09, 13:02
Thanks George, that appears to have done the trick.
Brilliant job!
Good stuff. Happy to help.