Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Sunday, December 9, 2012

Suppliers...

I wanted to show a list of Suppliers on the left and if one was clicked show a page in the center with address etc to that Supplier.
This showed to be quite a challenge.

The first obstacle was that the link on the title SUPPLIERS didn't work (this was not important, but annoying).
It turned out that I had to check Display suppliers and manufacturers in Preferences/General, which may seem natural except for the description of what that meant, which reads Display suppliers and manufacturers lists even if corresponding blocks are disabled.
My Manufacturers Block is disabled, but of course no Manufacturers showed when I ticked Yes...

No, the first obstacle was that the logos didn't show up with IE. This was because $mediumSize.width and $mediumSize.height wasn't defined, I removed that code and hardcoded a width of 200.

Then for the contact information for the Suppliers.
The module is meant to just list all products supplied by the Suppliers, I don't know why there is address etc to be filled out in the BO because AFAIK that information is never used anywhere.

I had to make the information available to themes/supplier.tpl
I inserted code in classes/supplier.php to fetch it from the database, it turned out to be the wrong place and/or file so I won't give all details but basically
$query->select ' ... a.`id_supplier.address1`');
$query->leftjoin('address', 'a', 's.`id_supplier` = a.`id_supplier`');

This turned out to make the address available to themes/supplier-list.tpl but not to themes/supplier.tpl so I did a ugly hack in suppliercontroller.php
I had the data in $suppliers but not in $this->supplier, so I looped through $suppliers and pulled the wanted fields into standalone variables, i.e.
$addr1 = $row['address1'];
and make those available with i.e.
'addr1' => $addr1

Finally I could use e.g. {$addr1} in themes/supplier.tpl


Monday, December 3, 2012

PS 1.5 - warning, please wait for mature version!

Long time no blogging, I'll see if I can rectify that...

I've been playing around with PS 1.5.2 for a bit and I must say that 1.5 is not yet mature.
Some bugs I've found:
  • Installing 1.5.2 breaks other installations if same database is used! - I installed 1.5.2 and supplied db-prefix hk_, after install, all references to Swedish was wiped out from my old installation that has ps_ as db-prefix.
  • With a Swedish browser (tested with FF 16 and IE 9) and registring a new address as customer, El Salvador is proposed as country (see old blog post for plausible reason).
  • For apparently no reason, sometimes all products show up twise; if this happens, don't delete the duplicates since that removes the originals too.
  • When searching for products, either via the search box or by clicking a tag, some products are listed with a price of 0; in other views (featured, category etc) the price is shown OK). In the cart, prices are OK so no monetary risk but not very pretty.
  • The Suppliers Block is broken: The title bar is not a link, if code is changed to make it work clicking it shows "There are no suppliers." ($nbSuppliers that is supposed to hold the number of suppliers is 0 and no variables holds any supplier-info.)
  • The MoneyBookers Module has a small issue that the image that is supposed to show up has the wrong name in the code (or the image is not included/has the wrong name).
Annoyances:
  • It is getting increasingly difficult to get help via the forum.
  • I'm not sure if reporting bugs does any good since there is absolutely zero feedback.
  • Not that many Modules/Themes are ported/developed for 1.5 because, I would think, of the issues with that version.
I'll try to get back soon with some information on a couple of tweaks I've done.

Wednesday, June 2, 2010

Default Country - Bug in IE 6-8

It seems I never wrote about this strange bug before, so here goes...

Problem description
If a customer use the Swedish Internet Explorer 6, 7, or 8 PrestaShop thinks they are located in El Salvador.

This is because of a bug in IE. IE sends the Language Code (SV for Sweden) intead of the Country Code (SE for Sweden, SV for El Salvador) to the server.
Since the bug appeared as early as in ver 6 of IE, one would think that the bug would be solved by now, but I guess it's not regarded severe enough.

Client side workaround
One workaround would be to add .se as suffix in IE (Verktyg, Internetalternativ, Språk), but since that only fix the problem for that single client it's not really a solution.

Solution
The way I solved it was to hardcode it in the PrestaShop code, like this:
In themes/prestashop (or whatever your themes folder is called)/authentication.tpl change $sl_country to the number that represents Sweden in your installation of PrestaShop (in mine it's 18 but could be something else for you)

I.e. change

{foreach from=$countries item=v}
<option value="{$v.id_country}" {if ($sl_country == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}

to

{foreach from=$countries item=v}
<option value="{$v.id_country}" {if (18 == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}


PS Note to self: use this to include code in blog posts

Monday, March 8, 2010

A small bug(?) in product.tpl

I found that if I created a product that was allowed to be ordered when it is out of stock and it has combinations, or attributes, when I look on the product (product.tpl) the text about entering an email address to be "notified when the item is in stock" appears.
This is only if there are combinations added, so a little strange.

While debugging the code I found that by inserting
{if !$allow_oosp}
...
{/if}

around the $HOOK_PRODUCT_OOS paragraph, right after < ! - - Out of stock hook - - >, the behaviour returns to normal.
(spaces added so as the code won't be interpreted as code...)