Matrice – Prestashop 1.4.3 – Undefined variable: nb_products FIX

Posted on July 12, 2011
Filed Under PHP, Prestashop | Leave a Comment

I am rebuilding one of our webshops and run into this nasty error when clicking on the home category from the TOP navigation menu.

Notice: Undefined variable: nb_products in /var/www/html/shopname/tools/smarty/sysplugins/smarty_internal_data.php on line 291 There are no products.

We are using the Matrice theme which is truly amazing however there seems to be an issue here with it. If you run into the same as a quick fix just change the following in the category.tpl:

 

{if $nb_products == 0}{l s=’There are no products.’}

{else}

{if $nb_products == 1}{l s=’There is’}{else}{l s=’There are’}{/if} 
{$nb_products} 
{if $nb_products == 1}{l s=’product.’}{else}{l s=’products.’}{/if}

{/if}

 

to

<!–

{if $nb_products == 0}{l s=’There are no products.’}

{else}

–>

{if $nb_products == 1}{l s=’There is’}{else}{l s=’There are’}{/if}&#160;
{$nb_products}&#160;
{if $nb_products == 1}{l s=’product.’}{else}{l s=’products.’}{/if}
<!–

{/if}

–>

Make sure that you are changing the Matrice theme not the default one :)

Email Forwarding with iRedMail and phpLDAPadmin – How to?

Posted on June 12, 2011
Filed Under iRedMail, phpLDAPadmin, Postfix | Leave a Comment

After installation of iRedMail I was quite happy with the product up until the point that I realized that there is no mail forwarding option in iRedMail backend. I was browsing forums but I only could find very complicated solutions or hints that you can do it either from the postfixadmin backend ( which is not coming with the iRedMail product anymore ) or you can use the phpLDAPadmin backend to configure this.

I was playing around with phpLDAPadmin and finally got to this solution:

First create a mail user using your iRedMail backend. I am not going into detail on how to do this it is quite self explanatory.

After iRedMail installation there is a very helpful summary file in the folder where you are kicking of the installation from. It contains all passwords, userids, and URLs you might need to use iRedMail and all underlying products. I does in fact installs many including Dovecot, Postfix, phpLDAPadmin, etc. This summary file is iRedMail.tips

Get your phpLDAPadmin URL, password and master user id from this file and log in to phpLDAPadmin backend. The URL is usually:

https://www.yourdomain.com/phpldapadmin/htdocs/cmd.php

Log in go to and drill down to the email user you have previously created and click on it.

























You will have a couple of options on the right panel, select default, then select add new attribute.










Select mailForwardingAddress from the dropdown list and fill in the email address where you would like to forward emails from this account. Please note that you can set both internal or external email addresses. Click on Update Object at the bottom of the page.






Click on Commit at the next screen to confirm changes and it is done :)

There are other ways to enable this and if you use iRedAdmin-Pro you can even do it from the Admin backend. I am only covering the phpLDAPadmin part. Please read this post for more information:

http://www.iredmail.org/forum/post9958.html#p9958

Slow to receive emails? – Disable Postfix Greylisting

Posted on June 11, 2011
Filed Under Postfix, Ubuntu, VPS | Leave a Comment

Once you install iRedMail on your own VPS you might encounter issues by mails not being received on time or not being received at all. In my case I just had to disable the Postfix Policyd greylisting. I have seen many reject error messages in /var/www/mail.log :

Jun 11 18:13:55 ProcessingEngine postfix/smtpd[13562]: connect from gateway01.websitewelcome.com[69.41.242.19]
Jun 11 18:13:56 ProcessingEngine postfix-policyd: rcpt=16, greylist=abuse, host=69.41.242.19 (gateway01.websitewelcome.com), from=ORIGIN@EMAILREMOVED.COM, to=DESTINATION@EMAILREMOVED.COM, size=0
Jun 11 18:13:56 ProcessingEngine postfix/smtpd[13562]: NOQUEUE: reject: RCPT from gateway01.websitewelcome.com[69.41.242.19]: 450 4.7.1 : Re cipient address rejected: Policy Rejection- Please try later.; from= to= proto=SMTP helo=
Jun 11 18:13:56 ProcessingEngine postfix/smtpd[13562]: disconnect from gateway01.websitewelcome.com[69.41.242.19]

