X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Google XML Sitemap for XC SEO (https://forum.x-cart.com/showthread.php?t=37135)

charlesw 08-11-2008 10:50 AM

Re: Google XML Sitemap for XC SEO
 
The XC-SEO category fix is awesome and saves time on xml updates

I noticed that product links appear for every category they are assigned to, i.e. if a product is assigned to two categories then there will be two identical links in the xml output twice

Any ideas on how to fix this in the php script, i.e. generate only one link per product irrespective of how many categories it is assigned to?

Thanks, Charles

carlisleglass 08-12-2008 02:46 AM

Re: Google XML Sitemap for XC SEO
 
Add
Code:

GROUP BY p.productid
after
Code:

p.forsale="Y"
to make it look like
Code:

p.forsale="Y" GROUP BY p.productid

Basically put it where the LIMIT BY was.

i.e.
Code:

$query = '
        SELECT
                p.productid,
                p.product,
                pc.categoryid
        FROM
                ' . $sql_tbl['products'] . ' p
                INNER JOIN ' . $sql_tbl['products_categories'] . ' pc ON (p.productid = pc.productid)
        WHERE
                p.forsale="Y" GROUP BY p.productid
                ';



All times are GMT -8. The time now is 09:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.