note 108070 added to function.debug-backtrace
| From: | joyview at gmail dot com | Date: | Mon, 26 Mar 2012 20:53:21 +0000 |
| Subject: | note 108070 added to function.debug-backtrace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186827@lists.php.net to get a copy of this message | ||
<?php
class Domore_Matrix_Model_Option extends Mage_Catalog_Model_Product_Option
{
public function getPrice($flag=false)
{
if ($this->getTitle()=='Size') {
// dirty simple hack :) to get first attribute of caller function getOptionPrice($optionValue,
$basePrice)
// it is usefull to not rewrite Mage_Catalog_Model_Product_Option_Type_Default by placing it to
local folder
// it's not possible to rewrite Mage_Catalog_Model_Product_Option_Type_Default by config.xml
// it is another way - by rewriting autoloader (like Aitoc) but I think it's even more
confusing
// so future magento versions will be supported
// questions? Alexandr Martynov (joyview@gmail.com)
$caller = debug_backtrace();
$optionValue = current($caller[1]['args']);
// check if optionValue contains Width & Height
if (strpos($optionValue,'Width=')!==false AND
strpos($optionValue,'Height=')!==false) {
// calculate price with price matrix
return 100;
}
}
return parent::getPrice($flag);
}
}
----
Server IP: 77.88.252.46
Probable Submitter: 188.230.99.170
----
Manual Page -- http://www.php.net/manual/en/function.debug-backtrace.php
Edit -- https://master.php.net/note/edit/108070
Del: integrated -- https://master.php.net/note/delete/108070/integrated
Del: useless -- https://master.php.net/note/delete/108070/useless
Del: bad code -- https://master.php.net/note/delete/108070/bad+code
Del: spam -- https://master.php.net/note/delete/108070/spam
Del: non-english -- https://master.php.net/note/delete/108070/non-english
Del: in docs -- https://master.php.net/note/delete/108070/in+docs
Del: other reasons-- https://master.php.net/note/delete/108070
Reject -- https://master.php.net/note/reject/108070
Search -- https://master.php.net/manage/user-notes.php