HTML

<div class="cart-container"> 
    <a href="#" class="cart">Cart</a>
    <ul class="cart-scroll">
        Content
    </ul>
</div>

CSS

.cart-container {
      width: 250px;
      position: relative;
  }
  .cart {
      color: #000000;
      background: #cccccc;
      padding: 10px;
      text-decoration: none;
      line-height: 30px;
      float: left;  
  }
  .cart-scroll {
      background: #F5F5F5;
      opacity: 0;
      position: absolute;
      left: 0;
      top: 30px;
      text-align: left;
      transform: scaleY(0);
      transform-origin: 0 0 0;
      transition: all 0.5s ease 0s;
      visibility: hidden;
      width: 250px;
      z-index: 99999;
      padding: 20px;
  }
  .cart-container:hover ul.cart-scroll {
      opacity: 1;
      transform: scaleY(1);
      visibility: visible;
  }
Advertisements

You can change position by overriding the file vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml

<?php if ($block->hasSpecialPrice()): ?>
    <span class="special-price">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
            'display_label'     => __('Special Price'),
            'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
            'price_type'        => 'finalPrice',
            'include_container' => true,
            'schema' => $schema
        ]); ?>
    </span>
    <span class="old-price">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
            'display_label'     => __('Regular Price'),
            'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
            'price_type'        => 'oldPrice',
            'include_container' => true,
            'skip_adjustments'  => true
        ]); ?>
    </span>
<?php else: ?>
    <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
        'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
        'price_type'        => 'finalPrice',
        'include_container' => true,
        'schema' => $schema
    ]); ?>
<?php endif; ?>

TO

<?php if ($block->hasSpecialPrice()): ?>
    <span class="old-price">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
            'display_label'     => __('Regular Price'),
            'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
            'price_type'        => 'oldPrice',
            'include_container' => true,
            'skip_adjustments'  => true
        ]); ?>
    </span>
    <span class="special-price">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
            'display_label'     => __('Special Price'),
            'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
            'price_type'        => 'finalPrice',
            'include_container' => true,
            'schema' => $schema
        ]); ?>
    </span>
<?php else: ?>
    <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
        'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
        'price_type'        => 'finalPrice',
        'include_container' => true,
        'schema' => $schema
    ]); ?>
<?php endif; ?>

Call Media Images in PHTML Files

<img src="<?php echo $mediaUrl.'wysiwyg/demo.jpg'; ?>" />

Call Web Images in PHTML File

<img src="<?php echo $this->getViewFileUrl('images/demo.png'); ?>" />

Call Web Images in Static block and CMS page

<img src="{{view url="images/demo.jpg"}}" />

Call Media Images in Static block and CMS page

<img src="{{media url='wysiwyg/demo.png'}}; ?>" />

this class needs to be added to the map div = gmap-wrapper
this class needs to be added to the iframe as a class = scrolloff

CSS

.scrolloff
{ pointer-events: none; }

HTML

<div class="gmap-wrapper">					
	<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d14695.074973989373!2d72.6236405!3d22.9587424!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x4b7d4042cc4ba9d9!2sTankar+Residency%2C+Dibiyapur%2C+Vatva%2C+Ahmedabad%2C+Gujarat+382445!5e0!3m2!1sen!2sin!4v1499159481841" width="600" height="450" frameborder="0" style="border:0"  class="scrolloff"></iframe>
</div>

jQuery

<script type="text/javascript">
// DISABLE MOUSE SCROLL IN MAPS
// enable the pointer events only on click;
	jQuery(document).ready(function( $ ) {
		$('.gmap-wrapper').on('click', function ()
			{ $('.gmap-wrapper iframe').removeClass('scrolloff'); // set the pointer events true on click 
		});
		// you want to disable pointer events when the mouse leave the canvas area;
		$(".gmap-wrapper").mouseleave(function (){ 
			$('.gmap-wrapper iframe').addClass('scrolloff'); // set the pointer events to none when mouse leaves the map area 
		});
	});
</script>

Magento 2 : Add Custom link in header

Posted: October 29, 2016 in Magento2

<block class="Magento\Framework\View\Element\Html\Link\Current" name="test" before="-">
	<arguments>
		<argument name="label" xsi:type="string">Test</argument>
		<argument name="path" xsi:type="string">test</argument>
	</arguments>
</block>

Call PHTML file In CMS page:

{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/test.phtml"}} 

Call PHTML file in XML:

<referenceContainer name="footer">                
            <block class="Magento\Framework\View\Element\Template" name="footer.hcontent" template="Magento_Theme::html/footer.phtml">
                <container name="hcontent" label="footer content"/>
            </block>
</referenceContainer>

Text in PHTML file:

<?php echo __('Create Backup') ?>

If your string contains a variable, to add a placeholder for this variable in the dictionary, use syntax similar to the following:

<?php echo sprintf(__('Hello %s'), $yourVariable) ?>

In Phtml File:

<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_identifier')->toHtml();?>

in CMS Content:

{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}}

In Xml File:

<referenceContainer name="content">
	<block class="Magento\Cms\Block\Block" name="block_identifier">
		<arguments>
			<argument name="block_id" xsi:type="string">block_identifier</argument>
		</arguments>
	</block>
</referenceContainer>