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
# This is mostly copied from [this answer on Stack Overflow](https://stackoverflow.com/a/49452109/3330552) | |
# (Thanks [Ryan Tuck](https://github.com/ryantuck)!) | |
# except that I've included the dependencies and set this up to be called from the command line. | |
# | |
# Example call from bash to split a single CSV into multiple 100 line CSVs: | |
# python3 split_csv /path/to/my/file.csv /path/to/split_files my_split_file 100 | |
# | |
# Warning: This doesn't have any validation! This will overwrite existing files if you're not careful. | |
import csv |
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 | |
include_once "app/Mage.php"; | |
umask(0); | |
Mage::app(); | |
$layout = Mage::getSingleton('core/layout'); | |
//load default xml layout handle and generate blocks | |
$layout->getUpdate()->load('default'); | |
$layout->generateXml()->generateBlocks(); | |
//get the loaded head and header blocks and output | |
$headBlock = $layout->getBlock('head'); |
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
from openerp import tools | |
from openerp.osv import fields, osv | |
class SaleReport(osv.osv): | |
_inherit = 'sale.report' | |
_columns = { | |
'mage_store': fields.many2one('mage.store.view', 'Magento Store', readonly=True), | |
} |
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 | |
// File location: /app/code/local/Mbs/Addtocart/Model/Observer.php | |
class Mbs_Addtocartredirect_Model_Observer { | |
public function addToCartRedirect($observer) { | |
$event = $observer->getEvent(); | |
$product = $event->getProduct(); | |
$productId = $product->getId(); | |
// Add hand packing fee if product fits criteria |
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
"use strict"; | |
function change(idToChange, valueToChange, newValue) { | |
var element = document.getElementById(idToChange); | |
switch(valueToChange) { | |
case 'href': | |
element.href = newValue; | |
break; | |
case 'innerHTML': |
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
<div class="page-title category-title"> | |
<?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?> | |
<a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?></a> | |
<?php endif; ?> | |
<?php // Display normal category name as h1 unless there is an h1 set in the category description ?> | |
<?php if( $_description=$this->getCurrentCategory()->getDescription() ) { ?> | |
<?php if(strpos( $_helper->categoryAttribute($_category, $_description, 'description'), "h1" ) !== false) { ?> | |
<?php } else { ?> |
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
<html> | |
<body> | |
<p>Running</p> | |
<?php | |
include_once "app/Mage.php"; | |
umask(0); | |
Mage::app(); | |
Mage::getSingleton("core/session", array("name" => "frontend")); | |
echo "Sorry, it looks like something might have gone wrong! You might <a href='javascript:history.back()'>go back</a> and try again.<br />"; // In case a customer ends up here with an error preventing redirect |