Saving an svg on checkout (as the product)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Hi there,

I need some guidance please.
I build a custom image in SVG format as my product, I need to save this product(SVG) when the client clicks Checkout.

How would you suggest would be the best way to do this? Should I create a new field in the Db? I don't really want to customize the core for obvious reasons.

Any assistance would be greatly appreciated.
3 года назад
[email protected] wrote:

I build a custom image in SVG format as my product, I need to save this product(SVG) when the client clicks Checkout.


If you already write your SVG image as a part of product configurations, all you need to do is store SVG as order attribute or just save the final SVG file on disk and save the URL as part of order attribute.
3 года назад
Many thanks for coming back to me.
What I am currently doing is: I created an attribute (SVG). On checkout, I write the string to the attribute input.

My current issue at the moment, How do I gain access to the SVG string in the attributeXML field on the Cart page?

If the SVG was the only value in the attributeXML field, it would be easy, however, I have other attribute values in that field as well.

Essentially I need to be able to display that SVG on the cart page.
3 года назад
[email protected] wrote:
Many thanks for coming back to me.
What I am currently doing is: I created an attribute (SVG). On checkout, I write the string to the attribute input.

My current issue at the moment, How do I gain access to the SVG string in the attributeXML field on the Cart page?

If the SVG was the only value in the attributeXML field, it would be easy, however, I have other attribute values in that field as well.

Essentially I need to be able to display that SVG on the cart page.



I am  still struggling to get my SVG out of the attributeXML on cart. Can someone perhaps guide me?

here is an example of the attributeXML data.
<Attributes>
<ProductAttribute ID="13">
<ProductAttributeValue>
<Value>Charlotte</Value>
</ProductAttributeValue></ProductAttribute>
<ProductAttribute ID="62"><ProductAttributeValue><Value>&lt;svg version="1.1" Id="SvgCan" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 5800 8000"/svg&gt;</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="28"><ProductAttributeValue><Value>162</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="15"><ProductAttributeValue><Value>41</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="25"><ProductAttributeValue><Value>112</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="27"><ProductAttributeValue><Value>132</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="29"><ProductAttributeValue><Value>Maria</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="30"><ProductAttributeValue><Value>164</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="31"><ProductAttributeValue><Value>166</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="36"><ProductAttributeValue><Value>168</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="38"><ProductAttributeValue><Value>173</Value></ProductAttributeValue></ProductAttribute><ProductAttribute ID="60"><ProductAttributeValue><Value>315</Value></ProductAttributeValue></ProductAttribute></Attributes>
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.