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 | |
$this->startSetup(); | |
$this->addAttribute('catalog_category', 'inkclub', array( | |
'group' => 'General Information', | |
"type" => "int", | |
"backend" => "", | |
"frontend" => "", | |
"label" => "Inkclub", | |
"input" => "select", | |
"class" => "", |
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 | |
/** | |
* allActiveCategories.php | |
* | |
* Gets all active catgories and writes them to a file "categories.csv" | |
* Put this in your magento 1 webroot and run from your browser | |
* krillo | |
*/ | |
require __DIR__ . '/app/Mage.php'; | |
Mage::app(Mage_Core_Model_App::ADMIN_STORE_ID)->setUseSessionInUrl(false); |
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 | |
//loop through configurable prods children and get a custom attribute articlegroup | |
$_product = $this->getProduct(); | |
$productType = $_product->getTypeID(); | |
$articleGroup = ''; | |
if ($productType == 'configurable') { | |
$childProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($_product->getID()); | |
foreach ($childProducts[0] as $childId => $value) { | |
$child = Mage::getModel('catalog/product')->load($childId); | |
$articleGroup = $child->getArticlegroup(); |
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
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
var minHeight = 0; | |
$('.macro-env-images li img').each(function (index) { | |
height = $(this).height(); | |
console.log(index + ": " + $(this).height()); | |
if (index === 0) { | |
minHeight = height; | |
} | |
if (height > 0 && height < minHeight) { |
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
/** | |
* Generate campaign codes | |
* @param type $cuponRuleId | |
* @param type $nbr | |
* @param type $prefix | |
* @param type $suffix optional | |
* @return type | |
*/ | |
public function generateCampaignCode($cuponRuleId, $nbr, $prefix, $suffix = '') { | |
$rule = Mage::getModel('salesrule/rule')->load($cuponRuleId); // Get the rule in question |
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 | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface'); | |
$qty = $StockState->getStockQty($_product->getId()); | |
var_dump($qty); | |
?> |
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
//to get a translation in a module | |
$unit = Mage::helper('core')->__($unitCode); |
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
load prod with alla attributes | |
----------------------------- | |
$_prod = Mage::getModel('catalog/product')->load($this->getProduct()->getId()); | |
Store codes | |
-------------- | |
// Gets the current store's details | |
$store = Mage::app()->getStore(); |
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
<script> | |
require(['jquery'], function ($) { | |
$(document).ajaxComplete(function (event, xhr, settings) { | |
if (settings.url.indexOf("customer/section/load/?sections=cart") > 0) { | |
cartObj = xhr.responseJSON; | |
console.log(cartObj); | |
cartPriceHtml = cartObj.cart.subtotal_excl_tax; | |
$(".cpa-cart-sum-sum").html(cartPriceHtml); | |
}); | |
}); |
OlderNewer