Skip to content

Instantly share code, notes, and snippets.

View deivisonarthur's full-sized avatar

Deivison Arthur Lemos Serpa deivisonarthur

View GitHub Profile
<customer_account_create>
<reference name="customer_form_register">
<action method="setTemplate"><template>novoatributo/persistent/customer/form/register.phtml</template></action>
</reference>
</customer_account_create>
<customer_account_edit>
<reference name='customer_edit'>
<action method="setTemplate"><template>novoatributo/customer/form/edit.phtml</template></action>
</reference>
</customer_account_edit>
@deivisonarthur
deivisonarthur / apenasnum.js
Created October 18, 2012 17:09 — forked from Vampre/apenasnum.js
Função apenas números (limita a digitação somente de números em campos "text") colocar em <input type='text' onkeypress='return Apenas_Numeros(event);'>
function Apenas_Numeros(caracter)
{
var nTecla = 0;
if (document.all) {
nTecla = caracter.keyCode;
<?php foreach($this->getParcelas() as $parcela): ?>
<?php
if( $parcela['parcela'] <= 2 ){
?>
<label style="clear: both !important; padding: 0px !important"><input style="width: 20px !important" type="radio" id="cielo_cc_parcelas_<?php echo $parcela['parcela']; ?>" name="payment[cc_parcelas]" class="validate-one-required-by-name" value="<?php echo $parcela['parcela']; ?>"><strong><?php echo $parcela['label']; ?></strong> <em><?php if( $parcela['parcela'] != 1 ): echo "(Sem juros)"; endif; ?></em> </label><br />
<?php
}
if( $parcela['parcela'] == 3 && $total > 70 || $parcela['parcela'] == 3 && $total < 150 && $total > 70 ){
<?php foreach($this->getParcelas() as $parcela): ?>
<?php
if( $parcela['parcela'] <= 2 ){
?>
<label style="clear: both !important; padding: 0px !important"><input style="width: 20px !important" type="radio" id="cielo_cc_parcelas_<?php echo $parcela['parcela']; ?>" name="payment[cc_parcelas]" class="validate-one-required-by-name" value="<?php echo $parcela['parcela']; ?>"><strong><?php echo $parcela['label']; ?></strong> <em><?php if( $parcela['parcela'] != 1 ): echo "(Sem juros)"; endif; ?></em> </label><br />
<?php
}
if( $parcela['parcela'] == 3 && $total < 150 && $total > 70 ){
$results = Mage::getModel('xyz/abc')->getCollection();
$results->addFieldToSelect('name');
$results->addFieldToSelect('keywords');
$results->addOrder('name','ASC');
$results->setPageSize(5);
$results->getSelect()->where("keywords like '%foo%' or additional_keywords like '%bar%'");
$results->load();
//for AND
$collection = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect('*')
->addFieldToFilter('my_field1', 'my_value1')
->addFieldToFilter('my_field2', 'my_value2');
echo $collection->getSelect()->__toString();
//for OR - please note 'attribute' is the key name and must remain the same, only replace //the value (my_field1, my_field2) with your attribute name
## railsbox.org:~ ozeias$ vim /usr/local/nginx/conf/vhosts/example.com.conf
# This is for a WordPress installed at /var/www/example.com/blog, and accessed at http://example.com
server {
listen 80;
server_name example.com;
root /var/www/example.com/blog;
index index.php;
access_log /usr/local/nginx/logs/example.com.access.log;
## railsbox.org:~ ozeias$ vim /usr/local/nginx/conf/vhosts/blog.example.com.conf
# This is for a WordPress installed at /var/www/example.com/blog, and accessed at http://blog.example.com
server {
listen 80;
server_name blog.example.com;
root /var/www/example.com/blog;
index index.php;
access_log /usr/local/nginx/logs/blog.example.com.access.log;
## railsbox.org:~ ozeias$ vim /usr/local/nginx/conf/vhosts/example.com.conf
# This is for a WordPress installed at /var/www/example.com/blog, and accessed at http://example.com/blog
server {
listen 80;
server_name example.com;
root /var/www/example.com;
index index.php;
access_log /usr/local/nginx/logs/example.com.access.log;
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;