*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Business Profile - companies page sitemap
« on: July 14, 2020, 03:44:03 PM »
business profile have 25+ company profiles. but its not adding in any sitemap like blog plugin or osclass seo plugin
 
how to generate sitemap for company profiles ?

Marked as best answer by ajit.sahane on July 16, 2020, 09:58:59 AM
*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Business Profile - companies page sitemap
« Reply #1 on: July 16, 2020, 09:58:48 AM »
Good News :) :) :)   

I solved sitemap & canonical issue myself.

https://in.nearmeads.com/sitemap-companies.xml

*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Business Profile - companies page sitemap
« Reply #2 on: July 16, 2020, 02:19:30 PM »
Again 1 issue...

sitemap generated but only 24 companies adding 2nd page or total companies not adding .. why ..?

code check pls -

function bpr_generate_sitemap() {
  $start_time = microtime(true);

  //$count_sellers = ModelBPR::newInstance()->countSellers(1);
  //$per_page = (bpr_param('comp_per_page') > 0 ? bpr_param('comp_per_page') : 100);

  //$current_page = Params::getParam('iPage');
  //$pattern = Params::getParam('bpWord');
  //$city = Params::getParam('bpCity');
  //$category = Params::getParam('bpCategory');

  $categories = ModelBPR::newInstance()->getSearchCategories();
  $cities = ModelBPR::newInstance()->getSearchCities();

  //$limit = array($per_page, $current_page);
  $sellers = ModelBPR::newInstance()->getSellers(); 


  $locales = osc_get_locales();

  $filename = osc_base_path() . 'sitemap-companies.xml';
  @unlink($filename);
 
  $start_xml = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL . '<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
  file_put_contents($filename, $start_xml);


  // INDEX
  bpr_sitemap_add_url(osc_route_url('bpr-list'), date('Y-m-d'), 'always');


  // ADD Companies
  if(count($sellers) > 0) {
    foreach($sellers as $seller) {
      bpr_sitemap_add_url(osc_route_url('bpr-seller', array('identifier' => $seller['s_identifier'])), date('Y-m-d'), 'weekly');
    }
  }
 

*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Business Profile - companies page sitemap
« Reply #3 on: July 16, 2020, 03:20:27 PM »
Finally solved this limitation issue. :)

now sitemap adding all enabled companies in sitemap list.


*

MB Themes

Re: Business Profile - companies page sitemap
« Reply #4 on: July 16, 2020, 07:51:16 PM »
What limitation you mean?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Business Profile - companies page sitemap
« Reply #5 on: July 17, 2020, 08:39:13 AM »
sitemap adding only 24 companies not all enabled.

If total companies 45 then sitemap add only 1st page 24

this limitation -

home.php -  24  value changed to 500  & now all companies add in sitemap list.

*

MB Themes

Re: Business Profile - companies page sitemap
« Reply #6 on: July 18, 2020, 10:18:18 AM »
Well, but home.php is not connected to sitemap
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Business Profile - companies page sitemap
« Reply #7 on: July 18, 2020, 11:48:17 AM »
But my case solve issue by changing this.

*

Osclasser

  • ***
  • 25 posts
Re: Business Profile - companies page sitemap
« Reply #8 on: July 20, 2020, 03:15:26 PM »
Again 1 issue...

sitemap generated but only 24 companies adding 2nd page or total companies not adding .. why ..?

code check pls -

function bpr_generate_sitemap() {
  $start_time = microtime(true);

  //$count_sellers = ModelBPR::newInstance()->countSellers(1);
  //$per_page = (bpr_param('comp_per_page') > 0 ? bpr_param('comp_per_page') : 100);

  //$current_page = Params::getParam('iPage');
  //$pattern = Params::getParam('bpWord');
  //$city = Params::getParam('bpCity');
  //$category = Params::getParam('bpCategory');

  $categories = ModelBPR::newInstance()->getSearchCategories();
  $cities = ModelBPR::newInstance()->getSearchCities();

  //$limit = array($per_page, $current_page);
  $sellers = ModelBPR::newInstance()->getSellers(); 


  $locales = osc_get_locales();

  $filename = osc_base_path() . 'sitemap-companies.xml';
  @unlink($filename);
 
  $start_xml = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL . '<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
  file_put_contents($filename, $start_xml);


  // INDEX
  bpr_sitemap_add_url(osc_route_url('bpr-list'), date('Y-m-d'), 'always');


  // ADD Companies
  if(count($sellers) > 0) {
    foreach($sellers as $seller) {
      bpr_sitemap_add_url(osc_route_url('bpr-seller', array('identifier' => $seller['s_identifier'])), date('Y-m-d'), 'weekly');
    }
  }
 

i added it in function why it not work bro