After a bit of a research I have figured that the postfix-policyd configuration file contains the entry where you can disable greylisting. Once I have done that I have been able to send and receive mails instantly.

The config file on my ubuntu 10.4.2 LTS server is located at:

/etc/postfix-policyd.conf

Just set the GREYLISTING paramter to 0

#####################################################################
#
# enable greylisting                                  default: on
#
#   whether greylisting should be enabled or disabled.
#
#                                                     1=on  0=off
GREYLISTING=0

Setting “In-stock first” as default option on products pages – Prestashop 1.4

Posted on April 13, 2011
Filed Under Prestashop | Leave a Comment

There is no option like that in Back Office  -> Preferences -> Products. The relevant admin tabs code shows ( AdminPPreferences.php) :

array(‘id’ => ’0′, ‘name’ => $this->l(‘Product name’)),
array(‘id’ => ’1′, ‘name’ => $this->l(‘Product price’)),
array(‘id’ => ’2′, ‘name’ => $this->l(‘Product added date’)),
array(‘id’ => ’4′, ‘name’ => $this->l(‘Position inside category’)),
array(‘id’ => ’5′, ‘name’ => $this->l(‘Manufacturer’)),
array(‘id’ => ’3′, ‘name’ => $this->l(‘Product modified date’))

which is missing option “6″ that stands for the “In-stock first” option.

Simply modify the following two database configuration options:

Change the PS_CONFIGURATION table PS_PRODUCTS_ORDER_BY option to “6″

Change the PS_CONFIGURATION table PS_PRODUCTS_ORDER_WAY option to “1″

That’s it

Handling Hungarian character set from PHP – Ő Ű problem

Posted on December 21, 2010
Filed Under MySql, PHP | 2 Comments

I have started to write an app in php and run into the good old character set problem.Ő and Ű characters were not displayed correctly however I have converted the data back and forth. The key is to use UTF-8 encoding.

You have to tell php what encoding to use you can achieve this either using the HTML or the PHP definition. Whichever suits you. Add this to the header section of the HTML code:

<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″ >

You can achieve the same using the header php command:

header(“Content-Type: text/html; charset=utf-8″);

Now we have to make sure that the data coming from the mysql database is UTF-8 encoded. Add this right after the database connection line.

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); // Add UTF-8 converting after this line
mysql_query(“SET NAMES UTF8″);

Make sure that the php file itself is saved from the editor in UTF-8 format. Each progamming editor has the capability to change the character encoding.

Finally check your database if  the tables and the database are utf8_hungarian_ci encoded. MySQL connection collation should be set to utf8_general_ci.

That should be it :)

Google Base Feed partly uploads – Prestashop

Posted on September 22, 2010
Filed Under Google Base, Prestashop | Leave a Comment

I am using www.ecartservices.net’s Google Base feed generator. I ran into a problem last week. I have over 5000 products in one of my store. The feed was generated fine however when I am uploading to Google Base only loads about 1000 of them. I was trying to find out what went wrong but I couldn’t figure out what order the products were uploaded to see what’s wrong with the feed file. I have just figured out that the feed generator assigns an id to every product and Google Base indexes the products in that order. So if you have the same problem find out what part of the feed file is corrupted follow these steps:

Check how many products have been uploaded successfully using Google Merchant Center’s “feed” option:

In my case 1009 products are indexed correctly. To find out what went wrong open your generated XML feed and find the relevant id.

<item>
<title>CAESARS by Caesars</title>
<g:brand>Caesars</g:brand>
<g:condition>new</g:condition>
<description><![CDATA[Gift Set -- 3.3 oz Eau De Cologne Spray + 3.3 oz Body Cream + 3.3 oz Body Wash]]></description>
<g:expiration_date>2010-10-22</g:expiration_date>
<g:id>pcen-1009</g:id>
<guid>pcen-1009</guid>
<g:image_link>http://www.megaperfumeshop.com/img/p/1009-1009-large.jpg</g:image_link>
<link>http://www.megaperfumeshop.com/1009-caesars-by-caesars.html</link>
<g:price>38.4</g:price>
<g:product_type>Brands A-Z &gt; Caesars</g:product_type>
</item>

