Jump to content

dans les categories de produit, nombre de miniatures limité à 3. Comment en attribuer 4 ?


Recommended Posts

Bon j'ai eu du mal à trouver mais pour ma part sa fonctionne.

 

dans le module blockcategories ligne 169 :

	public function hookDisplayBackOfficeCategory($params)
	{
		$category = new Category((int)Tools::getValue('id_category'));
		$files   = array();

		if ($category->level_depth != 2)
			return;

		for ($i=0;$i<3;$i++)
		{
			if (file_exists(_PS_CAT_IMG_DIR_.(int)$category->id.'-'.$i.'_thumb.jpg'))
			{
				$files[$i]['type'] = HelperImageUploader::TYPE_IMAGE;
				$files[$i]['image'] = ImageManager::thumbnail(_PS_CAT_IMG_DIR_.(int)$category->id.'-'.$i.'_thumb.jpg', $this->context->controller->table.'_'.(int)$category->id.'-'.$i.'_thumb.jpg', 100, 'jpg', true, true);
				$files[$i]['delete_url'] = Context::getContext()->link->getAdminLink('AdminBlockCategories').'&deleteThumb='.$i.'&id_category='.(int)$category->id;
			}
		}

		$helper = new HelperImageUploader();
		$helper->setMultiple(true)->setUseAjax(true)->setName('thumbnail')->setFiles($files)->setMaxFiles(4)->setUrl(
			Context::getContext()->link->getAdminLink('AdminBlockCategories').'&ajax=1&id_category='.$category->id
			.'&action=uploadThumbnailImages');
		$this->smarty->assign('helper', $helper->render());
		return $this->display(__FILE__, 'views/blockcategories_admin.tpl');
	}
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...