Osclass Support Forums

Osclass plugin support => Business Profile Plugin => Topic started by: Ajit Sahane on July 14, 2020, 03:44:03 PM

Title: Business Profile - companies page sitemap
Post by: Ajit Sahane 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 ?
Title: Re: Business Profile - companies page sitemap
Post by: Ajit Sahane on July 16, 2020, 09:58:48 AM
Good News :) :) :)   

I solved sitemap & canonical issue myself.

https://in.nearmeads.com/sitemap-companies.xml
Title: Re: Business Profile - companies page sitemap
Post by: Ajit Sahane 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');
    }
  }
 
Title: Re: Business Profile - companies page sitemap
Post by: Ajit Sahane on July 16, 2020, 03:20:27 PM
Finally solved this limitation issue. :)

now sitemap adding all enabled companies in sitemap list.

Title: Re: Business Profile - companies page sitemap
Post by: MB Themes on July 16, 2020, 07:51:16 PM
What limitation you mean?
Title: Re: Business Profile - companies page sitemap
Post by: Ajit Sahane 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.
Title: Re: Business Profile - companies page sitemap
Post by: MB Themes on July 18, 2020, 10:18:18 AM
Well, but home.php is not connected to sitemap
Title: Re: Business Profile - companies page sitemap
Post by: Ajit Sahane on July 18, 2020, 11:48:17 AM
But my case solve issue by changing this.
Title: Re: Business Profile - companies page sitemap
Post by: Osclasser 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