Magento: How to override/rewrite model class in Magento

Magento: How to override/rewrite model class in Magento
Magento: How to override/rewrite model class in Magento

In many cases we need to extend a Magento core functionality.
What should be the best way to do this? We could just copy the core model class file to the local directory from core. This could be the easiest way, but far from the best.
The cleaner way would be to override/rewrite a core module class.
How to do that? Well, bellow we will present an example.

Override the sales order model (Mage_Sales_Model_Order class):
(more…)

Continue ReadingMagento: How to override/rewrite model class in Magento

Cpanel/Webmail Login – IP Address has Changed! – How to login through Dynamic IP Internet Connections

Just like the title above happens if you login to the Cpanel / Webmail using Internet connections that have a dynamic IP. Dynamic IP is the IP numbers that change itself is happening on the ISP (Internet Service Provider). Usually the GSM modem based ISP.

Cpanel/Webmail Login - IP Address has Changed!
Cpanel/Webmail Login – IP Address has Changed!

(more…)

Continue ReadingCpanel/Webmail Login – IP Address has Changed! – How to login through Dynamic IP Internet Connections

PHP: Convert string to variable?!

  • Post category:PHP
  • Post comments:0 Comments

PHP: Convert string to variable?!
PHP: Convert string to variable?!

Problem:

$button0 = "candy";
$button1 = "pop";
$button2 = "nuts";
$button3 = "sugar";

$buttons = 4;
$counter = 0;
while ($counter < $buttons) {
$printbutton = "$"."button".$counter;
echo($printbutton."<br />"); // echos $button0 but not the value of $button0
$counter = $counter+1;
}

What happens is that $printbutton always prints $buttonx (where x = $count) but I want it to print candy or nuts or whatever $buttonx’s value is.

Solution:
(more…)

Continue ReadingPHP: Convert string to variable?!