Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

enable/disable categories vs Google XML Sitemap Feed


pordoeb

Recommended Posts

Hi,

 

i want to integrate the enable/disable categories contrib to work well in the Google XML Sitemap Feed by Chemo.

 

I change the function GenerateCategorySitemap from

		$sql = "SELECT categories_id as cID, date_added, last_modified as last_mod 
			FROM " . TABLE_CATEGORIES . " 
			ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

to

		$sql = "SELECT categories_id as cID, date_added, last_modified as last_mod 
			FROM " . TABLE_CATEGORIES . " where categories_status = '1'
			ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

and it worked well.

 

But now i want to make changes to the function GenerateProductSitemap, not to display products from disabled categories.

I change from

		$sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered 
			FROM " . TABLE_PRODUCTS . " 
			WHERE products_status='1' 
			ORDER BY products_ordered DESC";

to

		$sql = "SELECT p.products_id as pID, p.products_date_added as date_added, p.products_last_modified as last_mod, p.products_ordered 
			FROM " . TABLE_PRODUCTS . " p,  " . TABLE_CATEGORIES . " cd where p.products_status='1' 
			and cd.categories_status = '1'
			ORDER BY p.products_ordered DESC";

but it doesnt work in anyway.

 

Anyone an idea?

lg pordoeb

Link to comment
Share on other sites

Hi,

 

i want to integrate the enable/disable categories contrib to work well in the Google XML Sitemap Feed by Chemo.

 

I change the function GenerateCategorySitemap from

		$sql = "SELECT categories_id as cID, date_added, last_modified as last_mod 
			FROM " . TABLE_CATEGORIES . " 
			ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

to

		$sql = "SELECT categories_id as cID, date_added, last_modified as last_mod 
			FROM " . TABLE_CATEGORIES . " where categories_status = '1'
			ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

and it worked well.

 

But now i want to make changes to the function GenerateProductSitemap, not to display products from disabled categories.

I change from

		$sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered 
			FROM " . TABLE_PRODUCTS . " 
			WHERE products_status='1' 
			ORDER BY products_ordered DESC";

to

		$sql = "SELECT p.products_id as pID, p.products_date_added as date_added, p.products_last_modified as last_mod, p.products_ordered 
			FROM " . TABLE_PRODUCTS . " p,  " . TABLE_CATEGORIES . " cd where p.products_status='1' 
			and cd.categories_status = '1'
			ORDER BY p.products_ordered DESC";

but it doesnt work in anyway.

 

Anyone an idea?

lg pordoeb

 

 

you need to add the relation table product_to_categories in there as that table connects products to their categories.

Treasurer MFC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...