1

The question which I am asking is a bit complex. I didn't get any idea how to achieve this in Magento. I am developing a Jewellery Shop. Base product is Gold and Diamond jewellery. So what I want is instead of setting prices for individual products I want to apply a formula. I will set a rate of Gold and Diamond. Then will create the products made of Gold and Diamonds and set their weights individually. So the selling price of those products would be Rate x Weight = Item Selling Price.

Any one is having the answer please help me.

  • I am confused. Is there just a single product that you want to set the price based on how heavy it is? – fantasticrice May 12 '15 at 16:05
  • Are the rates variable? – Mayers May 12 '15 at 16:08
  • No. There are many products like Rings, Chains, etc. But they are made of gold and Diamonds. As in India the price of Gold and Diamond changes everyday. So I want to set the Price of Diamond and Gold and according to the product's weight selling price will be auto calculated. – Westzonesolution Corp May 12 '15 at 16:08
  • I would create a cron job, that updates automatically all the prices on your catalogue based on these two rates. The only manual action you would require would be setting the rates, as I am not sure if you can fetch this information from anywhere. – Mayers May 12 '15 at 16:22
  • Yes, thats the issue. How would I set the rates? And what is the corn job command for this? – Westzonesolution Corp May 12 '15 at 16:32
0

I'm assuming your base product is a simple product. So to do a custom price formula you have to change the calculation for simple products (simple is the type) .YOUR_PRICE_MODEL is your custom model to calculate the price. You can write this model as below:

<config>
   ...
   <global>
      ...
      <catalog>
         <product>
            <type>
               <simple translate="label" module="catalog">
                  <price_model><!-- YOUR_PRICE_MODEL --></price_model> 
               </simple>
            </type>
         </product>
      </catalog>
   </global>
</config>

YOUR_PRICE_MODEL is your custom model to calculate the price. You can write this model as below:

class /*YOUR_PRICE_MODEL*/ extends Mage_Catalog_Model_Product_Type_Price
{
   public function getPrice($product){
      // your custom calculate price
   }
   public function getFinalPrice($qty=null, $product){ 
      // your custom calculate final price
   }
}
0

Although we use Salesforce for Formulated concept now, during are beginning stretch and the constant updates(and headaches) I may add, this module helped.

https://www.magentocommerce.com/magento-connect/attribute-logic-auto-calculations.html

We where also to use this, along side Multistore to get certain calculated values.

For example

In attribute - code ='type' and STORE - ADMIN drop down - Gold, Diamond, Silver. On Store Main Value would be 1,2,3 respectively.

So now it's this easy. With the calculated field extension, create a new(or add to an already existing) and Take ('weight' * 'type') and viola your store 1 now has the value you are looking for and you admins just need to choose the type without the needed the values. Let you as the business owner just add the 'value' to the attribute and the rest of the system will work as intended.

This solution will work and good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.