Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would suggest a little different approach. Enhancing the Admin interface is difficult, but possible. Here is an easier way.</p> <p><strong>Method #1 - Quick and Easy</strong></p> <p>Create yourself a script that would go through a list of products. You can select them by attribute type, category, or even just select them all! Then, loop through that collection, and for each product, grab the title, query the movie API, and set the product's attributes. Then, save the product, and move to the next one. Something like this:</p> <p>Note: Be sure to create your custom attributes in the admin and assign them to the attribute set.</p> <pre><code>&lt;?php require_once 'app/Mage.php'; umask(0); Mage::app('default'); function getVideoDataFromAPI($title) { // get your data from the API here... return $data; } $collection = Mage::getResourceModel('catalog/product_collection') -&gt;addAttributeToFilter('attribute_set_id', $yourAttributeSetId) -&gt;addAttributeToFilter('year', ''); // &lt;-- Set a field here that will be empty by default, and filled by the API. This is '' because it won't be null. foreach ( $collection-&gt;getAllIds() as $id ) { $product = Mage::getModel('catalog/product')-&gt;load($id); $videoData = getVideoDataFromAPI($product-&gt;getName()); if ( empty($videoData) ) { continue; } $product-&gt;setYear($videoData['year']) -&gt;setRating($videoData['rating']) -&gt;save(); } ?&gt; </code></pre> <p><strong>Method #2 - Do the above, but in a custom extension</strong></p> <p>I always like extensions over scripts. They are more secure and more powerful. With an extension you could have an admin list of the products, can filter them how ever you would like, and have a mass action to pull the video data manually. You could also set it up on a cron job to pull regularly.</p>
    singulars
    1. This table or related slice is empty.
    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