You are here:  » Related products

Support Forum



Related products

Submitted by wilkins on Wed, 2011-06-22 11:40 in

hi David

I am looking to include related products from the company, category and brand on the product page, looked through forum, there was a similar request, however it was for 2009, tried the line numbers were different and got a lot of error messages.

Is there an updated version that will work on the new version of PT.

thanks

Brent

Submitted by support on Wed, 2011-06-22 11:51

Hi Brent,

Related Products by default includes category,look for the following code beginning at line 84:

      if ($product["products"][0]["category"])
      {
        $where .= "category = '".database_safe($product["products"][0]["category"])."' AND ";
      }

To extend this to merchant and brand, REPLACE the above with:

      $where .= "( merchant = '".database_safe($product["products"][0]["category"])."' ";
      if ($product["products"][0]["category"])
      {
        $where .= " OR category = '".database_safe($product["products"][0]["category"])."' ";
      }
      if ($product["products"][0]["brand"])
      {
        $where .= " OR brand = '".database_safe($product["products"][0]["brand"])."' ";
      }
      $where .= ") AND ";

Hope this helps!

Cheers,
David.
--
PriceTapestry.com