Tuesday, October 12, 2010
Magento Developer Paradise on Twitter
Also, more information on Magento's blog: Developer Paradise Kick-OFF
Sunday, April 25, 2010
URLs in Magento
- getBaseUrl()
-getSkinUrl()
Next, when you create a link it's easy just to say:
.... href="http://www.blogger.com/customer/account"
instead you should use: ... href="<?php $this->getBaseUrl(); ?>customer/account" ...
For images:
img src="/skin/frontend/default/SKIN_NAME/images/rss.png"
instead you should use: img src="<?php $this->getSkinUrl('images/rss.png');?>" ...
Thursday, March 25, 2010
3 reasons to choose a consultant
When you start a new line of business or approach a new market you can use consultantcy services.
Starting an eCommerce business without online experience is a process. You can discover and face problems and issues, solve them and gain experience or you can have a guided tour and avoid most problems and focus on better marketing, customer relashions and so on. Using a consultant helps in this process.
Neutrality
A consultant will give you the right solution for you without selling software, specific products and so on. Based on this he can provide his services. It's in your best interest. He gets paid for giving you the right advice.
Ease
You need to make changes that affect your company personnel and you don't want to be the bearer of bad news?
A consultant can take the blame and do that for you. He does not need to stay afterwards and face the employees. Btw, see Up in the air
osCommerce - default language issues
Default language displayed was english even though in setup I used Romanian...
It seems that osCommerce checks browser language and displays that as default language. On way to solve this is:
if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
$lng->set_language($HTTP_GET_VARS['language']);
} else {
$lng->get_browser_language();
}
Comment the line of code
//$lng->get_browser_language();And you should have this solved.
Gettin' back
Mainly because I have to write more on my Romanian blog.
Anyway, I'm getting back on writing on this blog, so there will be 3 main categories with information I like to share:
Web Development
General information, mostly PHP, web frameworks like CakePHP and Zend Framework, issues I face, tutorials
eCommerce
Technical articles about platforms like osCommerce, Magento, Prestashop.
ERP Consultancy
Lately I've been involved in some projects regarding the process of choosing and ERP, implementing an ERP system, business analysis and so on. So I will share this with you.
I will also post personal stuff, so please bear me.
Any feedback is welcome.
Friday, November 06, 2009
Zend Framework 1.9.5 was released
Another mockup tool: Mockingbird
Mockingbird is an online tool that makes it easy for you to create, link together, preview, and share mockups of your website or application.
Mockingbird is built using Cappuccino framework.
Other similar tools for mockup interfaces are: Flairbuilder and Balsamiq.
Thursday, November 05, 2009
CakePHP 1.3 alpha is out
- Router - generate urls with new style prefixes
- Helpers - Helper::assetTimestamp() - to prevent url caching
- Helpers - TextHelper - highlight function
- Helpers - NumberHelper::addFormat() function
- Error handling
- improved Scaffolding
- Logging - Configure::write('log', E_WARNING);
- Models and datasources
- Console and Shells
Sunday, June 21, 2009
Friday, May 01, 2009
Magento installation - login problems on localhost
Monday, April 27, 2009
Magecamp
Starting tomorrow I'll be attending Mage::Camp... I'll have to register first for my VIP pass, hope that does not take long...
My agenda includes the Keynote speech from Varien (Roy Rubin), Magento Enterprise Edition and I'll see maybe some Internet World sessions...
Magento Enterprise Edition is a platform with great potential to cover the needs of a medium/large e-tail company... I have in mind a lot of eCommerce companies in Romania that would benefit from that, lower TCO, better change management and more features for their front end ...
Also, offline retailers could benefit from promoting at least their products in an online environment, attracting new customers and so on...
I'd like to see Mobexpert, which now uses oscommerce based solution just for a catalog... or Bricostore, Praktiker, and so on using a solution that can offer lots of functionalities for getting the most out of their promotions, bundles, cross-selling, up-selling, etc...
I'll post some more opinions during tomorrow... So stay tuned...
Sunday, April 05, 2009
PHP Frameworks: CodeIgniter
CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you're a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you're tired of ponderously large and thoroughly undocumented frameworksInstead of a web development framework I'd rather call it a collections of libraries that help you in developing a web application... I should continue with "easier" but is not actually like that, beacause "easier" for me means in the first place faster... The MVC pattern that tries to cover is actually going with some best practices and that's it... First time I tried CodeIgniter was at the recommendation of a fellow that was using CodeIgniter and was very happy with it... I tried to build a backend application for quote management, but I gave up and used a framework inspired by CakePHP, but quite truncated with a very good ORM... That was an unhappy experience and left CodeIgniter, and started using more and more CakePHP... The main reason I didn't continue with CodeIgniter was that I had to write lots of code... for everything I need I had to write code... And that's not helpful.. And after a year or so, at our company I got a very nice customer that was quite good four our image and decent pay... We already had a name, couple of large (national and multi-national companies) in out portfolio The code of the website was in 2 controllers (8k and 12k code code, yes that's 8.000 and 12.000 lines of code) and 2 views (the container of html code)... Of course CodeIgniter was used... They had no idea what they were doing in there....
class Start extends Controller {
function funcNameHere($paramx=''){
#code here
$data['content_html'] = 'html code here..';
#sql queries and stuff here... no models used...
#loops here to build the content
$this->load->view('main_view', $data);
}
#other 1000 functions here
}
So it's not at all easy to deal with this... But, without some extra-functionalities needed the application was working...
Anyway, instead of rewriting the entire app, we just moved to a proper approach only the modules that needed to be changed... Details in another story maybe...
This was another proof that using a Web Development Framework does not actually means writing quality code...
My conclusions about CodeIgniter so far:
- is a collection of libraries for developing web applications
- not a RAD framework
- too much code needed to be written
- good documentation
- lacks AJAX library
- low complexity and easy to learn
- weak ORM
Sunday, February 15, 2009
CakePHP: model without a database table
class ChartsController extends AppController
{
var $name='Charts';
function index() {
//code goes here
}
}
and the model:
class Chart extends AppModel
{
var $name = 'Chart';
var $useTable = false;
}
Setting the $useTable property to false is all you need to do...
Web Development PHP Frameworks News
- CakePHP
- Symfony
- Zend Framework
- Code Igniter
Tuesday, January 06, 2009
CakePHP: controller without models
class PagesController extends AppController {
var $name = 'Pages';
var $uses = array();#this controller uses no models...
}
And now you can edit your views and that's it...
Magento 1.2.0.1 - small fixes from 1.2
- Fixed checking customer ID in download controller
- Fixed “Incorrect table name…” SQL error during upgrade on some MySQL versions
- Added downlodable product type
- Implemented fulltext search
- Added layered navigation to search results
- Added option to disable Google checkout for selected products
- Added fixed amount product taxes
- Upgraded ZF library to version 1.7.2
Monday, January 05, 2009
What happened meanwhile...
Wednesday, December 31, 2008
CodeIgniter rss powered by Zend Framework Zend_Feed
In a recently project that we had to finish (started by a different company, went for two years and wasn't finished yet) we handled with a lot of legacy code which used CodeIgniter as a web development framework...
Refactoring it is another discussion because it's a nice case study how not to generate html code in your controller (which containes over 12.000 lines of code - it's a right figure, we still have in svn the original file) and the entire application has 2 controllers - 12k lines of code x 2 (one for frontend and one for backend) and 2 views (pretty cool eh?).
Delivering fast results means no time rewrite an entire application... A nice feature we added is rss feeds. For that we used Zend Framework component Zend_Feed embeded in a CodeIgniter controller... Application structure is:
/ /system /system/application /system/application/controllers /system/codeigniter [...] /Zend /Zend/Feed .htaccess index.php
We included in the Zend folder only Zend_Feed and dependencies for this job... Tried to use a Package Maker for Zend Framework, but it does not seem to work (did not included EmailValidation and so on...) Setting up include_path: In index.php add the following line:
set_include_path(getcwd().PATH_SEPARATOR.'.');So when you call require_once 'Zend/something' - will work.
class Rss extends Controller {
function Rss() {
parent::Controller();
$this->load->helper('text');
$lang = $this->phpsession->get('lang');
if(empty($lang)){
$lang = 'ro';
}
//...
}
/**
* last 10 news
*
*/
function news()
{
#load up zend feed
require_once 'Zend/Feed.php';
$array = array(
'title' => 'FEED TITLE HERE', //required
'link' => $_SERVER['REQUEST_URI'], //required
'lastUpdate' => time(), // optional
'published' => time(), //optional
'charset' => 'utf8', // required
'description' => 'COMPANY NAME news feed', //optional
'author' => 'COMPANY NAME', //optional
'email' => 'office@example.com', //optional
'webmaster' => 'office@example.com',
'copyright' => 'All rights reserved COMPANY NAME', //optional
'image' => 'http://www.example.com/logo.gif', //optional
'generator' => 'myZFeed', // optional
'ttl' => '60'
);
$fields = array('title','short_descr','descr');
$lang = $this->phpsession->get('lang');
if($lang=='en'){
//smart piece of code :)
$sql_select_fields = array_reduce($fields,create_function('$v,$a','$a .= \'_en as \'.$a;$v.=\',\'.$a; return $v;'));
} else {
$sql_select_fields = ','.implode(',',$fields);
}
//table name, news in Romanian
$table = 'noutati';
$limit = 10;
$this->db->select('id '.$sql_select_fields.', UNIX_TIMESTAMP(dt) as rss_timestamp');
$this->db->where('visible',1);
$this->db->order_by("dt", "desc");
$query = $this->db->get($table,$limit);
foreach ($query->result() as $row){
$array['entries'][] = array(
'title' => $row->title, //required
'link' => $this->config->config['base_url'].'/start/news_details/'.$row->id,
'description' => word_limiter($row->short_descr, 20),
'content' => $row->descr,
'lastUpdate' => $row->rss_timestamp
);
}
$rssFeedFromArray = Zend_Feed::importArray($array, 'rss');
$rssFeedFromArray->send();
}
}
That's it. Now you have a working rss feed in a CodeIgniter application powered by Zend_Feed :)
Session is opened to questions :).
Note: will not share the 12k lines of code file... Not sure about copyright and stuff....
Tuesday, December 30, 2008
Zend Framework - disable layout and view rendering
I wanted to add rss to a list of items for the todo list application. I used Zend_Feed for creating the rss... But, my application has a layout and a view and I needed to disable layout and view. This solves it:
public function rssAction()
{
#disable layout
$this->_helper->layout()->disableLayout();
#disable view rendering
$this->_helper->viewRenderer->setNoRender();
//other stuff here
}


