About the author

Josh

Josh

Josh is a certificated Magento developer who has been working with Magento for 5 years. He loves to share his knowledge about Magento to the community

Related Articles

6 Comments

  1. 1

    vikas

    Hi,

    I don’t know php.

    I want to create the products programmatically in magento. everyone gave php code. no one mentioned in steps.

    1)where and in which folder I have to add the code.

    2)Is I have to save in .php file.

    3)Is there anything i have to add in app/code/core/Mage/catalog/php

    Thanks

    Reply
    1. 1.1
      Josh

      Josh

      Hi Vikas
      You can insert the code in the post into Observer.php

      Reply
  2. 2

    bijay

    how to insert another custom price with custom calculations in magento cart from products listing page to cart page

    Reply
  3. 3

    Matt

    I’m pretty new to Magento, but why not get the original price from the product rather than $item->getOriginalPrice(). The $item->getOriginalPrice() has been returning 0 a lot of the time, I’m not sure why. Maybe an update changed it? I changed your code into:

    $product = $item->getProduct();
    $specialPrice = $product->getPrice() – ($product->getPrice() * $percentDiscount);

    Reply
    1. 3.1

      Matt

      Oh, I forgot to say thank you for this post! It saved me some time trying to figure out how to have certain products use a special pricing calculator that Magento doesn’t really support other than to change it with the two events that you wrote about!

      Reply
  4. 4

    sdg

    Hi,

    I don’t know php.

    I want to create the products programmatically in magento. everyone gave php code. no one mentioned in steps.

    1)where and in which folder I have to add the code.

    2)Is I have to save in .php file.

    3)Is there anything i have to add in app/code/core/Mage/catalog/php

    Thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

2015 Copyright © Magentotutorial.org