Remove Name Attributes from Gift Messages 🏷️
Name attributes specify the name of particular html elements. In the case of gift messages obtained through Giftship, your customer will have filled in fields with name attributes such as ‘To:‘, ‘From:‘, and ‘Message:‘.
For example, here are how the To and From attributes would look on an order.
If you would like to remove these from being included in the automated printing of Gift Messages on packing slips, etc. removing the name attribute value is the best way to do this. (This is an issue that often comes up with the automated printing of templates in 3PL’s such as Shipstation).
Go to Online Store –> Themes –> Your Theme –> theme.liquid, and insert the following code above the closing </body> tag.
To remove the ‘gift:Yes’ attribute, use this code:
<script> /** * This is called every time Giftship loads */ var GsLoaded = function() { // Remove the name attribute from the checkbox. Gs.$('.gs__gift-checkbox').removeAttr('name'); }; </script>
To remove attribute elements of the message sections, edit this code to target what you need to:
<script> var GsLoaded = function() { Gs.$('#to_message').attr('name', 'note'); }; var GsLoaded = function() { Gs.$('#from_message').attr('name', 'note'); }; var GsLoaded = function() { Gs.$('#gsMessage').attr('name', 'note'); }; </script>
Can't find the answer in our documentation?
Contact Support Configuring Gift Messages 🏷️
Printing Gift Messages 🏷️
Conditionally Hide the Gift Message Option on Product Pages 🏷️
Editing a Gift Message After an Order Has Been Placed 🏷️
How to view orders that contain Gift Messages or Delivery Dates 🏷️
Use Shopify’s Packing Slip to Print Gift Messages 🏷️
How to Charge for a Gift Message 🏷️
Remove Name Attributes from Gift Messages 🏷️
How to Display a Gift Message on Your Cart Page When it was Added on Your Product Page 🏷️
Change the location of where the gift message appears on your orders to the order Notes section 🏷️
Ensure empty values are not submitted
Shopify Plus: Loading Giftship’s Features on the Checkout Page