update $product.selected_options <textarea>

Hello,

I have a feature to collect the $product.selected_options in the detail page product to a textarea field working in CS-Cart 3.0.5 but now with the 4.0.2 version this don't work…



Please could someone help me with this issue?



----------------------------------------------------------------------

app/controllers/common/products.post.php

----------------------------------------------------------------------



```php if (AREA == 'C') {

if (!empty($_REQUEST['appearance']['quick_view'])) {



$display_tpl = 'views/products/quick_view.tpl';



} elseif (!empty($_REQUEST['appearance']['details_page'])) {



// [CUSTOMER]

$view->display('path-file-where-is-the-text-area/file.tpl');

// [/CUSTOMER]

$display_tpl = 'views/products/view.tpl';

} else {

$display_tpl = 'common/product_data.tpl';

}

} else {

$display_tpl = 'views/products/components/select_product_options.tpl';

Registry::get('view')->assign('product_options', $product['product_options']);

}

} else {

// Cart data ```



----------------------------------------------------------------------

/file.tpl

----------------------------------------------------------------------



[html]





{if $product.selected_options}

----------------------------------------

Opções

----------------------------------------

{foreach from=$product.selected_options item=“var_id” key=“opt_id”}

{$product.product_options.$opt_id.option_name}:

{$product.product_options.$opt_id.variants.$var_id.variant_name} {if $product.product_options.$opt_id.variants.$var_id.modifier|floatval}({include file=“common/modifier.tpl” mod_type=$product.product_options.$opt_id.variants.$var_id.modifier_type mod_value=$product.product_options.$opt_id.variants.$var_id.modifier display_sign=true})

{/if}

{/foreach}

----------------------------------------

Price:{include file=“common/price.tpl” value=$product.price}

{/if}

[/html]



When you choose a product option, the final price is updated, the product option in the text area would also be expected to be updated…

That's one really long template line. What exactly are you trying to put into this text area?

Wouldn't it be easier to grab all this info in PHP and then just pass the resulting info as an array of values indexed by product_id?

Not clear what you're really trying to accomplish and why.