Prestashop :: adding text blocks in the template

Here you can see how you can add html and text on various places of your template.

Presta is very good written e-commerce platform and class overwriing is piece of cake. So, here is the code:

1. Create a file under {presta_dir}/override/classes and name it Tools.php.
2. Copy and paste that code in the new file:

<?php
/**
 * Tools override class
 */

class Tools extends ToolsCore{
    public static function getPage($link_rewrite = null){
        global $cookie;
        $page = Db::getInstance()->getRow("SELECT * FROM "._DB_PREFIX_."cms_lang WHERE id_lang='".(int)($cookie->id_lang)."' AND link_rewrite LIKE '".$link_rewrite."'");
        return $page['content'];
    }
}

Note: if you already have this file just copy only the function and place it inside the Tools class.

3. That’s it :) Go and create a new CMS page under Prestashop Admin (Tools->CMS). Add a nice “friendly url” and put your your text in the body.
4. How to use the function in the template: Go to your template file files and insert the following code:

{Tools::getPage('your-seo-friendly-url-cms-page');}

Don’t forget to delete the cache.

Conclusion: The code is not 100% MVC, but it’s working straight away. As benefit your texts will be multilingual, and especially when you need to put them on places where there is no hooks, This would save a lot of time and effort.

Hope this helps.

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

Deadline tool – deadlinez.com

Over the weekend I had an idea and after day and a half (mostly spent in design) the final “product” is ready. It’s a tool for deadlines.

The idea: It came when I had tough conversation with a client of mine about some money which he owe. I wrote a short email notifing him that if he don’t pay within 2 weeks, we are stopping the supprt and cutting one of his main functionality (since he didn’t pay for it) of his app. And I was thinking: Woudn’t be nice to have a tool which could track the deadline like “You have 14 days, 23 Hours and 30 Minutes to pay is, otherwise – no support” – short and clear. Well this is what the Deadline tool is doing. Here it is:

deadlinez.com

The main functionaliy: At the first screen you need to select date and time then the deadline is reached as well as the target name and the task (message) which need to be completed. When you submit the form it will create a short url which is the actual counter. This url can be send to the target.

deadlinez.com - Deadline tool

You can also set target’s e-mail as well as yours. If you did it you will receive a mail with a link when the deadline is reached. so both parties will be notified.

deadlinez.com - Deadline tool

Few ideas for deadlines:

  • Set deadline for business client (like me :) )
  • Set deadline to your roommate to move out
  • Set your personal deadline to reach some level of income, or career growth
  • Set deadline to your govermnent…

Or whatever you imagine. Please use this for fun mostly!

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

Error: invalid XML tag syntax and Extplorer

A client of mine uses standalone version of Extplorer as Client section of his website. Because they are Studio for Printing materials, it’s normal, that their “production” is quite large as file size.

Recently they asked me to increase the max_upload_filesize to more than 4-5Gb. In the php.ini I’ve set max_upload_filesize=60G, but when someone try to login, it hangs and in the Firebug console it says “invalid XML tag syntax”.

The solution was to replace 60G with 6000G which is equivalent to ~6Gb. After that change the extplorer start working normally.

Hope this will help someone.

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

Codecademy – Javascript tutorials for newbies

It’s not every day you see a tutorial set that really makes you smile, but Codeyear’s attempt to teach people Javascript through weekly courses and projects is admirable, especially given the quality of the site, the clarity of the courses, and the potential for knowledgeable programmers to start writing similar courses for other languages, such as Python.

To top it all off, they’re using a badge and points system to encourage people to complete new courses, which is a great way to motivate people to finish what they’re learning and move on to something new. In addition, it also means that as they see their projects come to life, they can show people how far they’ve progressed and encourage a little online competition – which, if you’re a partycasino.com fan, is never a bad thing.
Continue reading

jQuery .submit() trigger problem

Recently I experience the following problem, when I call this code it triggers an error in FireBug:

$('input[name="s"]').parents('form').submit();

With “human” words: I trired to find a input with a spefic name, then find the form wrapping this input and try to submit it. Strangely, but it trows an error in jQuery lib.
Continue reading

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

How to Effectively Deploy Call Center Software

An important component of the modern work environment is the call center. Finding ways to effectively implement a software application to enhance the productivity of employees is critical to improving customer satisfaction.
After choosing a call center software that will meet a business’s need, the next step is to effectively deploy the application.
Continue reading

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

How Converged Networks Will Revolutionize Telecommunications

Phone calls aren’t what they used to be. The antiquated system of wires and telephones that once crisscrossed the country becomes increasingly irrelevant as more companies and consumers switch to voice calling over data networks.

Called Voice over IP, this technology uses high speed Internet connections, private networks and internal LANs to deliver enhanced telephone services at a lower price. Very soon, data networks will handle nearly three-quarters of all phone calls. As different types of networks converge, they soon will handle almost every form of communication.
Continue reading

Quick tip: WordPress – How to make Contact Form 7 working with qTranslate

On my recent project I had to create multilingual site and we decided to add multiple languages using qTranslate plugin.

The site of course has “Contact us” page and we decided to use Contact Form 7 plugin because it’s rich and flexible plugin for creating contact forms.

So far so good, but we detected that when the language is different than the default one, the form submission is redirecting to the default language page and because the forms are different they didn’t handle properly the errors as well as the thankyou message.
Continue reading

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca