2

I have installed free price extension, https://pluginarchive.com/magento/rp_display_price_free the extension collapse my configurable product price. How to debug which part of the extension affects my Magento core function.

Note: https://snipboard.io/I2FrSH.jpg

Thanks in advance..!

  • What you want to achieve using this plugin? Add var spConfig and var optionsPrice javascript full array into the question from website config detail page. – MageSoftech Jan 5 at 7:21
  • check the answer i guess it may help. – MageSoftech Jan 5 at 8:59
2
+100

Couple of points would like to add here that one can not easily render string (in this case its FREE - system config (displayfreeprice/general/freeprice_text) ) into the price format which may be float or decimal in most of the cases.

Although, one workaround should resolve this issue showing 0.00 instead of its value.

You can do as follows:

  1. Open <magento-root>\app\code\local\Rp\Displayfreeprice\Helper\Productprice.php

  2. Look for the function named public static function currency( $price , $format=true , $includeContainer = true )

  3. Find the below statement.

return parent::formatPrice($price, $includeContainer);

  1. Replace it with below statement.

    return parent::currency($price, $includeContainer);

Refresh the cache and session and then open configurable product page.

I guess extension vendor FORGOT to replace the function name.

|improve this answer|||||
  • May i know how did you find the error? @MageSoftech – zus Jan 6 at 8:54
  • Looked at their overwritten file and compared with the core file...Enjoy coding. – MageSoftech Jan 6 at 15:53
  • Okay, find overwritten by using Padhiyar Gaurang script then do correction. Thanks for let me know. – zus Jan 6 at 16:13
1

I didn't work with Magento 1 for a long time. It's just my suggestion: We should have Debug tools.

Price calculation flow is not easy.

Read more:

Magento 1.9 - How to debug - Configurable product price changed to 0 if chooses colors attribute

Will update more here.

|improve this answer|||||
  • Is possible configure xdebug in PHP ver 5.6 – zus Jan 4 at 11:09
  • Sure. You can do that. – Khoa TruongDinh Jan 5 at 3:13
1

create file at root of magento with name rewritelist.php and run

<?php
$foldersToCheck = array('app/code/local/', 'app/code/community/');
$configFiles = array();
foreach ($foldersToCheck as $folder){
    $files = glob($folder.'*/*/etc/config.xml');//get all config.xml files in the specified folder
    $configFiles = array_merge($configFiles, $files);//merge with the rest of the config files
}
$rewrites = array();//list of all rewrites

foreach ($configFiles as $file){
    $dom = new DOMDocument;
    $dom->loadXML(file_get_contents($file));
    $xpath = new DOMXPath($dom);
        $path = '//rewrite/*';//search for tags named 'rewrite'
        $text = $xpath->query($path);
        foreach ($text as $rewriteElement){
            $type = $rewriteElement->parentNode->parentNode->parentNode->tagName;//what is overwritten (model, block, helper)
            $parent = $rewriteElement->parentNode->parentNode->tagName;//module identifier that is being rewritten (core, catalog, sales, ...)
            $name = $rewriteElement->tagName;//element that is rewritten (layout, product, category, order)
            foreach ($rewriteElement->childNodes as $element){
                $rewrites[$type][$parent.'/'.$name][] = $element->textContent;//class that rewrites it
            }
        }
}
echo "<pre>";print_r($rewrites);
|improve this answer|||||
  • this is what i get -> snipboard.io/hsWG1t.jpg – zus Jan 4 at 12:02
  • what i need to do further? – zus Jan 4 at 12:37
  • which core functionality is modified? – Padhiyar Gaurang Jan 4 at 13:34
  • please upvote if it helps you to get rewrited files list. – Padhiyar Gaurang Jan 4 at 13:34
  • Configurable products price mismatch. – zus Jan 4 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.