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 | |
//* Change the Add To Cart Link | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'sfws_add_product_link' ); | |
function sfws_add_product_link( $link ) { | |
global $product; | |
$product_id = $product->id; | |
$product_sku = $product->get_sku(); | |
$link = '<a href="'.get_permalink().'" rel="nofollow" data-product_id="'.$product_id.'" data-product_sku="'.$product_sku.'" data-quantity="1" class="button add_to_cart_button product_type_variable">'.sfws_woocommerce_product_add_to_cart_text().'</a>'; | |
return $link; | |
} |
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 | |
add_action( 'wp', 'add_free_product_to_cart' ); | |
function add_free_product_to_cart( ) { | |
if (!is_admin()) { | |
$count = 1; | |
$count_free = 0; |
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 | |
ini_set("memory_limit", "10000M"); | |
require_once "app/Mage.php"; | |
umask(0); | |
Mage::app(); | |
$category = Mage::getModel('catalog/category'); | |
$tree = $category->getTreeModel(); | |
$tree->load(); | |
$ids = $tree->getCollection()->getAllIds(); | |
if ($ids) { |
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 | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
require_once MAGENTO . '/app/Mage.php'; | |
Mage::app(); | |
$entity_type_id = Mage::getModel('catalog/product')->getResource()->getTypeId(); | |
prepareCollection($entity_type_id); | |
function prepareCollection($ent_type_id){ | |
$resource = Mage::getSingleton('core/resource'); |
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 #to export category name instead of category Ids, you should unparse the file app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php by copy and replace this lines (around at 402 line) | |
/** | |
* Unparse (prepare data) loaded products | |
* | |
* @return Mage_Catalog_Model_Convert_Parser_Product | |
*/ | |
public function unparse() | |
{ | |
$entityIds = $this->getData(); |
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
-- | |
-- This query delelets all customers and orders from your | |
-- Magento 1.* install. Handy, if you have a bloated | |
-- Magento database and you need to do a bit | |
-- of cleaning up for use on a local machine. | |
-- | |
-- Replace PREFIX_ with your current Magento table prefix. | |
-- | |
-- USE AT OWN RISK. ALWAY BACKUP YOUR DATABASE FIRST. | |
-- |
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 FILESYSTEM-ID-HERE and REGION-ID-HERE | |
# | |
option_settings: | |
- option_name: EFS_VOLUME_ID | |
value: FILESYSTEM-ID-HERE | |
- option_name: EFS_REGION | |
value: REGION-ID-HERE |
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
# (!) Based on : https://gist.github.com/tony-gutierrez/198988c34e020af0192bab543d35a62a | |
# Dont forget to set the env variable "CERTDOMAIN" and "EMAIL" | |
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready! | |
Resources: | |
sslSecurityGroupIngress: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]} | |
IpProtocol: tcp |
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
#ERROR 1227 (42000) at line 374: Access denied; you need (at least one of) the SUPER privilege(s) for this operation | |
sed -i old 's/\DEFINER\=`[^`]*`@`[^`]*`//g' file.sql |
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 | |
/* add these lines to /app/code/core/Mage/Sales/Model/Order/Pdf/invoice.php */ | |
/* Add Comments */ | |
$statusHistory = $order->getStatusHistoryCollection()->getData(); | |
$order_comments = ''; | |
foreach($statusHistory as $status) { | |
$new_comment = ''; | |
if ($status['comment']) { |
OlderNewer