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 8797767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:55:19+00:00 2026-06-13T23:55:19+00:00

I am trying to update some (but not all ) prices from one store

  • 0

I am trying to update some (but not all ) prices from one store to another. For example one line of shirts should be 1.2 times the price in the second store

I would like to update some groups of items only, based on entity label but am struggling to pull all the data from magento (asside what i can get out in the code below). The bits I am missing are price and entity label. I know what tables they live in but not sure the correct magento syntax to access them eg Mage::getModel(‘catalog/product’) and I am trying to achieve this using Magento friendly code and not queries

Using enterprise 1.11, not looking at buying a plugin at this stage, any advice greatly appreciated

$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); #important
$product_id = '8782';
$collection = Mage::getModel('catalog/product')
         ->load($product_id);
        echo "Collection: " . $collection->getName();
        echo "<br>";
        echo "Attribute Set: " . $collection->getAttributeSetId() . " SKU: " . $collection->getSku();
        echo "<br>"; 
        echo "Entity ID: " . $collection->getEntity_id() . " Product Type (Attribute Label): " . $collection->getProducttype();
  • 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-13T23:55:21+00:00Added an answer on June 13, 2026 at 11:55 pm

    Just clarifying:

    In the sample you’ve shown, the $collection object isn’t really a “collection”.
    It’s an instance of one ‘catalog/product’ object.

    To modify the price of one catalog/product object, you’d be looking at doing something like this:

    $product = Mage::getModel('catalog/product')->load($product_id);
    $product->setPrice($product->getPrice() * 1.2)
            ->save();
    

    If you want to do this over a bunch of products, you’ll probably want to use a collection of
    ‘catalog/product’ objects, and apply some attribute filters (which boils down to adding
    WHERE clauses to the eventually generated SQL). (Here’s one summary of the magento collection query
    syntax.)

    I’m not sure what you mean by “entity label”. Is that a custom attribute you’ve attached to your products?

    A general example, applying this price change to all products with a certain SKU:

    $product_collection = Mage::getModel('catalog/product')->getCollection()
                                                           ->addAttributeToFilter('sku', array('like' => 'FOO01-%'));
    
    foreach($product_collection as $product) {
    
        $new_price = calcNewPrice($product->getPrice());
        $product->setPrice($new_price)
                ->save(); 
    
    }     
    

    Where, if you’re going across stores for price calcs, “calcNewPrice” might look something like this:

    function calcNewPrice($product) {
        $other_store_product = Mage::getModel('catalog/product')->setStoreId($other_store_id)
                                                                ->load($product->getId());
        if ($other_store_product) {
            return $other_store_product->getPrice() * 1.2;
        }
        // else ???
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to update the display brightness from a widget but i have some
Hi I am trying to update a div with some html from another div.
I'm trying to edit some SSRS 2008 reports from TFS, but having all kinds
I am trying to use drush to update my drupal core but in some
i'm trying to make a ajax update in prototype with some values from a
I am trying to stop some events but stopPropagation does not work with live
I'm trying to update some min and max fields so that is one is
I am trying to read through the dataBind documentation, but it's not all that
Update : Been some time. But back then decided not to use Mongoose. Main
I'm trying to update some properties with KVC. The properties have been synthesized. This

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.