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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
</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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
</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
<!-- add a function to the event listener of page loded --> | |
<script> | |
window.addEventListener("load", function() { | |
console.log('krillo'); | |
$('#motivation').keypress(function (e) { | |
console.log('krillo'); | |
} | |
); | |
}, true); | |
</script> |
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"> | |
require(['jquery'], function (jQuery) { | |
jQuery(document).ready(function ($) { | |
$('#cpa-scroll-to-desc').click(function (event) { | |
event.preventDefault(); | |
$('html,body').animate({ | |
scrollTop: $(".box-collateral").offset().top - 120}, 'slow'); | |
}); | |
}); | |
}); |
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
Show static block on: | |
---------------------------- | |
cms-page | |
{{block class="Magento\\Cms\\Block\\Block" block_id="cpa-usp-block"}} | |
phtml | |
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('lilly-infobox-2')->toHtml();?> | |
Get absolute path via $objectManager | |
----------------------------------- |
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 | |
$helper = $this->helper('\Magento\Checkout\Helper\Cart'); | |
$subtotal = $helper->getQuote()->getSubtotal(); | |
$subtotalHtml = $this->helper('Magento\Framework\Pricing\Helper\Data')->currency($helper->getQuote()->getSubtotal(), true, true); | |
$grandtotalHtml = $this->helper('Magento\Framework\Pricing\Helper\Data')->currency($helper->getQuote()->getGrandTotal(), true, 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
<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); | |
}); | |
}); |
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
//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
<?php | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface'); | |
$qty = $StockState->getStockQty($_product->getId()); | |
var_dump($qty); | |
?> |
NewerOlder