Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

change price next to custom option to = total price, rather than + amount
 
Mexx
Member
 
Avatar
Total Posts:  35
Joined:  2007-09-04
Germany
 

Hey guys,

I would like to have the total price displayed next to a custom option. By default Magento adds a + and the amount to be added next to a custom option.

In order to achieve that I changed in app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php

this code:

if ($flag{
            $priceStr 
'<span class="price-notice">'.$priceStr.'</span>';

        
}

to that code:

if ($value['pricing_value'== 0{
         $priceStr 
'<span class="price-notice"><strong>= 10,00 EUR</strong></span>';
   
}
else {
      $priceStr 
'<span class="price-notice"><strong>= 20,00 EUR</strong></span>';
}

This works, but isn’t helpful at all because the price is hard coded. The problem is, that I am not familiar enough with Magentos API and I dont know, how to call the classed correctly. What I tried was that, but it doesnt work:

if ($value['pricing_value'== 0{
         $priceStr 
'<span class="price-notice"><strong>= '.$_product->getProductPrice();.'</strong></span>';
   
}
else {
      $priceStr 
'<span class="price-notice"><strong>= '.$_product->getProductPrice() + $value['pricing_value'];.'</strong></span>';
}

Can someone help to achieve that? I know, I could use bundled pruduct and all that, but I wont to stay with simple product because they are fine for my environment. All I miss is the problem described above.

Thx a lot! Max

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mexx
Member
 
Avatar
Total Posts:  35
Joined:  2007-09-04
Germany
 

not a single hit within 13 hours not to mention an answer… Come on, what happened to the Magento Community?

 
Magento Community Magento Community
Magento Community
Magento Community
 
webplus
Member
 
Avatar
Total Posts:  46
Joined:  2008-11-06
 

dying....Enterprise killed it and Var does not care about us anymore

 
Magento Community Magento Community
Magento Community
Magento Community
 
keijers
Jr. Member
 
Total Posts:  15
Joined:  2012-10-15
 

I want to know this too! Anyone>

--------------edit---------------

Found it, very easy to fix:

http://sourcelibrary.org/2011/04/21/magento-custom-options-change-the-option-to-show-total-price/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top