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
// Fire event 'change' prototype manual | |
var element = $(selectorId); | |
// Create html event | |
var evt = document.createEvent("HTMLEvents"); | |
evt.initEvent('change', true, true); | |
// Set value configurable product | |
element.value = xxx; | |
// Fire event | |
element.dispatchEvent(evt); |
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 | |
// Sub words with length | |
function truncate( $text, $length = 100, $more = null ) { | |
if ( null === $more ) | |
$more = ' ...'; | |
$text = strip_tags( $text ); | |
$text = substr($text, 0, $length - strlen($more) + 1); | |
$words_array = preg_split("/[\s]+/", $text); | |
array_pop( $words_array ); |
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
0. Magneto Debug | |
http://connect20.magentocommerce.com/community/MagnetoDebug | |
1. Attribute Splash Pages | |
http://connect20.magentocommerce.com/community/Fishpigs_Attribute_Splash_Page | |
2. Multiple Select In Layered Navigation (Filters) | |
http://connect20.magentocommerce.com/community/Mana_Filters | |
3. Instagram Extension |
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
<VirtualHost *:80> | |
ServerName wp.local | |
DocumentRoot "/var/www/wp" | |
<Directory "/var/www/wp"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Require all granted | |
</Directory> | |
## Must have | |
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/wp/$1 |
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
#Add new vhost in Nginx | |
server { | |
listen *:80; | |
server_name example.local www.example.local; | |
index index.html index.htm index.php; | |
access_log /var/log/nginx/example.local.access.log; | |
error_log /var/log/nginx/example.local.error.log; |
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
#Vhost in Apache 2 | |
<VirtualHost *:80> | |
ServerName netshirt.local | |
## Vhost docroot | |
DocumentRoot "/var/www/netshirt" | |
## Directories, there should at least be a declaration for /var/www/netshirt | |
<Directory "/var/www/netshirt"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All |
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
// Get attribute object by code | |
Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', 'color'); | |
// Get entity type object by code | |
Mage::getModel('eav/entity_type')->loadByCode('catalog_product'); | |
// =========================================================== | |
public function joinEavTablesIntoCollection($collection, $mainTableForeignKey, $eavType) | |
{ | |
$entityType = Mage::getModel('eav/entity_type')->loadByCode($eavType); | |
$attributes = $entityType->getAttributeCollection(); |
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
// Get new url base current url | |
$url = Mage::getUrl('/*/*', array( | |
'_use_rewrite' => true, | |
'_query' => array( | |
'param1' => 'param1', | |
'param2' => 'param2', | |
'param3' => 'param3', | |
), | |
)); | |
// Get current url |
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
// Change product attribute value | |
public function run() | |
{ | |
// --edit 1-10,color,5 | |
// $default = array( | |
// 'product_ids' => array(1, 10), | |
// 'attribute_code' => 'color', | |
// 'attribute_value' => 5 | |
// ); | |
if (isset($this->_args['edit'])) { |
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 categoryTravel($category, $level) | |
{ | |
$result = new Varien_Data_Collection; | |
if (is_numeric($category)) { | |
$category = Mage::getModel('catalog/category')->load($category); | |
} | |
$this->_categoryTravel($result, $level, $category); | |
return $result; |
OlderNewer