Wednesday 12 September 2012

Here are some prestashop modules to download

Product import using CSV

This is the correct format to import product using csv.

For some special drop down attributes you have to use some special attribute values to insert csv

Example:

Shipping (11923 => 24h, 11924 => 48h)

Note: 11923 (Feature id)
24h (Feature value)

Open AdminImport.php ( root/adminfolder/tabs)

Goto line #185 define the array values in function __construct()

,'Shipping' => array('label' => $this->l(' Shipping (11923 => 24h, 11924 => 48h)'))

Go to line #870 to insert the new fields

if(isset($info['Shipping'])){
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'feature_product` (`id_feature`, `id_product`, `id_feature_value`)
VALUES (23, '.$product->id.', '.(int)($info['Shipping']).')
ON DUPLICATE KEY UPDATE `id_feature_value` = '.(int)($info['Shipping']));
}

Note : “23 ” is Shipping's feature id

After uploading csv we should Select from the drop-down list above each column the value you want to attribute to the corresponding value.

Saturday 12 May 2012

To redirect website url using .htaccess


To redirect website using .htaccess

RewriteCond %{HTTP_HOST} ^www.givenurl.fr
RewriteRule ^(.*) http://www.targeturl.com/$1 [R=301,L]

Thursday 5 April 2012

To check the condition whether the module is installed or uninstalled

To check the condition whether the module is installed or uninstalled to display particular block in tpl file

{if Module::isInstalled("productcomments")}
<div>This block is to be displayed only when module is installed</div>
{/if}
I got PHP notices in Stats tab

Notice: Use of undefined constant _PS_CREATION_DATE_ - assumed '_PS_CREATION_DATE_' in /www/modules/statsforecast/statsforecast.php on line 85


Go to line no:85

Instead of

$from = max(strtotime(_PS_CREATION_DATE_.' 00:00:00'), strtotime($employee->stats_date_from.' 00:00:00')); 

Replace this below code

$from = max(strtotime('_PS_CREATION_DATE_'.' 00:00:00'), strtotime($employee->stats_date_from.' 00:00:00'));


    

Monday 12 March 2012

Product.php => array_key_exists() expects parameter 2


A simple warning in Product.php

PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /home/prestashop/classes/Product.php on line 1804


Please replace this code in the line no: 1866

$attribute_price = Tools::convertPrice((is_array($result) && array_key_exists('attribute_price', $result)) ? (float)($result['attribute_price']) : 0, $id_currency);


Monday 5 March 2012

FPDF error: Some data has already been output, can't send PDF file in PRESTASHOP 1.4.6.0

While generating PDF for invoice error will display given below

FPDF error: Some data has already been output, can't send PDF file


Here is the solution:

Go to [tools] folder - > Open [fpdf] folder - Open fpdf.php file

Line no:992 
function Output($name='', $dest='')
{
ob_clean();

---------------------------------------------------------------------------------------------


Spanish translation:



Problema con error al pinchar sobre el enlace a la factura en PDF:


FPDF error: Error en prestahop 1.4.x al pinchar sobre una factura que no se genera y aparece el error: "FPDF error: Some data has already been output, cannot send PDF file"


He aquí la solución:


En el servidor de ficheros (por FTP), ir a la carpetas [sitioweb]\tools\fpdf\ y abrir el fichero fpdf.php
En la línea número 992 (al menos es ese numero de línea en v.1.4.7.3), justo debajo de donde dice 


function Output($name='', $dest=''){SE AÑADE ESTA NUEVA LÍNEAob_clean(); Esta función descarta el contenido del buffer de salida.
Debe quedar así:
function Output($name='', $dest=''){ob_clean(); 



Courtesy :La Felipedia (For spanish translation)
------------------------------------------------------------------------------------------------------------

Put ob_clean();  This function discards the contents of the output buffer.








Tuesday 28 February 2012

Language order

probably you have solved it yourself, but in case somebody else needs a solution, this can be useful:
in the /module/blocklanguages/blocklanguages.php file put



function cmp($a, $b)
{
  //language iso_code in the desired order:
  $new_order = array("fr", "es", "en", "de");
  foreach($new_order as &$value)
  {
    if ($a["iso_code"]==$value) return -1;
    if ($b["iso_code"]==$value) return 1; 
  }
}




Paste this code:


usort($languages,"cmp");
$smarty->assign('languages', $languages);

Thursday 2 February 2012

To Increase Keyword,Meta tag,Description limit to more than 250 Character.


You need to edit your database using phpMyAdmin and increase the length of the meta_keywords field of the ps_product_lang table

And then edit line:187 of classes/Product.php and increase the meta_keywords length there:


protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255,