Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7057901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:02:55+00:00 2026-05-28T04:02:55+00:00

We have an advanced product option created called Courses. It contains all the fields

  • 0

We have an advanced product option created called Courses. It contains all the fields that we want the user to enter information when ordering the product.

We have an external process that imports our courses into our store using this shortened code:
($data contains the course information to be inserted.)

$sku = $data['EventCode'];
$productId = Mage::getModel('catalog/product')->getIdBySku($sku);
if(!$productId) {
    $product = Mage::getModel('catalog/product');
    $product->setWebsiteIds(array(1));
    $product->setData('entity_type_id', '10');
    $product->setData('attribute_set_id', 4);
    $product->setData('type_id', 'virtual');
    $product->setData('created_at', strtotime('now'));
    $product->setData('updated_at', strtotime('now'));
    $product->setTaxClassId(1);
    $product->setStatus(1);
    $product->setData('manage_stock', 1);
    $product->setData('visibility', 1);
    $product->setData('has_options', 0);  // If this product has options, set to 1
    $product->setStockData(array('is_in_stock' => 1));
} else {
    // Product was found, so load it so it can be updated.
    $product = Mage::getModel('catalog/product')->load($productId);
} // if(!$productId)
$ename = "Unknown course name";
$product->setName($ename);
$product->setPrice($data['Price']);
$product->setDescription('Course Item');
$product->setShortDescription('Course Item');
$product->setData('is_online_course', ($data['LocState'] == 'OL' ? 1 : 0));
$product->setSku($sku);
$cat_id[] = 9;
$product->setData('category_ids', $cat_id);
$product->save();

How would I set each product to use the advanced option Courses in the code above?
Note: All options in Courses are required.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:02:56+00:00Added an answer on May 28, 2026 at 4:02 am

    You can use product Attributes API.

    <?php
       $proxy = new SoapClient('http://domain/api/soap/?wsdl');
       $sesId = $proxy->login('apiUser', 'apiKey');
       $attributeSet = $proxy->call($sessId, 'product_attribute_set.list');
       $attributeOptions = $proxy->call($sessId, 'product_attribute.options', array('attribute_id'=>'PRODUCT_ATTRIBUTE_INT_ID'));
       // change PRODUCT_ATTRIBUTE_INT_ID with your attribute id
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an advanced search page that searches a number of fields in
I have a reasonably advanced (many patches and subpatches) quartz composition that was created
I have a View where the user can select Basic Configuration and Advanced Configuration
I have a loop that when it is called, creates a div with some
I am working on sql server monitoring product and i have database query that
I have two tables containing product information, and product variations. I’m trying to list
We have a search feature that allows users to search based on product description.
I have a model called Product with a custom property: def _get_active(self): o =
Thanks in advance i have made one attribute with option of yes/no i want
We have an advanced webpage (ASP.NET, C#), and a application which needs to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.