Max283 Posted December 25, 2010 Share Posted December 25, 2010 me gustaria sabe como puedo move las novedare de producto a pagina central, y que salga todo en imagenes, ejemplo,como Productos destacados en la pagina central, pero como Novedades de mes Link to comment Share on other sites More sharing options...
4webs.es Posted December 25, 2010 Share Posted December 25, 2010 creo entender que lo que quieres hacer es un bloque de novedades en lugar de productos destacados, tendrás que editar el modulo featured products y hacer que aparezcan ahí las novedades.. Link to comment Share on other sites More sharing options...
Max283 Posted December 26, 2010 Author Share Posted December 26, 2010 Holay como lo edito?, pongo en modulo homefeatured, y edito todo los phps a newproducts? Link to comment Share on other sites More sharing options...
Caspian Posted January 19, 2011 Share Posted January 19, 2011 Yo también quiero hacer lo mismo, prefiero que aparezcan los nuevos productos conforme se van agregando, pero no se cómo editarlo. ¿Alguien sabe qué es lo que hay que cambiar?Gracias. Link to comment Share on other sites More sharing options...
tamu secreto Posted January 19, 2011 Share Posted January 19, 2011 Para hace eso deben modificar los Hook(ganchos) primero deben desintalar el modulo en cuestion luego editar los parametros de instalacion de tal manera que el registerHook les quede en homeen su caso deben editar el modulo blocknewproducts/blocknewproducts.php y dejarlo ma o meno asi :version 1.3.x <?php if (!defined('_CAN_LOAD_FILES_')) exit; class BlockNewProducts extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'blocknewproducts'; $this->tab = 'Blocks'; $this->version = 0.9; parent::__construct(); $this->displayName = $this->l('New products block'); $this->description = $this->l('Displays a block featuring newly added products'); } /* function install() { if (parent::install() == false OR $this->registerHook('rightColumn') == false OR Configuration::updateValue('NEW_PRODUCTS_NBR', 5) == false) return false; return true; }*/ function install() { if (!Configuration::updateValue('NEW_PRODUCTS_NBR', 5) OR !parent::install() OR !$this->registerHook('home')) return false; return true; } public function getContent() { $output = ''.$this->displayName.''; if (Tools::isSubmit('submitBlockNewProducts')) { if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr)) $output .= ''.$this->l('You should fill the "products displayed" field').''; elseif (intval($productNbr) == 0) $output .= ''.$this->l('Invalid number.').''; else { Configuration::updateValue('NEW_PRODUCTS_NBR', intval($productNbr)); $output .= 'l('Confirmation').'" />'.$this->l('Settings updated').''; } } return $output.$this->displayForm(); } public function displayForm() { $output = ' <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> _path.'logo.gif" alt="" title="" />'.$this->l('Settings').' '.$this->l('Products displayed').' <input type="text" name="productNbr" value="'.intval(Configuration::get('NEW_PRODUCTS_NBR')).'" /> '.$this->l('Set the number of products to be displayed in this block').' <input type="submit" name="submitBlockNewProducts" value="'.$this->l('Save').'" class="button" /> </form>'; return $output; } /*function hookRightColumn($params) { global $smarty; $newProducts = Product::getNewProducts(intval($params['cookie']->id_lang), 0, intval(Configuration::get('NEW_PRODUCTS_NBR'))); $smarty->assign(array('new_products' => $newProducts, 'mediumSize' => Image::getSize('medium'))); return $this->display(__FILE__, 'blocknewproducts.tpl'); }*/ /* function hookLeftColumn($params) { return $this->hookRightColumn($params); }*/ function hookHome($params) { global $smarty; $newProducts = Product::getNewProducts(intval($params['cookie']->id_lang), 0, intval(Configuration::get('NEW_PRODUCTS_NBR'))); $smarty->assign(array('new_products' => $newProducts, 'mediumSize' => Image::getSize('home'))); return $this->display(__FILE__, 'blocknewproducts.tpl'); } } ?> para otra versiones de prestas quiten esto if (!defined('_CAN_LOAD_FILES_')) exit; saludos!! Link to comment Share on other sites More sharing options...
CPDA Posted April 12, 2011 Share Posted April 12, 2011 Hola, tengo la misma necesidad de colocar el modulo de novedades en la home, estoy bajo la version 1.3.7 y al copiar este codigo e irme al backoffice para instalar el modulo me sale el siguiente error: Error de interpretción en módulo(s) ->blocknewproducts, teneis idea de porque? Link to comment Share on other sites More sharing options...
CPDA Posted April 13, 2011 Share Posted April 13, 2011 <?php if (!defined('_CAN_LOAD_FILES_')) exit; class BlockNewProducts extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'blocknewproducts'; $this->tab = 'Blocks'; $this->version = 0.9; parent::__construct(); $this->displayName = $this->l('New products block'); $this->description = $this->l('Displays a block featuring newly added products'); } function install() { if (!Configuration::updateValue('NEW_PRODUCTS_NBR', 5) OR !parent::install() OR !$this->registerHook('home')) return false; return true; } public function getContent() { $output = ''.$this->displayName.''; if (Tools::isSubmit('submitBlockNewProducts')) { if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr)) $output .= ''.$this->l('You should fill the "products displayed" field').''; elseif (intval($productNbr) == 0) $output .= ''.$this->l('Invalid number.').''; else { Configuration::updateValue('NEW_PRODUCTS_NBR', intval($productNbr)); $output .= 'l('Confirmation').'" />'.$this->l('Settings updated').''; } } return $output.$this->displayForm(); } public function displayForm() { $output = ' <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> _path.'logo.gif" alt="" title="" />'.$this->l('Settings').' '.$this->l('Products displayed').' <input type="text" name="productNbr" value="'.intval(Configuration::get('NEW_PRODUCTS_NBR')).'" /> '.$this->l('Set the number of products to be displayed in this block').' <input type="submit" name="submitBlockNewProducts" value="'.$this->l('Save').'" class="button" /> </form>'; return $output; } function hookRightColumn($params) { global $smarty; $newProducts = Product::getNewProducts(intval($params['cookie']->id_lang), 0, intval(Configuration::get('NEW_PRODUCTS_NBR'))); $smarty->assign(array('new_products' => $newProducts, 'mediumSize' => Image::getSize('medium'))); return $this->display(__FILE__, 'blocknewproducts.tpl'); } function hookLeftColumn($params) { return $this->hookRightColumn($params); } function hookHome($params) { return $this->hookRightColumn($params); } } ?> Asi me funciona correctamente. Link to comment Share on other sites More sharing options...
Recommended Posts