Then see the next product:

<item>
<title>caf&iuml;&iquest;&frac12; by Cofinluxe</title>
<g:brand>Cofinluxe</g:brand>
<g:condition>new</g:condition>
<description><![CDATA[Parfum De Toilette Spray 3 oz]]></description>
<g:expiration_date>2010-10-22</g:expiration_date>
<g:id>pcen-1010</g:id>
<guid>pcen-1010</guid>
<g:image_link>http://www.megaperfumeshop.com/img/p/1010-1010-large.jpg</g:image_link>
<link>http://www.megaperfumeshop.com/1010-caf-by-cofinluxe.html</link>
<g:price>16.64</g:price>
<g:product_type>Brands A-Z &gt; Cofinluxe</g:product_type>
</item>

The junk characters in the product name cause the feed import to stop and not to load products any further. Simply remove the defected products and upload the feed again. So this wasn’t the problem of the feed generator but it was a problem with the data quality. Good stuff that it can easily be fixed.

Refurbishing of iranyspanyolorszag.com

Posted on September 7, 2010
Filed Under Our Work, wordpress | Leave a Comment

We are currently refurbishing the www.iranyspanyolorszag.com page. We are changing the profile from a community website to more tourism based one adding loads of information however keeping part of the information of the previous page. We also migrated the site from joomla into wordpress giving it a fresh look and better navigation.

How to change a wordpress site’s URL

Posted on September 1, 2010
Filed Under Ubuntu, wordpress | Leave a Comment

I recently had to copy over to solutioning.eu this blog from blog.solutioning.eu. I read many articles and it was really confusing. Since the database was already on the same server and the username/ password hasn’t changed once I copied all the files the site was running but there were no styles whatsoever so it looked a bit dodgy. Also the wp-admin link wasn’t working. This is due to the fact that wordpress stores the site’s URL in its database ( not like joomla or prestashop which have this defined in a configuration file ).

I could change the URL by simply changing the following in the wordpress database using PhpMyAdmin:
I opened the wp_options table and changed the siteurl and home fields to www.solutioning.eu from blog.solutioning.eu

The website was working again right after this, no hassles, not other configurations…

Visualize MySQL Database on Ubuntu – PNG Dump

Posted on February 13, 2010
Filed Under Ubuntu | Leave a Comment

Install SQL Fairy:

sudo apt-get install sqlfairy

Create a database Dump:

mysqldump -u root -p -d databasename > database.sql

Create png file from database dump

sqlt-graph -f MySQL -o mydatabase.png -t png database.sql

Windows 7 Install – Cannot Find DVD Driver Solution

Posted on January 26, 2010
Filed Under Uncategorized | Leave a Comment

I bought new hardware a week ago and I decided to try windows 7 64bit. After putting it all together I tried to install Windows 7 which was going for a while then it started to complain about the DVD Driver and the installation process stopped. This error usually happens when you have an old DVD drive which is no longer supported by Windows 7 64bit. Well I have a 5 year old Benq DW1620 DVD drive. After browsing the forums and finding no useful information on this apart from buying a Windows 7 compatible DVD Driver I decided to try a different approach: Installing Windows 7 from a USB key.

This magically solved the installation problem and the DVD drive is now working properly under Windows 7 without any additional tweaking.

To install Windows 7 from a USB key follow this guide

Please watch out for the following things while using this guide:

  • If you use XP the diskpart utility will NOT show your USB keys. So instead of doing it from diskpart you can complete the relevant steps from the Disk Manager. The easiest to start the Disk Manager: Click Start > Run and type diskmgmt.msc in the Open line and click OK. The Disk Management snap-in will open.
  • If you do not have the relevant bootsect.exe ( 32 bit version for 32 bit Windows 7 and 64bit version for 64bit operating system ) you will not be able to create the bootdisk. To fix this download the relevant version of bootsect.exe.
keep looking »
  • About

    We love to create.. websites :) That's what We do. Always new ideas, new challenges, new technologies. That's what We like. Have a look at our portfolio or just simply browse the page. Happy surfing!

  • Admin