Hi team, this is my first time posting a question. Ive been trying to create a delete button to delete addresses but i keep getting this error message “Parameter Missing or Invalid: Required parameter missing or invalid: address” when clicking on the button. Can someone help me out? Thank you!
Im using the Skeleton Theme 1.0.0.
Please let me know if you want additional info like HTML snippets or screenshots.
Hey @Studio_Blank usually we’d see this pop up if the address object wasn’t being passed properly. Are you setting this up on a specific Liquid page or within a template?
If you’re able to share your Liquid snippets for the button, I can definitely take a look and see if we can find out what’s causing the issue.
Hope this helps/hope to speak with you soon!
Hello Alan. I have a file called customers/addresses.liquid in the templates folder and a style-addresses.css in the assets folder. Below is the HTML code snippet that includes the form submission buttons like Delete and Set as default. I also included the new address form temporarily just for testing but im getting the same results.
<div class="address-page-container">
{% if customer.addresses.size > 0 %}
{% for address in customer.addresses %}
<div class="address-wrapper">
<div class="address-wrapper-header">
{% if address == customer.default_address %}
<h5>{{ 'icon-checkmark.svg' | inline_asset_content }}Default Address</h5>
{% else %}
{% form 'customer_address', address %}
<input type="hidden" name="_method" value="put">
<input type="hidden" name="address[default]" value="true">
<button
type="submit"
class="set-default-button"
>
{{ 'icon-pin.svg' | inline_asset_content }}
Set as default?
</button>
{% endform %}
{% endif %}
{% form 'customer_address', address %}
<input type="hidden" name="_method" value="delete">
<button
type="submit"
class="delete-address-button"
>
{{ 'icon-trash.svg' | inline_asset_content }}
</button>
{% endform %}
</div>
<div class="block">
<h5>Name</h5>
<p>{{ address.first_name }}</p>
<p>{{ address.last_name }}</p>
</div>
<div class="block">
<h5>Address</h5>
<p>{{ address.address1 }}</p>
{% if address.address2 != blank %}
<p>{{ address.address2 }}</p>
{% endif %}
</div>
<div class="block">
<h5>Country</h5>
<p>{{ address.country }}</p>
{% if address.province != blank %}
<p>{{ address.province }}</p>
{% endif %}
</div>
<div class="block">
<h5>City</h5>
<p>{{ address.city }} - {{ address.zip }}</p>
</div>
</div>
{% endfor %}
{% else %}
<h5>No addresses saved.</h5>
{% endif %}
</div>
I just tried deleting the customers/address and found that it works. Have you fixed it yet?
Hello. Sorry for the extremely late reply. Yes, ive been doing a lot of research on why this happens and i had to rebuild the entire Liquid code snippet to make sure everything is correct. I just had to replace this form tag {% form %}
that was used for the delete button with this tag <form>
. im not sure why but hey, it works. I apologize for wasting your time.
For anyone having the same issue, try replacing the form tags that you use for form buttons like delete, submit and set default.
Hey @Studio_Blank - glad things are solved for you. Your solution was my hunch as well (just didn’t want to jump to conclusions in case I was off base though
). The
{% form %}
tag automatically generates the form, but it can be strict about parameter passing for customer addresses for sure (a bit more info here).
Thanks for sharing your solution in the thread here too - definitely will be helpful if folks stumble across this thread in the future!