line item properties does not have correct name

Highlighted
New Member
7 0 0

Hi,

When I am adding the properties in the product pageas a string, it is added correctly in the cart properties

<input id ="productName" type="text" name="properties[Hello World Shopify]" value={{product_title }} />
p.first prints :Hello World Shopify
 
But, when I am trying to give the name as dynamic, it truncated after first white space.
 
{% assign properties_text = all_products[sku].title%}
                      {% assign properties_text = "properties[" | appendproperties_text %}
                      {% assign properties_text ="]" | prependproperties_text %}

                      {{properties_text}}
                     <input id ="productName" type="text" name={{properties_text}} value={{product_title }} />
Here properties p.first prints -> Hello
The text in product page for {{properties_text}} displays the entire string.
0 Likes
Highlighted

use capture instead of assign

Shopify theme developer and customization

I Would like to add new functionality or customize an existing one, please hire me.
If helpful then please Like and Accept Solution .
Email: ashiquehussaincodediary@gmail.com

0 Likes
Highlighted
New Member
7 0 0
No luck.

Same result. Name is truncated after first space.


0 Likes
Highlighted

could you share me your code and output

Shopify theme developer and customization

I Would like to add new functionality or customize an existing one, please hire me.
If helpful then please Like and Accept Solution .
Email: ashiquehussaincodediary@gmail.com

0 Likes