This file contains hidden or 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 | |
| /* | |
| Plugin Name: Ajaxtest | |
| Plugin URI: http://enru.co.uk/ | |
| Description: spits out page/post slug on autosave/edit | |
| Version: 0.1 | |
| Author: Neill Russell (@enru) | |
| Author URI: http://enru.co.uk/ | |
| */ |
This file contains hidden or 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 product to cart with additional data | |
| $woocommerce->cart->add_to_cart($post->ID, $quantity = 1, $variation_id = '', $variation = $entry[1], $cart_item_data = array( | |
| 'hire_price'=>123, | |
| )); | |
| // make sure additional data sticks in the session |
This file contains hidden or 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
| function getProductUrlWithAttributes($product, $storeId) { | |
| $url = $product->setStoreId($storeId)->getProductUrl(); | |
| $urlHash = array(); | |
| $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()); | |
| if(isset($parentIds[0])) { | |
| $parent = Mage::getModel('catalog/product')->load($parentIds[0]); | |
| $url = $parent->setStoreId($storeId)->getProductUrl(); |
This file contains hidden or 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
| <!-- Basic Product Information --> | |
| <? | |
| // only use products with enabled parents | |
| $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()); | |
| if(isset($parentIds[0])) { | |
| $status = Mage::getResourceModel('catalog/product')->getAttributeRawValue($parentIds[0], 'status', 1); | |
| if($status != 1) $myPattern=null; | |
| } | |
| ?> | |
| <g:id><? return substr($product->getId(), 0, 50); ?></g:id> |
This file contains hidden or 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
| // dev wp config | |
| define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']); | |
| define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']); | |
| define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']); |
This file contains hidden or 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
| UPDATE wp_posts SET post_content = replace(post_content, 'http://ONE', 'http://TWO'); | |
| UPDATE wp_posts SET guid = replace(guid, 'http://ONE', 'http://TWO'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://ONE', 'http://TWO'); | |
| UPDATE wp_options SET option_value = 'http://TWO' WHERE option_name = 'siteurl'; | |
| UPDATE wp_options SET option_value = 'http://TWO' WHERE option_name = 'home'; |
This file contains hidden or 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
| for f in `find app/code/local/Mage/ -type f`; do | |
| original=`echo $f | sed 's/local/core/'`; | |
| if [ -e $original ]; then | |
| diff -u $original $f; | |
| fi | |
| done |
This file contains hidden or 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 | |
| $mage_filename = './app/Mage.php'; | |
| require_once $mage_filename; | |
| umask(0); | |
| Mage::app('admin'); | |
| error_reporting(E_ALL); | |
| Mage::app()->cleanCache(); | |
| Mage::dispatchEvent('adminhtml_cache_flush_system'); |
This file contains hidden or 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
| UPDATE wp_posts SET post_content = replace(post_content, 'http://www.foo.com', 'http://www.bar.com'); | |
| UPDATE wp_posts SET guid = replace(guid, 'http://www.foo.com', 'http://www.bar.com'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.foo.com', 'http://www.bar.com'); | |
| UPDATE wp_options SET option_value = 'http://www.bar.com' WHERE option_name = 'siteurl'; | |
| UPDATE wp_options SET option_value = 'http://www.bar.com' WHERE option_name = 'home'; |
This file contains hidden or 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
| enru@v1:~$ git diff app/code/core/Mage/Checkout/controllers/OnepageController.php | |
| diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
| index c1ea4a5..ab920ee 100644 | |
| --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
| +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
| @@ -211,6 +211,10 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
| public function successAction() | |
| { | |
| $session = $this->getOnepage()->getCheckout(); | |
| +//test |