Jump to content

product features


weblexie

Recommended Posts

hi guys, i'm newbie here and new to prestashop too yesterday. just recently installed 1.6.9 and still exploring it.

 

i am having problem in displaying width, height, weight, length,manufacturer,product # or sku and upc in the product page.

 

can anyone help me out please

 

thank you very much

Link to comment
Share on other sites

hi guys, i'm newbie here and new to prestashop too yesterday. just recently installed 1.6.9 and still exploring it.

 

i am having problem in displaying width, height, weight, length,manufacturer,product # or sku and upc in the product page.

 

can anyone help me out please

 

thank you very much

 

hi

 

i don't know how attach module zip file here, but this small module will do what you want , to display  'upc','ean13','width' ,'height','depth', 'weight'

<?php
class get_more_productinfo extends Module
{

    private $_html = '';
    private $_postErrors = array();

    function __construct()
    {
        $this->name = 'get_more_productinfo';
        $this->tab = 'Tools';
		$this->version = '1.0';
		$this->author = 'Rajib A L';

        parent::__construct();

        $this->displayName = $this->l('get more product info');
        $this->description = $this->l('get more product info like width, height, weight, length in product page');
    }

    public function install()
    {
        parent::install();
        $this->registerHook('displayLeftColumnProduct');
    }

    public function hookDisplayLeftColumnProduct($params)
    {
      global $smarty, $cookie, $id_product;
    if ($id_product = (int)Tools::getValue('id_product'))
    $product = new Product($id_product, 
                           true,
                           $this->context->language->id, 
                           $this->context->shop->id);
						   
		if (!Validate:: isLoadedObject($product))
			return;
	
$weight_unit=Configuration::get('PS_WEIGHT_UNIT');
$dimension_unit=Configuration::get('PS_DIMENSION_UNIT');


	
     $smarty->assign(array(
		 'upc' => $product->upc,
		 'ean13' => $product->ean13,
         'width' => $product->width,
		 'height' => $product->height,
		 'depth' => $product->depth,
		 'weight' => $product->weight,
		 'weight_unit' => $weight_unit,
		 'dimension_unit' => $dimension_unit
      ));
	
     return $this->display(__FILE__, 'get_more_productinfo.tpl');
    }  
    
}

?>


then the template file

{if $upc !=''}
<p>UPC: {$upc}</p>
{/if}
{if $ean13 !=''}
<p>EAN: {$ean13}</p>
{/if}
{if $width !=''}
<p>Width: {$width}{$dimension_unit}</p>
{/if}
{if $height !=''}
<p>Height:{$height}{$dimension_unit}</p>
{/if}
{if $depth !=''}
<p>Depth: {$depth}{$dimension_unit}</p>
{/if}
{if $weight !=''}
<p>Weight: {$weight}{$weight_unit}</p>
{/if}


Edited by rajlaskar (see edit history)
  • Like 1
Link to comment
Share on other sites

 

 

hi

 

i don't know how attach module, but this small module will do what you want , to display  'upc','ean13','width' ,'height','depth', 'weight'

<?php
class get_more_productinfo extends Module
{

    private $_html = '';
    private $_postErrors = array();

    function __construct()
    {
        $this->name = 'get_more_productinfo';
        $this->tab = 'Tools';
		$this->version = '1.0';
		$this->author = 'Rajib A L';

        parent::__construct();

        $this->displayName = $this->l('get more product info');
        $this->description = $this->l('get more product info like width, height, weight, length in product page');
    }

    public function install()
    {
        parent::install();
        $this->registerHook('displayLeftColumnProduct');
    }

    public function hookDisplayLeftColumnProduct($params)
    {
      global $smarty, $cookie, $id_product;
    if ($id_product = (int)Tools::getValue('id_product'))
    $product = new Product($id_product, 
                           true,
                           $this->context->language->id, 
                           $this->context->shop->id);
						   
		if (!Validate:: isLoadedObject($product))
			return;
	
$weight_unit=Configuration::get('PS_WEIGHT_UNIT');
$dimension_unit=Configuration::get('PS_DIMENSION_UNIT');


	
     $smarty->assign(array(
		 'upc' => $product->upc,
		 'ean13' => $product->ean13,
         'width' => $product->width,
		 'height' => $product->height,
		 'depth' => $product->depth,
		 'weight' => $product->weight,
		 'weight_unit' => $weight_unit,
		 'dimension_unit' => $dimension_unit
      ));
	
     return $this->display(__FILE__, 'get_more_productinfo.tpl');
    }  
    
}

?>


then the template file

{if $upc !=''}
<p>UPC: {$upc}</p>
{/if}
{if $ean13 !=''}
<p>EAN: {$ean13}</p>
{/if}
{if $width !=''}
<p>Width: {$width}{$dimension_unit}</p>
{/if}
{if $height !=''}
<p>Height:{$height}{$dimension_unit}</p>
{/if}
{if $depth !=''}
<p>Depth: {$depth}{$dimension_unit}</p>
{/if}
{if $weight !=''}
<p>Weight: {$weight}{$weight_unit}</p>
{/if}


hi rajlaskar,

 

since i am new in prestashop, i don't know where can i put that, please enlighten me,

 

thank you very much

Link to comment
Share on other sites

×
×
  • Create New...