Jump to content

Sitemap inextistant sur 1.4.11


Recommended Posts

Suite mise à jour : je configure le module, puis quand je clique sur "generer" rien. Pas de fichier generé

 

Fatal error: Call to undefined method ShopBackwardModule::getBaseURL() in /home/pointlaser/domains/bluedomain.biz/public_html/modules/gsitemap/gsitemap.php on line 230

Edited by JPSSAU (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 3 months later...

short:

*remember to copy /override/classes/Shop.php to your prestashop path /override/classes/Shop.php*

 

the gsitemap module with modifications needed:

https://mega.co.nz/#!iBoTzIwY!FOUx_RgoVrbQyzwYCbYRL3RWFsIcCU5IhbfMV07onZE

 

 

LONG:

 

 

in prestashop 1.4, there are a couple of problems when you want to use latest modules from:

https://github.com/PrestaShop/PrestaShop-modules

 

1) sometimes  not all files get copied to their places when installing a new module 

(compare manually the git directory and the /modules/ directory

- /modules/gsitemap/backwards-compatibility/* files dont get copied into respective /modules/gsitemap/(...) dirs (.zip loading from github is not parsing the link or smthn)

 

2) files which need to  be placed in /override/classes/ are not copied there!

 

(this is a direct answer for the problem in this topic)

 

for example:

https://github.com/PrestaShop/PrestaShop-modules/tree/master/gsitemap/override/classes

 

 file "Shop.php"  this does not get copied into your servers' path: => /override/classes/Shop.php

 

 

3) sometimes the generated xml files are not seen properly by google webmaster tools or similar. 

 

possible problem: server and .htaccess files security.

 

make sure that when you click on:

 

 

you get generated .xml file there should be a couple of lines directing to other .xml's

 

like that:

 

 

 

 

 

also, in the current git version, in the /modules/gsitemap/gsitemap.php function getContent() should have moved 

the "if" fragment:

/* Backward compatibility */
if (_PS_VERSION_ < 1.5)
{
require(_PS_MODULE_DIR_.'gsitemap/backward_compatibility/backward.php');
}

to top of the function.

 

 

 

so in the result the getContent() function should look like this:

 

public function getContent()
{
/* Backward compatibility */
if (_PS_VERSION_ < 1.5)
{
require(_PS_MODULE_DIR_.'gsitemap/backward_compatibility/backward.php');
}


/* Store the posted parameters and generate a new Google Sitemap files for the current Shop */
if (Tools::isSubmit('SubmitGsitemap'))
{
Configuration::updateValue('GSITEMAP_FREQUENCY', pSQL(Tools::getValue('gsitemap_frequency')));
Configuration::updateValue('GSITEMAP_INDEX_CHECK', '');
Configuration::updateValue('GSITEMAP_CHECK_IMAGE_FILE', pSQL(Tools::getValue('gsitemap_check_image_file')));
$meta = '';
if (Tools::getValue('gsitemap_meta'))
$meta .= implode(', ', Tools::getValue('gsitemap_meta'));
Configuration::updateValue('GSITEMAP_DISABLE_LINKS', $meta);
$this->emptySitemap();
$this->createSitemap();
}
/* if no posted form and the variable [continue] is found in the HTTP request variable keep creating sitemap */
elseif (Tools::getValue('continue'))
$this->createSitemap();






/* Empty the Shop domain cache */
if (method_exists('ShopUrl', 'resetMainDomainCache'))
ShopUrl::resetMainDomainCache();


$this->context->smarty->assign(array(
'gsitemap_form' => './index.php?tab=AdminModules&configure=gsitemap&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module='.$this->tab.'&module_name=gsitemap',
'gsitemap_cron' => _PS_BASE_URL_._MODULE_DIR_.'gsitemap/gsitemap-cron.php?token='.substr(Tools::encrypt('gsitemap/cron'), 0, 10).'&id_shop='.$this->context->shop->id,
'gsitemap_feed_exists' => file_exists(dirname(__FILE__).'/../../index_sitemap.xml'),
'gsitemap_last_export' => Configuration::get('GSITEMAP_LAST_EXPORT'),
'gsitemap_frequency' => Configuration::get('GSITEMAP_FREQUENCY'),
'gsitemap_store_url' => 'http://'.Tools::getShopDomain(false, true).__PS_BASE_URI__,
'gsitemap_links' => Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'gsitemap_sitemap` WHERE id_shop = '.(int)$this->context->shop->id),
'store_metas' => Meta::getMetasByIdLang((int)$this->context->cookie->id_lang),
'gsitemap_disable_metas' => explode(',', Configuration::get('GSITEMAP_DISABLE_LINKS')),
'gsitemap_customer_limit' => array('max_exec_time' => (int)ini_get('max_execution_time'), 'memory_limit' => intval(ini_get('memory_limit'))),
'prestashop_version' => _PS_VERSION_ >= 1.5 ? '1.5' : '1.4',
'prestashop_ssl' => Configuration::get('PS_SSL_ENABLED'),
'gsitemap_check_image_file' => Configuration::get('GSITEMAP_CHECK_IMAGE_FILE'),
'shop' => $this->context->shop
));


return $this->display(__FILE__, 'tpl/configuration.tpl');
}
Edited by devein (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...