PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

V1.1 some bugs fixes

12 replies to this topic
#1
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
Here are some bugs fixes for V1.1 Original French Post HERE

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

http://www.prestasho...cker/view/1091/

Cart truncate:

in /modules/blockcart/blockcart.tpl line: 44
find:
{$product.name|escape:htmlall:'UTF-8'|truncate:20} 

replace:
{$product.name|escape:htmlall:'UTF-8'|truncate:16}


in /modules/blockcart/blockcart-json.tpl line: 77
find:
'{$error|addslashes}' 

replace:
'{$error|addslashes|html_entity_decode:2:'UTF-8'}'


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

http://www.prestasho...er_janvier_2009

Stat problem

in /admin/tabs/AdminStatsTab.php line: 36
find
if ($month = Tools::getValue('dateInputMonth', -1) AND Validate::isUnsignedInt($month))

replace
if (($month = Tools::getValue('dateInputMonth', -1)) != -1 AND Validate::isInt($month))


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

http://www.prestasho...cker/view/1080/

in /modules/cheque/cheque.php line: 33

find:
if (!isset($this->address) OR !isset($this->address))

replace:
if (!isset($this->chequeName) OR !isset($this->address))


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

http://www.prestasho...cker/view/1059/

problem with customised product in BO

in /admin/tabs/AdminProduct.php line: 422

find:
$product->customizable = (intval($_POST['uploadable_files']) > 0 OR intval($_POST['text_fields']) > 0) ? true : false;

replace:
$product->customizable = (intval($_POST['uploadable_files']) > 0 OR intval($_POST['text_fields']) > 0) ? 1 : 0;


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

http://www.prestasho...cker/view/1155/
pagination bug in new-products.php

Details:
On new-products page. Pagination block don't show the good number of page.
If there is 3 new-products and 60 products in the database, 3 products are displayed (that good) but there is a link for

each page (1, 2, 3, 4, ... 6) [with the default display 10 products by page].

To correct this bug, In the new-product.php page:

Ok, there is the new correction:

The original file was good:

line 8:
$nbProducts = intval(Product::getNewProducts(intval($cookie->id_lang), NULL,NULL, true));


