How to edit request quote block?

How to edit request quote block?

safetyvalves
New Member
4 0 0

Using the Empire theme. Is it possible to edit the text circled in Red to say "Send message" instead of "Request quote"? When you try to customise the block it only allows you to change the heading but I don't know if any code can be changed in the background to modify the button text?

 

An example product: https://safetyvalvesonline.com/collections/safety-relief-valves/products/altecnic-caleffi-pressure-r...

 

Screenshot 2024-10-18 092357.png

Replies 5 (5)

rajweb
Shopify Partner
275 23 25

Hey @safetyvalves ,

To change the button text from "Request quote" to "Send message" in the code snippet you provided, you can follow these steps:

1. Online Store > Themes > Edit Code 

2. Locate the Relevant File

Look for the file that contains the provided code snippet. It could be in a file related to your contact form or quote request. Common files to check include:

1. contact-form.liquid

2. request-quote.liquid

3. Any section file like form-section.liquid pr similar.

 

Update the Button Text

In the appropriate file, find the code snippet:

<button class="button-primary contact-form-button mdc-ripple-surface mdc-ripple-upgraded" type="submit">
  Send
</button>

Change it to:

<button class="button-primary contact-form-button mdc-ripple-surface mdc-ripple-upgraded" type="submit">
  Send message
</button>

If I was able to help you, please don't forget to Like and mark it as the Solution!

Best Regard,

Rajat Sharma

-Need a Shopify developer?
https://rajatweb.dev/
Email: rajat.shopify@gmail.com
safetyvalves
New Member
4 0 0

Thank you for your reply. I believe it is in the section snippets/product-request-form.liquid however I can't see where I would change the code for the button text as there doesn't appear the phrase "Request quote" in the code.

 

Screenshot 2024-10-18 101033.png

rajweb
Shopify Partner
275 23 25

Could you please provide me with the full code? I’ll make the necessary changes to it.

-Need a Shopify developer?
https://rajatweb.dev/
Email: rajat.shopify@gmail.com
safetyvalves
New Member
4 0 0

{% comment %}
@param product {Object}
The product object

@param heading {String}
The block heading

@param show_quantity {Boolean}
If true, show the quantity field

@param show_message {Boolean}
If true, show the message field

@param selected_variant {Object}
The selected variant

@param sku {String}
The variant SKU
{% endcomment %}

{% if heading != blank %}
{% form 'contact', class: 'product-request-form', id: 'product-request-form', data-product-request-form: '' %}
{% if form.posted_successfully? %}
{% assign posted = true %}
{% endif %}

<details class="product-request-form__disclosure" {% if posted %}open{% endif %}>
{% if posted %}
<div class="product-request-form__success-message">
{{- 'product.blocks.request_quote.success' | t -}}
</div>
{% elsif form.errors %}
<div class="product-request-form__error-message">
{{- form.errors | default_errors -}}
</div>
{% endif %}

<summary class="product-request-form__heading">
<span>{{- heading | escape -}}</span>
{% render 'icon-chevron-down-small' %}
</summary>

{% unless posted %}
<div
class="
product-request-form__field
product-request-form__field--columns
"
>
<div class="product-request-form__field-column">
<input
class="form-field-input"
id="product-request-form__name"
name="contact[name]"
type="text"
required
>

<label
class="form-field-title"
for="product-request-form__name"
>
{{- 'product.blocks.request_quote.name' | t -}}
</label>
</div>

<div class="product-request-form__field-column">
{% liquid
assign value = ''

if form.email
assign value = form.email
elsif customer
assign value = customer.email
endif
%}

<input
class="form-field-input"
id="product-request-form__email"
name="contact[email]"
type="email"
value="{{- value -}}"
required
>

<label
class="form-field-title"
for="product-request-form__email"
>
{{- 'product.blocks.request_quote.email' | t -}}
</label>
</div>
</div>

<input
name="contact[product]"
type="hidden"
value="{{- product.title | append: ' - ' | append: canonical_url | escape -}}"
>

{% unless product.has_only_default_variant %}
<input
name="contact[variant]"
type="hidden"
value="{{- selected_variant.title | escape -}}"
data-request-form-variant
>

<input
name="contact[id]"
type="hidden"
value="{{- selected_variant.id -}}"
data-request-form-variant-id
>
{% endunless %}

<input
{% if sku != blank %}
name="contact[sku]"
{% endif %}
type="hidden"
value="{{- sku -}}"
data-request-form-sku
>

{% if show_quantity %}
<div class="product-request-form__field">
<input
class="form-field-input"
id="product-request-form__quantity"
name="contact[quantity]"
type="number"
min="1"
>

<label
class="form-field-title"
for="product-request-form__quantity"
>
{{- 'product.blocks.request_quote.quantity' | t -}}
</label>
</div>
{% endif %}

{% if show_message %}
<div class="product-request-form__field">
<textarea
class="
form-field-input
form-field-textarea
"
id="product-request-form__message"
name="contact[message]"
data-product-request-form-message
>
{{- form.body -}}
</textarea>

<label
class="form-field-title"
for="product-request-form__message"
>
{{- 'product.blocks.request_quote.message' | t -}}
</label>
</div>
{% endif %}

<div class="product-request-form__action">
<button
class="button-primary"
type="submit"
>
{{- 'product.blocks.request_quote.submit' | t -}}
</button>
</div>
{% endunless %}
</details>
{% endform %}
{% endif %}

safetyvalves
New Member
4 0 0

@rajwebHopefully the above is the correct section you require. Thank you.