magento 1.9 – Problem in creating Observer for Third Party Module?

I am using this extension for additional fees,

I did something else in this file in magento (app / code / local / Voronoy / ExtraFee / Model / Quote / Address / Total / Fee / Rule.php).

FYI -> The function on the right works.

I just created Observer for this extension:

My observer:

app / etc / modules / Gta_ExtraFeesRemove.xml


app / code / local / Gta / ExtraFeesRemove / etc / config.xml


app / code / local / Gta / ExtraFeesRemove / Model / Quote / AddressTotal / Fee / Rule.php

_calculator = Mage::getSingleton('voronoy_extrafee/salesRule_validator');
     * @param Mage_Sales_Model_Quote_Address $address
     * @return Mage_Sales_Model_Quote_Address_Total_Abstract
    public function collect(Mage_Sales_Model_Quote_Address $address)
        if (!Mage::helper('voronoy_extrafee')->isRuleExtraFeeEnabled()) {
            return $this;
        $quote = $address->getQuote();
        $shipping_method = $quote->getShippingAddress()->getShippingMethod();
        $current_website = Mage::app()->getWebsite()->getId();

        ### log ###
        Mage::log("ExtraFeesWebsite -".$current_website." website checking part");
        ### log ###

        /* Flat Rate Condition Start*/
        if ($shipping_method != 'flatrate' && $current_website != 2) :
            $store = Mage::app()->getStore($quote->getStoreId());

            $items = $this->_getAddressItems($address);
            if (!count($items)) {
                return $this;

            ### log ###
            Mage::log("FlatRateCondition - ".$items."Flat Rate Condition ");
            ### log ###

            $this->_calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode());
            $this->_calculator->initTotals($items, $address);

            $items = $this->_calculator->sortItemsByPriority($items);
            foreach ($items as $item) {
                if ($item->getParentItemId()) {
                if ($item->getHasChildren() && $item->isChildrenCalculated()) {
                    foreach ($item->getChildren() as $child) {
                } else {

            ### log ###
            Mage::log("FlatRateCondition - ".$items."Flat Rate Condition ");
            ### log ###

        // / Flat Rate Condition End /
     * Fetch Totals
     * @param Mage_Sales_Model_Quote_Address $address
     * @return Voronoy_ExtraFee_Model_Quote_Address_Total_Fee_Rule
    public function fetch(Mage_Sales_Model_Quote_Address $address)
        if (!Mage::helper('voronoy_extrafee')->isRuleExtraFeeEnabled()) {
            return $this;
        $amount = $address->getExtraFeeRuleAmount();
        if ($address->getExtraFeeRuleDescription()) {
            $discountLabel = Mage::helper('voronoy_extrafee')->__(
                '%s (%s)',
        } else {
            $discountLabel = Mage::helper('voronoy_extrafee')->getExtraFeeRuleLabel();
        if ($amount > 0) {
                'code' => $this->getCode(),
                'title' => $discountLabel,
                'value' => $amount
        return $this;


The third party module observer does not work.

FYI -> Changes in core work.

magento2 – What event should I use for the observer deleted by the user?

I am very new to Magento2, so I cannot find a list of all the events related to user accounts. I need to create observers for the deleted user, the updated user (any information in the account) and the created user. Could you get help please? 🙂 I found quite old information about customer_save_after and customer_delete_after events, but I'm not sure if they are still used in 2019. And also if I could provide a link to a list of all (current) events in Magento2, it would be very useful. Thank you.

How to create an event observer who only calls when REST api dispatches events?

I only want to call the event observer when that event is sent through the REST API, as if an order was placed from the mobile application, then it will only be ordered to save after the Observer's call.
How to write code for the same in events.xml? Or do we have to write somewhere else?

magento2 – How can I call the editPost controller after an observer (checkout_onepage_controller_success_action) Magento 2

I have to save the account edit with the client default shipping address details. After the successful placement of the order.

I created the observer but I'm not sure what to call editPost of the client of that method of execution.

customerSession = $customerSession;

 * @param Observer $observer
 * @return void
public function execute(Observer $observer)
    // TODO: Implement execute() method.
    $customer = $this->customerSession->getCustomer();
    $shippingAddress = $customer->getDefaultShippingAddress();
    if ($shippingAddress) {
        $firstname =  $shippingAddress->getFirstname();
        $secondname =  $shippingAddress->getLastname();
        $telephone =  $shippingAddress->getTelephone();


Now I need to send these 3 parameters $firstname, $secondname, $telephone to editPost controller.

How can I achieve it?

Buy – Virtual Assistant – Horse Racing Video Observer


I am based in Australia, and I am looking to partner with a Virtual Assistant who can watch horse racing videos for me.

No experience or understanding of horse racing is required, since full training will be provided.

There can be between 24 and 75 races in Australia every day, and each race lasts about 2 minutes, although you should probably watch each video twice.

The schedules are extremely flexible. Therefore, you can do it for a few hours every day, or every other day or even once a week. As long as all races are seen within 7 days.

An overview of the work will be as follows:

1. Watch the repetition of a race
2. Watch the video again, noting any horse that meets the criteria.
3. Go to another website to take note of the price of the horses.
4. Enter the Date, Name, Track, Race number, Price and comment on a system
5. Move to the next race

Due to the nature of the work, you will need a decent and reliable Internet connection.

For starters, there are probably between 20 and 30 hours of work, however, there is an opportunity for more hours if it is a learning machine. Alternatively, if there is too much work for one person, I could divide it.

Thank you for your time, and if you are interested in the position, send me a private message with the following:

1. Name
2. Email address
3. Country / city
4. Hourly rate ($ US)
5. Some information about you and why you are interested in the position.

Thank you for your time and we hope to hear it. It may take me a couple of days to respond, so take your time with the message and don't worry if you don't receive a response from me immediately.



magento2 – Magento 2 How to get the postal code of the billing address at the observer?

I can't get the zip code from the user's Billing Address, this is my code, everything works fine, except the zip code, which I can't extract.

$objectManager = MagentoFrameworkAppObjectManager::getInstance();

        $customer = $observer->getEvent()->getCustomer();
        $first_name= $customer->getFirstname();
        $last_name= $customer->getLastname();
        $taxVat = $customer->getTaxvat();

        //Billing Address variables

        $billingID = $customer->getDefaultBilling();
        $billingAddress = $objectManager->create('MagentoCustomerModelAddress')->load($billingID);
        $billingCompany = $billingAddress->getCompany();
        $billingZipcode = $billingAddress->getPostCode();
        $billingCity = $billingAddress->getCity();
        $billingState = $billingAddress->getRegion();
        $billingStreet = $billingAddress->getStreet();
        $billingStreet1 = $billingStreet(0);
        $billingStreet2 = $billingStreet(1);
        $billingTelephone = $billingAddress->getTelephone();


module – Magento Observer to block spam requests that do not work

I am facing some problems with the orders placed by the robots.

enter the description of the image here

I noticed that all orders are made by a specific phone number and also by a specific street. So I looked for a way to block orders that are made with that phone number or this street.

I found the following link
I followed the steps to create an observer with the sales_order_place_before event, to compare the parameters sent in order with the parameters that I want to block.

  1. I created the file Blockbots_Observer.xml in / html / app / etc / modules;
  2. I created the Config.xml file in / html / app / code / local / Blockbots / Observer / etc;
  3. Finally, I created the Observer.php file in / html / app / code / local / Blockbots / Observer / Model;

After all these steps, the implementation did not work (I'm still receiving bot orders).

Here is the code in the files:

enter the description of the image here

enter the description of the image here

enter the description of the image here

What could be wrong with the implementation? Any idea how I can fix it?

magento2 – Custom product attribute in Magento 2 observer

Someone knows how to obtain the custom attribute of the product in the observer:

My current code is giving me:

Error not detected: call a member function getProduct () null in

$ product = $ this-> productRepository-> getById ($ observer-> getItem () -> getProduct () -> getId ());
$ attr = $ product-> getData (& # 39; product_customattribute & # 39;);

I also tried this (same error):

    $ product = $ observer-> getEvent () -> getProduct ();
$ attr = $ product-> getProduct () -> getAttributeText (& # 39; product_customattribute & # 39;);

magento2 – M2 – Module Observer "checkout_cart_product_add_after" – Recalculate shipping costs

I am establishing a new price and a new weight in my module. Setting a new price and weight works fine, but how do you re-calculate shipping costs?

$ item-> setWeight ($ newWeight); // Set new weight

/ ***************** This code below will not work ******************** /
$ this-> quoteRepository-> get ($ this -> _ checkoutSession-> getQuoteId ());
$ quote = $ this -> _ checkoutSession-> getQuote ();
$ quote-> collectTotals ();
$ this-> quoteRepository-> save ($ quote);

magento2 – Magento 2 module observer sequence order and sales order event

We have two modules that activate the same event checkout_submit_all_after. But I have to give a preference for this, I tried to give a sequence in module b, but it will not work. For example, module A and module B trigger the same event, but module B fires first, my requirement is to activate Module A and after module B, is there any way I can do this? Placed through crons? Please, give me some solution to move forward.
Thank you