but in classes/Products.php, getNewProducts was not good
find line 903:
        if ($count)
{
$result = Db::getInstance()->getRow('
SELECT COUNT(`id_product`) AS nb
FROM `'._DB_PREFIX_.'product`
WHERE `active` = 1');
return intval($result['nb']);
}


replace:
        if ($count)
{
$result = Db::getInstance()->getRow('
SELECT COUNT(`id_product`) AS nb
FROM `'._DB_PREFIX_.'product`
WHERE `active` = 1
AND DATEDIFF(`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0');
return intval($result['nb']);
}


Because original count return the number of products on database instead of the number of new products.


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

about products accessories that can't be set off, a tip is given in this post
http://www.prestasho...ad/10492/#48055

in file js/admin.js comment:

/*console.log('---');
console.log(input);
console.log('___');
console.log(name);*/


Quote

About accessories, it's a browser bug , console.log let by devs create bugs with some browsers, not FF2 but FF3 . take off all console.log from javascripts code.


#2
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts

Quote


We ask that you please post in English to the main sections of the PrestaShop Forum.


Thanks for you help, the problem is that 80% of us do not speak any French so if you could translate this to English then please :-)

Edit: aha, I see now, you added the link to the bug-rapport. Thanks!
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#3
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
Patch for little pictures bug not changed in BO

Thanks Pshopexpert LOOK HERE

IN /admin/tabs/AdminProducts.php

FIND line 176

if (isset($_GET['deleteImage']))
{
$image->delete();
deleteImage($image->id_product, $image->id);
if (!Image::getCover($image->id_product))
{
$first_img = Db::getInstance()->getRow('
SELECT `id_image` FROM `'._DB_PREFIX_.'image`
WHERE `id_product` = '.intval($image->id_product));
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'image`
SET `cover` = 1
WHERE `id_image` = '.intval($first_img['id_image']));


ADD AFTER

@unlink(dirname(__FILE__).'/../../img/tmp/product_'.$image->id_product.'.jpg');
@unlink(dirname(__FILE__).'/../../img/tmp/product_mini_'.$image->id_product.'.jpg');


FIND line 209

elseif (isset($_GET['coverImage']))
{
Image::deleteCover($image->id_product);
$image->cover = 1;
$image->update();


ADD AFTER

@unlink(dirname(__FILE__).'/../../img/tmp/product_'.$image->id_product.'.jpg');
@unlink(dirname(__FILE__).'/../../img/tmp/product_mini_'.$image->id_product.'.jpg');


FIND line 509

public function addProductImage($product, $method = 'auto')


TAKE OFF UNLINK lines 529

@unlink(dirname(__FILE__).'/../../img/tmp/product_'.$product->id.'.jpg');
@unlink(dirname(__FILE__).'/../../img/tmp/product_mini_'.$product->id.'.jpg');


REPLACE WITH

if (sizeof($this->_errors))
return false;
@unlink(dirname(__FILE__).'/../../img/tmp/product_'.$product->id.'.jpg');
@unlink(dirname(__FILE__).'/../../img/tmp/product_mini_'.$product->id.'.jpg');
return ((isset($id_image) AND is_int($id_image) AND $id_image) ? $id_image : true);


#4
cybersteph

    PrestaShop Apprentice

  • Members
  • PipPip
  • 158 posts
merçi à toi pour le partage, très bonne idée cette petite liste.
E-commercant depuis 2004
Prestashop V1.2.5 modifié final en production!
PROMAC OSX!!!

#5
Cédric Girard

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1074 posts
Bonsoir

MAJ effectuées ;-) : super idée que cette liste !

Juste une question sur la correction des "false/true" en "0/1" : dans le même fichier ligne 73 on n'aurait pas le même soucis par hasard ?... Je dis ça je dis rien, juste que je n'ai jamais utilisé de booléens sous cette forme en PHP, je pose donc la question ;-)
EX entrepreneur spécialiste du référencement Prestashop, certifié CESEO - Attention, je n'exerce plus mais je partage désormais mes connaissances sur mon site dédié à Prestashop et Wordpress !

Mon projet phare (créé de A à Z) : Matériel de cuisine professionnel

#6
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
updated, if you know some V1.1 fixes, post here please

#7
Fabrice

    PrestaShop Fanatic

  • Moderators
  • 3147 posts
ce sujet en post'it, ce serait bien.
merci jolvil. bonne idée !!
Fabrice
http://www.my-deco-shop.com
Projet en cours de lancement - New fantastic module: Checkout-Pro
le meilleur outil de gestion pour Prestashop que j'utilise - best tool I use: Store Commander

#8
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
A fix for AdminBackup.php on line 182 to change ages like "2 days days" to "2 days":

$age = floor($age / 86400).' '.$this->l('days');


to

$age = floor($age / 86400);

Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#9
L. Brett Sinclair

    PrestaShop Apprentice

  • Members
  • PipPip
  • 320 posts
a fix to Sort the attributes can be found here:

http://www.prestasho...duct_attributes
Tout sur la Country avec
www.Country-Cowboy.com

Blanchiment des dents avec
www.DentsDeStars.com
:cheese:

#10
Major

    PrestaShop Apprentice

  • Members
  • PipPip
  • 48 posts
Correction of the bug #1549: removing customized products from the cart (see forum and bug tracker).

Here are the modifications brought to the cart.php file on my Prestashop version (SVN 687):

1/ Look for:

private function _updateCustomizationQuantity($quantity, $id_customization, $id_product, $id_product_attribute, $operator = 'up')

Line 416, replace:

return $this->_deleteCustomization(intval($id_customization));

with:

return $this->_deleteCustomization($id_product,intval($id_customization),$id_product_attribute);


2/ Look for:

public    function deleteProduct($id_product, $id_product_attribute = NULL, $id_customization = NULL)

Line 495, replace:

return $this->_deleteCustomization(intval($id_customization)) AND $this->deleteProduct(intval($id_product), $id_product_attribute, NULL);

with:

$this->_deleteCustomization($id_product,intval($id_customization),$id_product_attribute) AND $this->deleteProduct(intval($id_product), NULL, $id_product_attribute);


3/ Look for:

private    function _deleteCustomization($id_customization)

Lines 515 to 519, replace:

    private    function _deleteCustomization($id_customization)
{
if (!$result = Db::getInstance()->getRow('SELECT `quantity` FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.intval($id_customization)) OR
!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cart_product` SET `quantity` = `quantity` - '.intval($result['quantity'])))
return false;

with:

  private    function _deleteCustomization($id_product, $id_customization, $id_product_attribute=NULL)
{
if (!$result = Db::getInstance()->getRow('SELECT `quantity` FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.intval($id_customization)) OR
!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cart_product` SET `quantity` = `quantity` - '.intval($result['quantity']).' WHERE `id_product`='.intval($id_product).' AND `id_cart` = '.intval($this->id).' AND `id_product_attribute` = '.($id_product_attribute != NULL ? intval($id_product_attribute) : '\'\'')))
return false;


#11
www.gozdesm.com

    PrestaShop Apprentice

  • Members
  • PipPip
  • 378 posts
Without a screen shot loads

#12
Ann

    PrestaShop Apprentice

  • Members
  • PipPip
  • 363 posts
Hi all !

Any hint about stats vanishing in 2010 ?

Cheers !
www.ann-secrets.com
www.mode-des-femmes.com

#13
Zippout

    PrestaShop Newbie

  • Members
  • Pip
  • 5 posts

From 1262417743:

Hi all !

Any hint about stats vanishing in 2010 ?

Cheers !


Im in same position, tried everything i can remember 1.1.0.5 Stats visitor always returning 0

Rgds,
Zippoutlet - www.zippoutlet.info