Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Change Add Value Rate Topic   - - - - -


Posted 07 February 2019 - 06:38 PM #1



Is there a way to change an addon default value from a product page?


I'll explain, I have the fowling setting under my_changes

<input id="addon_option_my_changes_product_code" type="text" name="addon_data[options][8598]" size="30" value="{$addons.my_changes.product_code}" class="user-success">

I've inserted that code to dispatch=products.m_add but when I press save, it doesn't change the value with the above code.


Can anyone help me with it.

  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11365 posts

Posted 07 February 2019 - 11:03 PM #2

What is your code in your controller?  You should probably be using "product_data" rather than "addon_data"  But if you have a pre controller that is looking specifically for "addon_data" you should be okay.  You many need to mark your variable as "safe" by using fn_trusted_vars().


Another thing to do is to verify that you are posting your data and storing it properly.  Without seeing what you're doing with the setting of the smarty variables as well as the handling of the POST variables, it's hard to advise accurately.  Can only give broad suggestions to check.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.

  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19709 posts

Posted 08 February 2019 - 05:49 AM #3

As far as I can see, the m_update mode takes into account only product_data array (not addon_data one). So you should create products.post.php controller and process the $_REQUEST['addon_data'] array there

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.