This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Form validation | |
/* Form Required Field Validation */ | |
foreach($_POST as $key=>$value) { | |
if(empty($_POST[$key])) { | |
$error[] = "All Fields are required"; | |
break; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container" style="width:500px;background:#E6EFCB;"> | |
<?php if(!empty($error)):?> | |
<div class="alert alert-danger"> | |
<?php foreach($error as $value):?> | |
<?php print $value?><br> | |
<?php endforeach;?> | |
</div> | |
<?php endif;?> | |
<?php if(isset($_GET['msg'])&& $_GET['msg']==1):?> | |
<div class="alert alert-success"> <strong>Success!</strong> Regsitered successfully. </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$product = Mage::getModel('catalog/product')-load(1000) //1000 is product id | |
$brandText = $product->getAttributeText('brand'); | |
print $brandText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace source | |
$('img').error(function(){ | |
$(this).attr('src', 'no-image.png'); | |
}); | |
// Or, hide them | |
$("img").error(function(){ | |
$(this).hide(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REMOTE_ADDR} !^94\.12\.10\.148 | |
RewriteCond %{REQUEST_URI} !^/maintenance\.html$ | |
RewriteRule ^(.*)$ http://yourdomain.com/maintenance.html [R=307,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} !^/maintenance\.html$ | |
RewriteRule ^(.*)$ http://yourdomain.com/maintenance.html [R=307,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$order = new Mage_Sales_Model_Order(); | |
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); | |
$order->loadByIncrementId($orderId); | |
?> | |
<h2><?php echo $this->__('Tutsplanet Payment Gateway') ?></h2> | |
<p>It's a demo page acting as a payment gateway interface!</p> | |
<form name="custompaymentmethod" method="post" action="<?php echo Mage::helper('localpay')->getPaymentGatewayUrl(); ?>"> | |
<input type="hidden" name="orderId" value="<?php echo $orderId; ?>"> | |
<input type="submit" value="<?php echo $this->__('Make Payment') ?>"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<Tutsplanet_Localpay> | |
<active>true</active> | |
<codePool>local</codePool> | |
<depends> | |
<Mage_Payment/> | |
</depends> | |
</Tutsplanet_Localpay> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<sections> | |
<payment> | |
<groups> | |
<localpay translate="label" module="localpay"> | |
<label>Localpay</label> | |
<sort_order>1000</sort_order> | |
<show_in_default>1</show_in_default> | |
<show_in_website>1</show_in_website> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/code/local/Tutsplanet/Localpay/controllers/PaymentController.php | |
class Tutsplanet_Localpay_PaymentController extends Mage_Core_Controller_Front_Action | |
{ | |
/** | |
* Rendering the layout | |
*/ | |
public function redirectAction() |