Updating Configurable price in the databaseMagento Configurable Product Price Overriding Simple Product...

What materials can be used to make a humanoid skin warm?

How to draw dashed arc of a circle behind pyramid?

In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?

How do we create new idioms and use them in a novel?

How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

What is Tony Stark injecting into himself in Iron Man 3?

Should I take out a loan for a friend to invest on my behalf?

What is better: yes / no radio, or simple checkbox?

Is a piano played in the same way as a harmonium?

Was it really inappropriate to write a pull request for the company I interviewed with?

Do I really need to have a scientific explanation for my premise?

Are small insurances worth it?

Determining optimum shared school bus route to a single destination from multiple origin points

Shifting between bemols (flats) and diesis (sharps)in the key signature

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

Source permutation

Why aren't there more Gauls like Obelix?

Trig Subsitution When There's No Square Root

I can't die. Who am I?

Which situations would cause a company to ground or recall a aircraft series?

Can I negotiate a patent idea for a raise, under French law?

Getting the || sign while using Kurier

What do *foreign films* mean for an American?



Updating Configurable price in the database


Magento Configurable Product Price Overriding Simple Product PriceHow can I delete configurable product attributes?Updating Configurable Products Constraint ExceptionGetting The Configurable Front End Product To Display The Cheapest Simple Product Price As A 'From' PriceCreate categories through installerHow to create/update bulk of products at a time programmaticallyHelp with script to convert bundle products to configurableHow to get the price of all simple products assigned to configurable products in magento 2?Get Configurable Product Price When Using Lowest Price Simple ExtensionFatal error: Uncaught Error: Call to a member function getId() on null in













0















I need to update the Price for all configurable products in the database but I am not sure what table or column to use within my query.



I am almost there as I can enter the lowest priced simple product Price for all configurable products in a new table I created but what I need is to update the current price of the configurable products.



require_once('app/Mage.php');
umask(0);
Mage::app();

include 'pathtocredentials.php';
$con = mysqli_connect ($host, $username, $password, $dbname);

$configurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));

