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 8618061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:01:07+00:00 2026-06-12T06:01:07+00:00

I need to dynamically add option choices to the cart items at the time

  • 0

I need to dynamically add option choices to the cart items at the time a product is added to the cart. The choices presented to the shopper can change from product to product, so it is necessary that they are dynamic. However, the options will always be the same. For example “Option 1” might have values “a, b, c” for one product and “x, y, z” for another product. I do not need the options saved into the product, only the cart. The selections need to be displayed in the cart and in the order administration, receipt, etc.

I learned from this answer that I can use $cart->addProduct($product, $params) in order to set custom options to the cart item.

I found that I can override the Cart controller at this blog post. I was able to dynamically add the product to the cart. However, I am stuck on how to add dynamic attribute values to the product. I tried setting ‘options’ and ‘super_attribute’ in $params before calling $cart->addProduct($product, $params) but it’s not saving the values to the cart item.

Finally, some of the option choices would need to affect the product price. I am not sure how to account for this either.

Thanks in advance for any help!

  • 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-06-12T06:01:08+00:00Added an answer on June 12, 2026 at 6:01 am

    In the past I have use a combination of text field and drop-down option (for options which affect price) along with custom javascript and hidden field to solve this issue. Take a look at the example below, as you change the different cabinet width the total dimension and price will be updated. This information will also be add to cart/admin order

    see example @ http://www.contempospace.com/bedroom-furniture/wardrobe-closets/custom-closet-systems/isa-custom-closet-4-module/isa-closet-system-xl-maximize-large-closet-drawers-shelves-hanging.html

    Assuming that you are using simple product.

    To add additional_options see Magento – Quote/order product item attribute based on user input

    To change product price see Changing the price in quote while adding product to cart: magento

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to dynamically add values from a text input to a listbox field.
I have a GridView that I need to dynamically add TemplateField elements to. My
I have a table of data that I need to dynamically add a column
I have a dataGrid(not dataGridView) in which i need to add Checkbox dynamically at
I need to add css height to each page dynamically with jQuery. So far
I need to be able to add rows to a table dynamically with jQuery
I need to create several Divs dynamically, and I need to add onmouseover event
I have a DataGrid and I need to add an Expander control dynamically to
In my Android Activity, I need to add a single View dynamically (at runtime),
I need a char array that will dynamically change in size. I do not

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.