Results 1 to 3 of 3

Thread: Related Products Reader - redirect page wrong

  1. #1
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Related Products Reader - redirect page wrong

    I've been using the latest version of Isotope in the ER. I've setup the Related Category upon it's setup to redirect to a page where both list and reader pages are located, e.g.

    Related Categories:
    1. STYLE Portfolio Related Items
    - Product Redirect page: style/portfolio (using folderUrl for aliases)
    2. MAKEUP Portfolio Related Items
    - Product Redirect page: makeup/portfolio

    Then I setup the Product with related products (using the above categories). As usual, I add the Related Products Module. In this module, I don't set any product redirect page. Also, the pages have no redirect pages setup either.

    On Product Reader page:
    alias: style/stylists/duncan-pape (page is style/stylists using folderurl)
    - List Module (inactive, due to url parameter, e.g. reader mode)
    - Product Reader (active, due to url parameter, e.g. reader mode)
    - Product Related Items (config as above)

    So to my logic, the related category's redirect page will be used, but instead, it is not. Its using the current page as the redirect page.

    Am I missing an override option? I'l have to start debugging the related list module to see which redirect is priority.

  2. #2
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Related Products Reader - redirect page wrong

    I've now noticed that the Related Module is calculating an array with the related RedicteIds, but then it's never used anywhere.

    Code:
    if ($objCategories->jumpTo)
    {
      $arrJumpTo = array_fill_keys($ids, $objCategories->jumpTo) + $arrJumpTo;
    }
    This array of jumpIds isn't passed or used anywhere in the calculations. This is obviously a bug, because it should be the fallback for all the product redirects (for each product) if no module jumpTo is set, because the related items, should obviously ignore the current page jumpto.

    I'm looking into how I can hack ModuleIsotopeFrontEnd now to integrate these readerIds.

  3. #3
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Related Products Reader - redirect page wrong

    I've now hacked the ModuleIsotopeRelatedProducts.php with:


    Code:
    ...
    	IsotopeFrontend::setReaderIds($arrJumpTo); // added 
    	return IsotopeFrontend::getProducts($arrIds, IsotopeFrontend::getReaderPageId(null, $this->iso_reader_jumpTo));
    }
    Then I added the function to capture the readerIds in a variable (called above)

    Code:
    class IsotopeFrontend extends Frontend
    {
    ...
    	protected static $arrReaderIds = array(); // added to the top
    ...
    	public static function getProducts($objProductData, $intReaderPage=0, $blnCheckAvailability=true, array $arrFilters=array(), array $arrSorting=array())
    ...
    		while ($objProductData->next())
    		{
    			// added the 4 lines below to override the related reader pageids
    			if (self::$arrReaderIds[$objProductData->id])
    			{
    				$intReaderPage = self::$arrReaderIds[$objProductData->id];
    			}
    
    			$objProduct = IsotopeFrontend::getProduct($objProductData, $intReaderPage, $blnCheckAvailability);
    
    			if ($objProduct !== null)
    			{
    				$arrProducts[$objProductData->id] = $objProduct;
    			}
    		}
    ...
    }
    This code may not be perfect...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •