Change Magento default status for duplicated products

Try this: Create: app/code/local/MagePal/EnableDuplicateProductStatus/etc/config.xml <?xml version=”1.0″?> <config> <modules> <MagePal_EnableDuplicateProductStatus> <version>1.0.1</version> </MagePal_EnableDuplicateProductStatus> </modules> <global> <models> <enableduplicateproductstatus> <class>MagePal_EnableDuplicateProductStatus_Model</class> </enableduplicateproductstatus> </models> <events> <catalog_model_product_duplicate> <observers> <enableduplicateproductstatus> <type>singleton</type> <class>enableduplicateproductstatus/observer</class> <method>productDuplicate</method> </enableduplicateproductstatus> </observers> </catalog_model_product_duplicate> </events> </global> </config> Create: app/code/local/MagePal/EnableDuplicateProductStatus/Model/Observer.php class MagePal_EnableDuplicateProductStatus_Model_Observer { /** * Prepare product for duplicate action. * * @param Varien_Event_Observer $observer * @return object */ public function productDuplicate(Varien_Event_Observer … Read more

Handling buttons inside android notifications

I found out that I had to register “switchButtonListener” in AndroidManifest.xml <receiver android:name=”SettingsActivity$switchButtonListener” /> Source: Android Activity with no GUI Later I found out that I can also use code like this to achieve the same thing without modifying the manifest. switchButtonListener = new SwitchButtonListener(); registerReceiver(switchButtonListener, new IntentFilter(SWITCH_EVENT)); . public class switchButtonListener extends BroadcastReceiver { … Read more

How to change status bar color to match app in Lollipop? [Android]

To change status bar color use setStatusBarColor(int color). According the javadoc, we also need set some flags on the window. Working snippet of code: Window window = activity.getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setStatusBarColor(ContextCompat.getColor(activity, R.color.example_color)); Keep in mind according Material Design guidelines status bar color and action bar color should be different: ActionBar should use primary 500 color … Read more