5

Unfortunatly there isn't a very clean solution, but the best one I've come across is the following: call_user_func(array(get_parent_class(get_parent_class($this)), '_afterSave'));


3

Best practice in Magento is to not use private methods at all but now you have to deal with it so here we go. The problem is, you cannot just override a private method in your class because there will be two different methods (your class does not know about the existence of the original private method): WP_CustomMenu_Block_Navigation::_isCategoryDisplayed()...


3

continue_shopping_url is a session variable. You can set the session value for this variable. The session value is set here Mage_Checkout_Block_Cart::getContinueShoppingUrl() public function getContinueShoppingUrl() { $url = $this->getData('continue_shopping_url'); if (is_null($url)) { $url = Mage::getSingleton('checkout/session')->...


2

it is should be possible to do it this way: class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Abstract { protected function _afterSave() { ..... core code here (that what I want to change) ..... ..... //parent::_afterSave(); (end by calling the parent class method) Varien_Object::_afterSave(); // looks ...


2

Do not use inheritance, if it is not necessary. Moreover, blocks are private classes of modules, this class may be modified in next versions of module. Should not use extending \Magento\Customer\Block\Account\Dashboard for using only one method. This class have many dependencies, which not needed in your block. Inheritance will increase coupling between ...


2

First ensure that your store is in 'developer' mode then ensure the case of your theme that should be: VendorName > theme_name Then since you are working in dev mode ensure to delete these folders (between every change) var/cache - you can deactivate some cache to avoid remove that var/page_cache - you can deactivate some cache to avoid remove that var/...


2

In the class that you extend, there is a _toHtml function that will return an empty string is isGoogleAnalyticsAvailable() returns false. And since your class extends this one, it inherits this function (unless you rewrite it)


2

Static blocks and widget are not showing in your custom theme because of luma theme blocks and widget are them specific define. You can see below attached screen shot. If you want to show all Luma theme static blocks and widget then you need to create it and assign to your theme.


1

I have worked on an example for this inheritance issue you are interested in. If you look at this class \Magento\Framework\View\Element\Template, you will see one of its parameter is $_logger and although this parameter is a convenient way to log message when debugging and so on, it is common to find your log file contains so many messages that it makes your ...


1

As per this example https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/di-xml-file.html#parameter-configuration-inheritance <type name="Magento\Framework\View\Element\Context"> <arguments> <argument name="urlBuilder" xsi:type="object">Magento\Core\Model\Url</argument> ...


1

Because you have a CSS file with the same name in your childchild theme it TOTALLY overwrites and replaces the CSS in the child theme. Therefore change the name of the CSS file in the childchild theme and both will load. EDIT you will also need to reference the new file name in your childchild theme in the _extend.less file with @import 'myname.less'; ...


1

Looks good. Add new css file to your theme (you can copy from parent), flush cache and run static content deploy


1

because this content of luma theme show by widget. Widget only apply to specific theme design. So in your theme doesn't define any widget related to content block so it empty


1

Do this to avoid JS error for empty results: <script type="text/javascript"> var ThemeOptions = { box_wide: '<?php echo $_themeHelper->getConfig('general_section/layout/box_wide') ?>', rtl_layout: '<?php echo $_themeHelper->getConfig('general_section/layout/enable_rtl') ?>', sticky_header: '<?php echo $_themeHelper->...


1

Just call: Mage_Catalog_Block_Product_List_Toolbar::getPagerHtml() You cannot call parent::parent, in PHP, and then in Magento, you can use the static syntax to call the instatiated parent of your parent class. So, if you have: class A { public function myMethod() { return 4; } } class B extends A { public function myMethod() { return ...


1

You have to extend the class that you rewrite to inherit its methods, not its parent as you did. class Company_Module_SalesRule_Model_Quote_Discount extends Mage_SalesRule_Model_Quote_Discount


1

I'm not sure why it's not working, but I have some suggestions to clean up the code a little and maybe bring you closer to the solution The internal constructor comes from the Varien_Object and should be protected https://github.com/bragento/magento-core/blob/1.9/lib/Varien/Object.php#L151 Your _construct in Company_Interface_Model_Import_Product should ...


1

It looks like you're missing the constructor: public function _construct() { parent::_construct(); $this->_init('ebuynow_mdlogistics/order'); } You should take a look at this post by inchoo http://inchoo.net/magento/creating-an-eav-based-models-in-magento/ on how to create a model.


1

Whenever you create a controller, every dash would mean a subdirectory down. So if the adminhtml/my_reports points to My/ReportsController.php , adminhtml/my_report_two will point to My/Report/TwoController.php. If this won't work, it means another thing isn't configured well.


1

I think what you are looking for is actually the predispatch rather than postdispatch events unless I am miss understanding your request. These events can be found in Mage_Core_Controller_Varien_Action->preDispatch where right at the bottom you see the following lines of code. Mage::dispatchEvent('controller_action_predispatch', array('controller_action'...


1

Attribute sets in Magento only use the Based On field for determining what attributes are a part of that set initially. Unfortunately, once the attribute set creation has finished, there is no inheritance. You can see this fact if you look in the database in eav_attribute_set, and you will see there is no parent or based_on column. You will need to ...


1

I found out the issue. There was a rewrite of the quickCreateAction of class Mage_Adminhtml_Catalog_ProductController in my setup. The original method first check for inherited attribute values from configurable product, then sets the request parameter attributes from the form. My rewrite messed with that and now I fixed it.


1

I always try to use observers to alter the core functionality but this is not always possible. When it's not possible I use the first method you described, extending the original class because: This is the recommended way of doing it On an upgrade the chances of something crashing are smaller. On an upgrade the chances of losing new features on the original ...


Only top voted, non community-wiki answers of a minimum length are eligible