Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9189935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:20:49+00:00 2026-06-17T20:20:49+00:00

I am trying to build a Magento module that observes certain events and tries

  • 0

I am trying to build a Magento module that observes certain events and tries to proceed automatically to a new automatic status/state, based on payment method.
In order to do that, I organized some status on the backoffice based on payment method. For example:

event: sales_order_place_after
Automatic status: pp_1_pending – First status/state where a new placed order will automatically have this status if the payment method is paypal.

event: sales_order_payment_pay
Automatic status: pp_2_payment – Second status/state after an order is payed when the payment method is paypal

event: sales_order_invoice_save_after
Automatic status: pp_3_complete– Third and final status/state after an order is invoiced, ending the transaction.

For this to work I would need to collect all status with the prefix pp_ and after checking which was set on the order, proceed to the next status in order. This way this module would be scalable.

However I can’t seem to get the status collection. I am trying:
$statuses = Mage::getModel('sales/order_status')
->getCollection()
->addAttributeToSelect('status')
->addAttributeToSelect('label')
->addFieldToFilter('status',array('like','pp_'));

Hope anyone can help me. Thanks all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:20:51+00:00Added an answer on June 17, 2026 at 8:20 pm

    The addAttributeToSelect() function is used for EAV based models.For flat models use addFieildToSelect()

    The code should be

    $statuses = Mage::getModel('sales/order_status')
    ->getCollection()
    ->addFieldToSelect('status')
    ->addFieldToSelect('label')
    ->addFieldToFilter('status',array('like'=>'pp_%'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a simple Magento Module that needs to connect to the
I'm new in Magento and I'm trying to make a layout for a module
I am trying to build a module for Magento 1.6.0. Here is my config.
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
Trying to build a project that uses managed C++/CLI and it compiles successfully when
I'm trying build a regex that will replace any characters not of the format:
Im trying to build a simple AJAX script that uses a form to send
Trying to build a dynamic gallery that is loaded via AJAX. I'm trying to
Trying to build a basic 3-layer architecture in my new application suite. For first
Im trying to build a form that calculates a total price based on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.