Osclass Support Forums
Osclass plugin support => Business Profile Plugin => Topic started 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 ?
-
Good News :) :) :)
I solved sitemap & canonical issue myself.
https://in.nearmeads.com/sitemap-companies.xml
-
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');
}
}
-
Finally solved this limitation issue. :)
now sitemap adding all enabled companies in sitemap list.
-
What limitation you mean?
-
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.
-
Well, but home.php is not connected to sitemap
-
But my case solve issue by changing this.
-
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