Jump to content

cicciotargatona

Members
  • Posts

    29
  • Joined

  • Last visited

1 Follower

Contact Methods

Profile Information

  • Location
    napoli
  • Activity
    Freelancer

cicciotargatona's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

5

Reputation

  1. yeah 400 errors are become 106 Errors, 11 warning(s) again again
  2. what i have to change? I disactive apache multiviews?
  3. Hello people of prestashop! I try to have for one time in my life before die a markup validation on http://validator.w3.org/ someone crazy can help me? http://validator.w3.org/check?uri=luxelumi.com&charset=%28detect+automatically%29&doctype=Inline&group=0 (for see all errors CSS in my website) In particular ther is an common mistake : /luxelumi.com/index.php?id_category=96&controller=category&id_lang=1" title="I… & did not start a character reference. (& probably should have been escaped as &.) So i have just to change the ''&'' with ''&" But what .php i have to change for that is apply at all pages and resolve any problems? Thank you! My prestashop: 1.5.6.2
  4. SOLVED $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), "position",null,false,true,true,($nb ? $nb : 8));
  5. vekia now function with the spaces between lines, but show only one prodcut, not 16
  6. <?php if (!defined('_PS_VERSION_')) exit; class AddHomeFeatured extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'addhomefeatured'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Custom'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Add Featured Products on the homepage'); $this->description = $this->l('Displays Featured Products in the middle of your homepage.'); } function install() { if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) || !parent::install() || !$this->registerHook('displayHome') || !$this->registerHook('displayHeader')) return false; return true; } public function getContent() { $output = '<h2>'.$this->displayName.'</h2>'; if (Tools::isSubmit('submitAddHomeFeatured')) { $nbr = (int)(Tools::getValue('nbr')); if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr)) $errors[] = $this->l('Invalid number of products'); else Configuration::updateValue('HOME_FEATURED_NBR', (int)($nbr)); if (isset($errors) AND sizeof($errors)) $output .= $this->displayError(implode('<br />', $errors)); else $output .= $this->displayConfirmation($this->l('Settings updated')); } return $output.$this->displayForm(); } public function displayForm() { $output = ' <div class="clearfix"></div> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post"> <fieldset><legend>'.$this->l('Settings').'</legend> <p>'.$this->l('In order to add products to your homepage, just add them to the "home" category.').'</p><br /> <label>'.$this->l('Number of products displayed').'</label> <div class="margin-form"> <input type="text" size="5" name="nbr" value="'.Tools::safeOutput(Tools::getValue('nbr', (int)(Configuration::get('HOME_FEATURED_NBR')))).'" /> <p class="clear">'.$this->l('The number of products displayed on homepage (default: 10).').'</p> </div> <center><input type="submit" name="submitAddHomeFeatured" value="'.$this->l('Save').'" class="button" /></center> </fieldset> </form>'; return $output; } function hookHeader($params) { $this->context->controller->addCSS($this->_path.'css/addhomefeatured.css'); } public function hookDisplayHome($params) { $category = new Category(Context::getContext()->shop->getCategory(), Configuration::get('PS_LANG_DEFAULT')); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), "position",null,false,true,true); $p=array(); for($i=0;$i<count($products);$i++){ $product=$products[$i]; unset ($pid); $pid=$product['id_product']; $sql= "SELECT * FROM `"._DB_PREFIX_."image` WHERE `id_product` = '{$pid}' AND cover = '0' ORDER BY `id_image` "; $results = Db::getInstance()->ExecuteS($sql); @$result=$results['0']; $p[$pid]=$result['id_image']; } $this->smarty->assign('addimages',$p); $this->smarty->assign(array( 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize('home'), )); return $this->display(__FILE__, 'addhomefeatured.tpl'); } }
  7. Parse error: syntax error, unexpected 'exit' (T_EXIT) in /homez.808/luxelumi/www/modules/addhomefeatured/addhomefeatured.php on line 1
  8. Fuckkk you're right! hahaha, and how i can edit? <?php if (!defined('_PS_VERSION_')) exit; class AddHomeFeatured extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'addhomefeatured'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Custom'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Add Featured Products on the homepage'); $this->description = $this->l('Displays Featured Products in the middle of your homepage.'); } function install() { if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) || !parent::install() || !$this->registerHook('displayHome') || !$this->registerHook('displayHeader')) return false; return true; } public function getContent() { $output = '<h2>'.$this->displayName.'</h2>'; if (Tools::isSubmit('submitAddHomeFeatured')) { $nbr = (int)(Tools::getValue('nbr')); if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr)) $errors[] = $this->l('Invalid number of products'); else Configuration::updateValue('HOME_FEATURED_NBR', (int)($nbr)); if (isset($errors) AND sizeof($errors)) $output .= $this->displayError(implode('<br />', $errors)); else $output .= $this->displayConfirmation($this->l('Settings updated')); } return $output.$this->displayForm(); } public function displayForm() { $output = ' <div class="clearfix"></div> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post"> <fieldset><legend>'.$this->l('Settings').'</legend> <p>'.$this->l('In order to add products to your homepage, just add them to the "home" category.').'</p><br /> <label>'.$this->l('Number of products displayed').'</label> <div class="margin-form"> <input type="text" size="5" name="nbr" value="'.Tools::safeOutput(Tools::getValue('nbr', (int)(Configuration::get('HOME_FEATURED_NBR')))).'" /> <p class="clear">'.$this->l('The number of products displayed on homepage (default: 10).').'</p> </div> <center><input type="submit" name="submitAddHomeFeatured" value="'.$this->l('Save').'" class="button" /></center> </fieldset> </form>'; return $output; } function hookHeader($params) { $this->context->controller->addCSS($this->_path.'css/addhomefeatured.css'); } public function hookDisplayHome($params) { $category = new Category(Context::getContext()->shop->getCategory(), Configuration::get('PS_LANG_DEFAULT')); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts($params['cookie']->id_lang, 1, ($nb ? $nb : 10)); $p=array(); for($i=0;$i<count($products);$i++){ $product=$products[$i]; unset ($pid); $pid=$product['id_product']; $sql= "SELECT * FROM `"._DB_PREFIX_."image` WHERE `id_product` = '{$pid}' AND cover = '0' ORDER BY `id_image` "; $results = Db::getInstance()->ExecuteS($sql); @$result=$results['0']; $p[$pid]=$result['id_image']; } $this->smarty->assign('addimages',$p); $this->smarty->assign(array( 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize('home'), )); return $this->display(__FILE__, 'addhomefeatured.tpl'); } }
  9. Hahahahaha yes Vekia /modules/homefeatured/homefeatured.php come in my shop, maybe you found something of anomalous http://luxelumi.com
×
×
  • Create New...