Magento – Individual options – Show total price / not + and –

Picture

Use the custom options for different items “Extras” Article to be addressed. If changes are to be deducted or (e.g.. Color change, Accessories…) but weights can thus be detected, without directly via a configurable product always new items must be created (inventory management for the options but falls flat).

Now these options are standard with a “+” and a charge for “-” vesehen for discount. But if the final price shown directly will, This can happen through a change in a file.

It would be fine to write your own template files for this. Thus, one should make it, be sure to update. But who wants a quick solution, the file

Abstract.php in the folder app/code/core/Mage/Catalog/Block/Product/View/Options adapt. This takes about. from line 127

$priceStr = $sign;
$_priceInclTax = $this->getPrice($value[‘pricing_value’], true);
$_priceExclTax = $this->getPrice($value[‘pricing_value’]);

These three lines can be replaced e.g.. by

# $priceStr = $sign;
$_priceInclTax = $this->getPrice($value[‘pricing_value’], true)+$this->getProduct()->getFinalPrice();
$_priceExclTax = $this->getPrice($value[‘pricing_value’])+$this->getProduct()->getFinalPrice();

wherein the “#” this line is commented out and therefore no “+” and “-” be used more. Since the sign line is commented out (You can also delete), the lines above could also, to define the sign be removed

$sign = ‘ ’;
if ($value[‘pricing_value’] < 0) {
$sign = ‘-‘;
$value[‘pricing_value’] = 0 – $value[‘pricing_value’];Picture

As I said,, This is a quick solution, But the result leads to.

A medium-fast method is to copy the Abstract.php and put it in the folder / app / code / local / Mage / Catalog / Block / Product / View / Options. Change in this file will override the core file. Thus, the change is already significantly more secure update.

P.S. Configurable products is not suitable for this solution. We recommend this extension.

Used in Magento Version 1.5.1.0 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

20 comments on “Magento – Individual options – Show total price / not + and –”

      1. let's talk of the configurable products, right? So I installed the code exactly and with me doing purely garnix 🙁 it looks exactly like the pulldown ago…

  1. P.S. In this example, there was no way for a configurable product. It is only, that you can save with the options one or the other KOPRO.

          1. Thanks for the tip. However, this is not even the answer to the question posed in the article or. the solution to the problem.
            This will remove even “only” prices. Is desired but, that the final prices will be displayed directly after the option.
            But as said, Thanks for pointing!

  2. This is cool. Game wins the folded. 70Haha gesparrt € programmer

    Do you have a solution for discount prices?
    Because he does not expect up to the individual options.
    Have taken as the quantity discount. If I'm doing as the strike price but discount, then he says at the end when e.g. 100 piece:

    Regular Price:30,13 €
    Special Price:30,00 €

    It would actually be € 13 and not 13 cent.

  3. Now get the following error?

    2012-11-15T20:32:24+00:00 ERR (3): Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/schnellg/public_html/app/code/core/Mage/Captcha/Model/Observer.php on line 166

    2012-11-15T20:32:56+00:00 ERR (3): Notice: Undefined variable: priceStr in /home/schnellg/public_html/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php on line 135

    2012-11-15T20:33:45+00:00 ERR (3): Notice: Undefined index: invoice in /home/schnellg/public_html/app/code/core/Mage/Paypal/Model/Ipn.php on line 171

  4. Hallo,

    thanks for this post, have searched for an eternity then. But I have another question: How can I “Catalog price rules” apply to the prices of individual options? My pricing rules will apply only to the main prize.

    Thank you in advance for an answer.

    VG, Afshin

  5. Die Anführungszeichen sind oben nicht korrekt gesetzt, so dass es nicht funktioniert, wenn man den Code kopiert. Hier die korrekte Version:

    $_priceInclTax = $this->getPrice($value[‘pricing_value’], true)+$this->getProduct()->getFinalPrice();
    $_priceExclTax = $this->getPrice($value[‘pricing_value’])+$this->getProduct()->getFinalPrice();

  6. Hallo ,

    kennt jemand eine Lösung,
    Wenn ich Filter wird nur der Configurierbare Produkt berücksichtigt aber nicht der Preis vom einfachen Produkt.

    Example

    Configurable product
    Name: Gold

    Price from 1000,–

    Varianten : 0,0001 KG 1.000
    1 KG 25.000
    2 Kg 50.000

    etc..

    If I Will Filter is the only range to 1000,–
    die Einfachen Produkte sind einzeln nicht sichtbar.

    Vielen Dank für eure Hilfe

    John

Leave a Reply

Your email address will not be published. Required fields are marked *