Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you want to do might be possible, but I am not sure that the approach you have described would be doable, I think it is too simplistic to work with the very complex Magento platform. </p> <p>I had a similar project where the actual price of the products was constantly changing based on a few inputs and I was able to solve the problem fairly well, but it was definitely more complicated thank what you seem to be hoping for. I am not sure this scenario is helpful to you or not, but here it goes...</p> <p>The basic idea was that I created new product attributes (eav attributes). These served as the inputs to determine what the price really should be. Note that in my case, these attributes were being updated fairly regularly by an outside process.</p> <p>Then I created an observer on the "catalog_product_save_before" event that would simply do something like this:</p> <pre><code>//some calculations to get the $newPrice $product-&gt;setPrice($newPrice); </code></pre> <p>So basically that will make it so that the price field will always be current whenever you save a product in the administrative screens.</p> <p>Then also, since several of the attributes that were used as inputs were constantly changing (updated by an outside process), so we also had to add a magento cron job to run every so often, and it would recalculate the price for all the affected products with something like this...</p> <pre><code>//some calculations to get the $newPrice $product-&gt;addAttributeUpdate("price", $newPrice, Mage::app()-&gt;getStore()-&gt;getStoreId()); </code></pre> <p>So it all boils down to the fact that you should have the attribute saved in the db. And of course you need to find the specific spots of where to update that derived attribute. Maybe your requirements will vary slightly from what I have described, but it might get you on the right path at least.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload