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
public function createVoucher($value=0, $cardnumber){ | |
$voucher_id = Mage::getModel('salesrule/coupon')->load($cardnumber . '-' . Mage::helper('checkout')->getQuote()->getId(), 'code'); | |
if($voucher_id->getRuleId()){ | |
$cartpriceRule = Mage::getModel('salesrule/rule')->load($voucher_id->getRuleId()); | |
$cartpriceRule->setDiscountAmount($value); | |
}else{ | |
$cartpriceRule = Mage::getModel('salesrule/rule'); | |
$cartpriceRule->setName('Giftcard '. $cardnumber); | |
$cartpriceRule->setDescription('Giftcard '. $cardnumber); |
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
$installer = $this; | |
$installer->startSetup(); | |
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'brand', array( | |
'group' => 'General', | |
'attribute_set' => 'Default', | |
'type' => 'int', | |
'label' => 'Brand', | |
'input' => 'select', |
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
#include <sourcemod> | |
#include <sdktools> | |
#include <sdkhooks> | |
//#include <sendproxy> | |
#define WATER_LEVEL_DRY 0 | |
#define WATER_LEVEL_FEET 1 | |
#define WATER_LEVEL_HALF 2 | |
#define WATER_LEVEL_FULL 3 |
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
#include <sourcemod> | |
#include <sdktools> | |
#include <sdkhooks> | |
#include <colours> | |
#pragma semicolon 1 | |
public Plugin:myinfo = | |
{ |
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" encoding = "UTF-8" ?> | |
<schema name="yes" version="1.5"> | |
<types> | |
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/> | |
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/> | |
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/> | |
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/> | |
<fieldType name="text" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> |
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" encoding = "UTF-8" ?> | |
<schema name="yes" version="1.5"> | |
<types> | |
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/> | |
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/> | |
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/> | |
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/> | |
<fieldType name="text" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.StandardTokenizerFactory"/> |
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 | |
// 1) Enabled maintenance mode by creating file .maintenance.flag in the var folder | |
// 2) By pass maintenance mode by creating file .maintenance.ip in the var folder | |
// 3) IP addresses does not work for ranges only individual ip addresses | |
if (!preg_match('/^[^\s,]+(,[^\s,]+)*$/', $addresses)) { | |
throw new \InvalidArgumentException("One or more IP-addresses is expected (comma-separated)\n"); | |
} | |
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
#!/bin/sh | |
magento deploy:mode:show | |
Current application mode: default. | |
magento deploy:mode:set developer | |
Enabled developer mode. |
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
#!/bin/sh | |
# specify directory if not in it | |
composer create-project magento/community-edition . | |
# Fix file permissions | |
find . -type d -exec chmod 700 {} \; && find . -type f -exec chmod 600 {} \; | |
# execute if you have not done so in the past | |
composer config repositories.magento composer http://packages.magento.com |
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 | |
class Blah { | |
protected $_logger; | |
public function __construct( | |
\Psr\Log\LoggerInterface $logger | |
){ | |
$this->_logger = $logger; |
OlderNewer