foreach ($configurable as $_configurableproduct) {

$product = Mage::getModel('catalog/product')->load($_configurableproduct->getId());
$id = $product->getId();
$price = $product->getFinalprice();

mysqli_query($con,"UPDATE some_table SET some_column=$price WHERE id=$id";

}

mysqli_close($con);









share|improve this question





























    0















    I need to update the Price for all configurable products in the database but I am not sure what table or column to use within my query.



    I am almost there as I can enter the lowest priced simple product Price for all configurable products in a new table I created but what I need is to update the current price of the configurable products.



    require_once('app/Mage.php');
    umask(0);
    Mage::app();

    include 'pathtocredentials.php';
    $con = mysqli_connect ($host, $username, $password, $dbname);

    $configurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));

    foreach ($configurable as $_configurableproduct) {

    $product = Mage::getModel('catalog/product')->load($_configurableproduct->getId());
    $id = $product->getId();
    $price = $product->getFinalprice();

    mysqli_query($con,"UPDATE some_table SET some_column=$price WHERE id=$id";

    }

    mysqli_close($con);









    share|improve this question



























      0












      0








      0


      1






      I need to update the Price for all configurable products in the database but I am not sure what table or column to use within my query.



      I am almost there as I can enter the lowest priced simple product Price for all configurable products in a new table I created but what I need is to update the current price of the configurable products.



      require_once('app/Mage.php');
      umask(0);
      Mage::app();

      include 'pathtocredentials.php';
      $con = mysqli_connect ($host, $username, $password, $dbname);

      $configurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));

      foreach ($configurable as $_configurableproduct) {

      $product = Mage::getModel('catalog/product')->load($_configurableproduct->getId());
      $id = $product->getId();
      $price = $product->getFinalprice();

      mysqli_query($con,"UPDATE some_table SET some_column=$price WHERE id=$id";

      }

      mysqli_close($con);









      share|improve this question
















      I need to update the Price for all configurable products in the database but I am not sure what table or column to use within my query.



      I am almost there as I can enter the lowest priced simple product Price for all configurable products in a new table I created but what I need is to update the current price of the configurable products.



      require_once('app/Mage.php');
      umask(0);
      Mage::app();

      include 'pathtocredentials.php';
      $con = mysqli_connect ($host, $username, $password, $dbname);

      $configurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));

      foreach ($configurable as $_configurableproduct) {

      $product = Mage::getModel('catalog/product')->load($_configurableproduct->getId());
      $id = $product->getId();
      $price = $product->getFinalprice();

      mysqli_query($con,"UPDATE some_table SET some_column=$price WHERE id=$id";

      }

      mysqli_close($con);






      php configurable-product database simple-product






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 2 '16 at 23:09







      Mike Tim Turner

















      asked Feb 2 '16 at 23:02









      Mike Tim TurnerMike Tim Turner

      559421




      559421






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I am unable to comment currently, however I can guide you:



          Price is stored on the catalog_product_entity_decimal table linked to product ID (called entity_id)



          So your query would now be




          mysqli_query($con,"UPDATE catalog_product_entity_decimal SET value=$price WHERE entity_id=$id");




          You might want to try and see if this works for you.



          Note: Please take database backup before doing this.






          share|improve this answer


























          • I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

            – Mike Tim Turner
            Feb 3 '16 at 8:17











          • That's right. Updated my answer.

            – Shivani
            Feb 3 '16 at 8:37











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100124%2fupdating-configurable-price-in-the-database%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I am unable to comment currently, however I can guide you:



          Price is stored on the catalog_product_entity_decimal table linked to product ID (called entity_id)



          So your query would now be




          mysqli_query($con,"UPDATE catalog_product_entity_decimal SET value=$price WHERE entity_id=$id");




          You might want to try and see if this works for you.



          Note: Please take database backup before doing this.






          share|improve this answer


























          • I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

            – Mike Tim Turner
            Feb 3 '16 at 8:17











          • That's right. Updated my answer.

            – Shivani
            Feb 3 '16 at 8:37
















          0














          I am unable to comment currently, however I can guide you:



          Price is stored on the catalog_product_entity_decimal table linked to product ID (called entity_id)



          So your query would now be




          mysqli_query($con,"UPDATE catalog_product_entity_decimal SET value=$price WHERE entity_id=$id");




          You might want to try and see if this works for you.



          Note: Please take database backup before doing this.






          share|improve this answer


























          • I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

            – Mike Tim Turner
            Feb 3 '16 at 8:17











          • That's right. Updated my answer.

            – Shivani
            Feb 3 '16 at 8:37














          0












          0








          0







          I am unable to comment currently, however I can guide you:



          Price is stored on the catalog_product_entity_decimal table linked to product ID (called entity_id)



          So your query would now be




          mysqli_query($con,"UPDATE catalog_product_entity_decimal SET value=$price WHERE entity_id=$id");




          You might want to try and see if this works for you.



          Note: Please take database backup before doing this.






          share|improve this answer















          I am unable to comment currently, however I can guide you:



          Price is stored on the catalog_product_entity_decimal table linked to product ID (called entity_id)



          So your query would now be




          mysqli_query($con,"UPDATE catalog_product_entity_decimal SET value=$price WHERE entity_id=$id");




          You might want to try and see if this works for you.



          Note: Please take database backup before doing this.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 17 mins ago









          Teja Bhagavan Kollepara

          2,98641947




          2,98641947










          answered Feb 3 '16 at 7:55









          ShivaniShivani

          51125




          51125













          • I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

            – Mike Tim Turner
            Feb 3 '16 at 8:17











          • That's right. Updated my answer.

            – Shivani
            Feb 3 '16 at 8:37



















          • I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

            – Mike Tim Turner
            Feb 3 '16 at 8:17











          • That's right. Updated my answer.

            – Shivani
            Feb 3 '16 at 8:37

















          I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

          – Mike Tim Turner
          Feb 3 '16 at 8:17





          I will try this soon thanks. I'm curious. Would it be "WHERE entity_id=$id" ?

          – Mike Tim Turner
          Feb 3 '16 at 8:17













          That's right. Updated my answer.

          – Shivani
          Feb 3 '16 at 8:37





          That's right. Updated my answer.

          – Shivani
          Feb 3 '16 at 8:37


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100124%2fupdating-configurable-price-in-the-database%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          夢乃愛華...