E na função, você pode pegar usar a sintaxe i.data("price")
para pegar o valor do atributo:
Veja:
addToCartBtn= $(".add-to-cart");
addToCartBtn.on('click', function() { updateCart($(this)); });
var cartWrapper = $('.cd-cart-container'),
cartWrapperPrice = $('.add-to-cart'),
cartPrice = cartWrapperPrice.data('price'),
cartBody = cartWrapper.find('.body'),
cartList = cartBody.find('.cd-cart-items');
productAdded = $('<li><span class="cd-qty">1x</span>Produto<div class="cd-price">'+cartPrice+'</div><a href="#" class="cd-item-remove cd-img-replace">Remove</a></li>');
cartList.prepend(productAdded);
console.log("Valor fora da função: "+cartPrice);
function updateCart(i) {
var cartWrapper = $('.cd-cart-container'),
cartPrice = i.data("price"),
cartBody = cartWrapper.find('.body'),
cartList = cartBody.find('.cd-cart-items');
productAdded = $('<li><span class="cd-qty">1x</span>Produto<div class="cd-price">'+cartPrice+'</div><a href="#" class="cd-item-remove cd-img-replace">Remove</a></li>');
cartList.prepend(productAdded);
console.log("Valor dentro da função: "+cartPrice);
};
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class="add-to-cart" data-price="25.99">
<em>Adicionar ao Carrinho</em>
<svg x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32">
<path stroke-dasharray="19.79 19.79" stroke-dashoffset="19.79" fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" d="M9,17l3.9,3.9c0.1,0.1,0.2,0.1,0.3,0L23,11"/>
</svg>
</button>