Magento Store View - Incorrect Currency Displayed - magento

I've gone through and set up an additional store view for our Magento store. The purpose of this view is to allow the display of different currency (for now) with future plans to allow language, content, etc based on store view.
Everything seems pretty normal. When I go to www.example.com/au - I get the standard version of the site with $AU as the currency.
When I navigate to www.example.com/us - The proper currency conversion is happening, showing in $US, but only in the mini-cart and checkout. The category and product view pages are still displaying the $AU value.
Those template files were completed by a different developer, and so I'm assuming they used the wrong function to grab the price of each item. They used:
<?php echo number_format($_product->getPrice(), 2) ?>
I'm thinking I need to toss in the proper function that grabs the price based on store view id, but I'm having difficulty tracking this down.
Any help, of course, and as always, much appreciated.
Update:
I ended up using this, and it works how I wanted:
$this->getPriceHtml($_product, true)

I know this is old but I came across this while looking for an answer the same question.
You can use:
Mage::helper('core')->currency($_product->getPrice())
This formats the price (removes trailing zeros) and converts to the correct currency. Also works if the user changes their currency.

Try
<?php echo $_product->getFormatedPrice(); ?>
it will format price according current store currency rules (see Mage_Directory_Model_Currency::format() for more info).

Related

Modify 'order view' total credit card in one page checkout based on selected currency

In Magento 1.8.1, if I am changing the base currency then at the final step of the checkout i.e., order review section, we come across a row "Your credit card will be charged for".
I wanted to change the amount shown beside this in the selected currency instead of the base currency of the store! This is the core functionality of Magento but I want to change it.
I think it requires me to override the core code but I don't know how to achieve this.
Check this out - http://inchoo.net/magento/how-to-add-currency-selector-to-magentos-header/
Hope this works.

Magento translate tags

i have a magento installation wich works pretty well.
So far so good, i've set up different Store Views to manage the store in different languages.
Now, i have the following problem:
I've set up tags from the administration and assigned them to the different products in the different store views (let's say i assign the tag "Buch" to a Product in the german store view, i assign the tag "Book" to the same product in the english store view.
If then a user clicks on one of the tag-names it shows the list of products with the same tag.
But if he changes store-view then, magento keeps the same tag and says that there are no products with that tag.
This seems quite logically, because tags (as far as i understood) are not translatable.
What i want magento to do, is that if a user changes store-view in the list with the products, use a translation of the tag (lets say, a user sees all the products with the tag "buch" and changes the view to english, he sees all the products with the tag "book", or, if that is not possible, when changing store-view, that he always goes to the store homepage.
Thanks 100000 times in advance =)
The only solution I see is to translate tags manually. To do this you have to modify all occurrences of your tags in your templates. For example in template/tag/cloud.phtml replace
<?php echo $this->htmlEscape($_tag->getName()) ?>
with
<?php echo $this->htmlEscape($this->__($_tag->getName())) ?>
And then add the translation for each tag into app/design/frontend/[your-interface]/[your-theme]/locale/de_DE or any other language.
As an alternative solution you can create a custom module which will override $_tag->getName() function and add $this->__() in there.

Magento - Not able to display tier pricing in product view

I have a different price set for products based on customer group. I want to show both price's to the customer in case both of them apply in product list, view, related and upsell products.
I turned on template path hints to verify that prices for all views are being rendered from the same template file, which is as follows:
/app/design/frontend/default/my_theme/template/catalog/product
I can see tier pricing correctly in product list, related and upsell products, but NOT for product view.
After debugging for a while I have narrowed down the problematic part of catalog/product/price.phtml file as follows:
<?php
$_coreHelper = $this->helper('core');
$_weeeHelper = $this->helper('weee');
$_taxHelper = $this->helper('tax');
$_product = $this->getProduct();
$_id = $_product->getId();
echo 'Product Id: ' . $_id;
$_weeeSeparator = '';
$_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices());
echo 'Simple Price Tax: ' . $_simplePricesTax;
$_minimalPriceValue = $_product->getMinimalPrice();
echo 'Minimal Price Value: ' . $_minimalPriceValue;
//$_minimalPriceValue = 41;
$_minimalPrice = $_taxHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax);
echo 'Minimal Price: ' . $_minimalPrice;
//$_minimalPrice = 41;
?>
I have echoed all prices fetched from models above, and only in case of product view page the $_product->getMinimalPrice() above does not return anything, while it appears correctly on list, related and upsell products.
I cannot think of any reason for this. There are a few lines different in catalog.xml but I don't think they have anything to do with this. Besides, there are a couple of commented lines in the above code, where I have hard-coded the minimalPrice and minimalPriceValue variables. After doing that the price starts appearing in product view also. The Product id for all views including product view is also appearing correctly, so the product IS loaded at that time.
We are using a custom template, and I see that in default we are not having this problem. I am using Magento 1.4.1.1
Did you say that what you are trying to do works 100% with a stock theme? If so then you really should look at the differences between your custom theme and the default. Also, you might want to look at any changes the developer made in app/code/community and app/code/local that are customizations for the theme. There could be some conflict.
But if you can't find a difference maybe I can give a few hints as to why you might be seeing this behavior. Sometimes the same model (and block) objects have different data in them when you are viewing on the category list page vs the product view page. The reason is that backend queries to the database are different. I did some work with the tiering system before and I remember that when you are looking at the catalog page, the pricing data actually comes from some catalogindex_* tables rather than the catalog_product_entity_* tables. If I remember correctly, there are two tables that it queries, something like catalogindex_price and catalogindex_minimal_price. But then when you are at the product view page the pricing data comes from the standard catalog_product_entity_* and catalog_product_entity_tier_price tables. Anyway, that probably doesn't solve your problem, but it might get you pointed in the right direction. Good luck.

Magento - Have different set of fields and labels for cart and checkout (order review) screens

In the Magento default theme's cart page we see the following totals box towards the right mid of the screen:
My Problem is to show the Tax and Grand Total Including tax fields to appear in the cart, because the tax is calculated once we know the shipping address. So, we want to show it only in the Checkout Screen under Order Review. However, when overriding the template/ file mentioned above, also modifies the Order Review field in checkout, so that it looks like this:
and onepage checkout order review screen like
which means that these fields are being controlled from one set of file(s). However, I want these two (totals box in cart AND order review in checkout) to be different.
By turning on the template path hints I know that the child templates for each of subtotal, tax, total... are being called from:
Cart: /checkout/cart.phtml
Checkout (One page): /checkout/onepage/review/info.phtml
Both of these have this common line, which I believe does the trick
$this->getChildHtml('totals')
Can someone help me in knowing how does getChildHtml looks up the 'totals' file. I am confused because there is a totals.phtml in checkout/onepage/review folder, while both of them are actually using template files in /tax/checkout
I am using Magento 1.4.1.1 and background to this question is a previous question
From your previous question you already know the output comes from the file template/tax/checkout/grandtotal.phtml. It's decision to show a 1 or 3 totals lines is based on this snippet:
<?php if ($this->includeTax() && $this->getTotalExclTax()>=0):?>
I would suggest changing it to...
<?php if ($this->includeTax() && $this->getTotalExclTax()!=$this->getTotal()):?>
Here, when the address is unknown and tax is zero, the two grand totals are equal and so only one is shown.
This is doubly beneficial, when an address is supplied by the "Shipping and Tax Estimate" form then the cart can still go back to the 3-line output automatically which is smooth.
You have several options
You can sniff the location of the user with GeoIp and set at least the country in quote billing address so you'll get the tax estimates to display. For example to get the UK estimates you can do (if quote exists) <?php $this->getQuote()->getBillingAddress()->setCountryId('UK');?> or <?php $this->getQuote()->getShippingAddress()->setCountryId('UK');?>
You can change the template file to be different in cart and in checkout by modifying the checkout.xml layout file and make your conditions in separate files

Magento admin section

Hai
In my magneto project, admin side invoices, I want to display the product name, sku and
manufactures, is it possible???
I know that when clicking View Link I can show, but I want to show the details in the table in the invoices page
Probably the best place to start is:
/app/design/adminhtml/default/default/tempalte/sales/order/invoice/view/
Everything within the /app/design/adminhtml/ is where you'll want to go to edit any available templates for the backend.
Remember that Magento is full of magic methods. So, often times if you want to output a particular attribute, simply call something like: echo $_item->getManufacturer();
Hope that helps.

Resources