Questions tagged [custom-variable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Custom Variable get dynamic value based on Realtime condition magento2

I have Create the custom variable programmatically like below. updating custom variable value programatically Ex. I have created the current_time variable now I insert the variable in the email ...
Jigar Jansari's user avatar
0 votes
1 answer
37 views

Magento2 Order email missing custom variable values for first time & when I send email from admin it shows values

Magento2 Order email missing custom variable values for first time & when I send email from admin it shows values Basically this custom variable values are the order attributes. I have used this ...
Arjun's user avatar
  • 3,566
0 votes
1 answer
43 views

How to add billing Country_id from sales_order_adress in Email Template

I am using Magento Version 2.4.5, I want to specifically add the country_id (e.g. FR for France) in the order email template. The variable with the Billing address only returns the full address block....
JkCasi's user avatar
  • 1
1 vote
1 answer
372 views

Magento 2 : Add variable in Page builder from url params

I am looking to add variables in the Page Builder coming from the url parameters. Do you have an idea how to do it? Thanks.
blind's user avatar
  • 11
1 vote
0 answers
130 views

List of custom variables that can be accessed inside a static block

What I want to do is inject variables into static blocks. I know this can be achieved in System -> Custom Variables but it wouldn't be any quicker than opening up every static block to change the ...
SilkSpin's user avatar
  • 192
0 votes
5 answers
3k views

Magento 2.4.x: How to pass custom variable from controller to phtml file?

Is there a way to pass a variable from controller to a phtml file without using registry? I tried this: Magento 2 pass data from Controller to Block and display in Template but it is not working.
mechanic's user avatar
  • 440
0 votes
1 answer
31 views

Control Variabile Print fron Backend

I have created a simple extension. In that, I add blocks on the product page. On the product page, I am printing some variables through a custom file in phtml above the add to cart button. Example: $...
KernelPaniC's user avatar
2 votes
0 answers
137 views

Translate custom transactional email variable

I used this observer: email_shipment_set_template_vars_before to add a custom transactional email variable. This is the code from the observer: $transport = $observer->getData('transportObject'); $...
Attila Naghi's user avatar
  • 3,963
0 votes
2 answers
35 views

How to make a list of products from a custom variable?

I have a customized variable called "brand" and I want to show all products with the same value as this variable. It is possible to do this with the advanced search. but the look is not very ...
Jonas Lima's user avatar
2 votes
1 answer
548 views

How would it be possible to change the color for a url that is a Custom Variable inserted in a transactional e-mail?

Here is the custom variable: <a href="https://customer-support-page">CUSTOMER SUPPORT</a> It gets a default color: #aaa; and I cannot manage to find where is that color set from ...
Doina's user avatar
  • 23
0 votes
3 answers
2k views

How to call Magento 2 custom variables in phtml file?

I have created custom varibles in "System -> Other Settings -> Custom Variables" for different store views. How can i call them in phtml files for store views? I am trying following ...
Efex's user avatar
  • 73
0 votes
1 answer
710 views

How to redirect to controller using jquery ajax in magento 2.3.5

I want to pass dynamic text-box value to controller using ajax, so if anyone have idea about it then please share with me. Thanks In Advance
Deep Shah's user avatar
  • 555
3 votes
1 answer
3k views

Magento 2 email_order_set_template_vars_before observer triggers only when I resend email in the admin

I created a new template var using email_order_set_template_vars_before observer and it works when I send email new order through the Magento admin. But it does not trigger when new order is placed. ...
mysterious's user avatar
0 votes
0 answers
93 views

Custom email template, use user id. Magento 2.3.4

I want to use user id/name in custom emails, when i use {{trans "% name," name = $ user.name}} , i get empty field. Do I have to create custom variables for this data?
mac_mod's user avatar
0 votes
0 answers
190 views

Magento 2 - Custom Variables API

I was wondering if there is an API for the Custom Variables in Magento under System > Other Settings > Custom Variables. Going through the System > Integrations > API lists it as ...
V Salvador's user avatar
0 votes
0 answers
972 views

Magento 2 - Custom Variable | How to get the Plain Value as well as HTML value using directive {{CustomVar code="CUSTOM_VAR_CODE"}} in CMS Blocks?

I have added the Custom Variable from Admin > System > Other settings > Custom Variables > Add New Variable, it is possible to add both the Variable HTML Value as well as Variable Plain Value as in ...
Nitesh Lakhwani's user avatar
0 votes
0 answers
262 views

Magento2 echo current year/month as custom variable?

Looking for a way to echo the current day of week, month, and/or year as a custom variable? Can this be done? I want to add it to a CMS page as a text so that in other words, if I say: "Looking for ...
CJ Solutions's user avatar
1 vote
0 answers
14 views

How make a custom variable to get Payment ticket bank (Boleto in PT-BR) in Magento 2

How can I get a payment ticket link in Magento 2 and set this value in a "Custom Variable" to use in my emails Templates? I know how to get a transaction and I think the ticket is a string inside "...
Vinicius Silva's user avatar
0 votes
1 answer
2k views

Add email variable to all transactional emails

Is there any way to add one email variable to all transactional emails? My idea is to create a custom variable, put some code in it and display it in all transactional emails.
Rufus's user avatar
  • 621
0 votes
1 answer
246 views

Magento 2 - Transactional email templates

How I can get Sales Representative Contact Email in a transactional email templates? I try to add something like this but the href is not display: <li style="background: black; color:white;"> ...
Robert's user avatar
  • 2,166
1 vote
0 answers
297 views

How to Create Custom Variables inside WYSIWYG editor in Magento 2?

I have created a Custom field under Stores->Configuration->General. I need to use that field as Custom variable inside WYSIWYG editor when Insert Variable option is clicked. I don't Know how to ...
aravind's user avatar
  • 1,834
0 votes
0 answers
361 views

Magento2 How to create custom variables to use on config.xml

In the etc/config.xml I can use some variables, like {{base_url}}, but I need to use other urls in this config. How I can create custom variables to use in the etc/config.xml file? Example: In my ...
Douglas Ianitsky's user avatar
1 vote
1 answer
2k views

magento 2 dynamic value not comes in custom email template

I am trying to send dynamic value in my custom email template. I can send email with my custom template, but dynamic value not able to pass in that email. Here is my code for send email $...
user55548's user avatar
  • 599
1 vote
1 answer
215 views

How to remove first few digits from order id using order id variable in email template

I am using a 3rd party plugin for order number customization and the format I am using is- {order id}-{counter}AB e.g. 1234-30000AB In the email template when I include order id variable it ...
Himanshu's user avatar
0 votes
1 answer
247 views

How to add custom configs variables to custom shipping method?

I have created a custom shipping method following this tutorial: https://www.mageplaza.com/devdocs/magento-2-create-shipping-method/ Now I would need to add a couple of extra variables to admin ...
Daniel Silva's user avatar
1 vote
1 answer
2k views

Magento 2: format var invoice.created_at

I'm using EaDesgin/magento2-pdf-generator2 to format the customer's invoice. This works nice. But in this template I use the magento 2 variable {{var invoice.created_at}}, what gives me the ugly ...
DaFunkyAlex's user avatar
0 votes
1 answer
112 views

Showing Variable in Magento Description

Is there a way to show Custom Variables in Magento Description? There are lots of products which has a paragraph as common, so I want to use the variable for that. In case something changes in ...
A.Agg's user avatar
  • 43
2 votes
1 answer
1k views

Magento 2 : How to Insert Category Name as Meta-Description of Each Category From Admin

From admin, I'm trying to insert category name as a variable in metatags (something like {category name} in meta description). I go to admin: Products -> Categories. From the details of Category, ...
Md ritzwan's user avatar
1 vote
0 answers
1k views

Get custom variable in phtml file - Magento 2 theme Luma | HELP

I created this custom variable Path: Stores -> Attributes (Product) Code Variable: time_di_consegna_modulo Now I want to print the variable inside the product page. Path: public_html / vendor / ...
Alessandro's user avatar
2 votes
2 answers
5k views

How to use custom variables in Magento 2?

I have seen email templates to use built-in custom variables. Can someone explain how to use System -> Other Settings -> Custom Variables? For example category count, which will show in frontend....
Bojjaiah's user avatar
  • 3,988
2 votes
1 answer
803 views

is there a way to add custom variables to product description (using the editor) in magento 2?

I am using magento 2.2.2 and I want to add custom variables to the products description. for now, I can do that with the pages but not for the products (in the page editor there's a button called "...
guest's user avatar
  • 21
2 votes
1 answer
3k views

Get plain value from custom variable in php with objectManager

I want to get a plain value from custom variable (defined on admin) in php with objectManager. storeID is in $order->getStore()->getId() Custom Variable Code is 'mycustomvar' why does ...
rico's user avatar
  • 31
0 votes
1 answer
497 views

convert {{var customer.getName()}} to customer name

I am create SMS module and in SMS template i use custom variable such as {{var customer.getName()}} . How i can convert this variable to same variable for example if user use {{var customer.getName()}...
gh darvishani's user avatar
1 vote
1 answer
167 views

use customer variable text in email

I know in email we can use {{var customer.getMarketerName()}} for get and use customer attribute. But my attribute is an select and above code return id replace text how I can get attribute text?
gh darvishani's user avatar
2 votes
0 answers
889 views

Magento 2 : How to Load a Cms Block and Set Custom Variable Values

I created cms block with custom variable name 'redemption'. I wanted to load cms block, pass and replace value to custom variable 'redemption'. Please help, It's Urgent.
Akhil Kurian's user avatar
0 votes
1 answer
397 views

Magento(1.6.2.0) add custom customer registration field to email template

i used the new customer registration field guide from here: (Thanks @Marius) https://magento.stackexchange.com/a/65760/47305 Works fine but is it possible to add the new created custom field in ...
w00druFF's user avatar
3 votes
0 answers
6k views

How to Use Custom Variable in Email Template?

I'm following below post & able to send email. how to send custom email no template in magento2? I have created 1 custom variable named Custome Footer. app\code\Custom\Module\view\frontend\...
Jackson's user avatar
  • 9,889
2 votes
1 answer
5k views

How to use custom variables in phtml file for email

I have created a Transactional Emails template in magento admin to send multiple coupon codes dynamically for this I have created a template file says email/custom.phtml and it is included in email ...
Vinaya Maheshwari's user avatar
3 votes
1 answer
559 views

Magento 1 - Can Custom Variables be translated?

I got a question about Custom Variables. Our store uses them to have Print Specifications for different products. Is it possible to translate those Custom Variables? I have tried putting: <?php ...
Kalvin Klien's user avatar
1 vote
3 answers
2k views

How to add template in Custom Variable HTML Value in magento

I have created a custom variable in magento. But I want to call a template file for this variable value. For this I am using {{block type="core/template" template="custom/my.phtml"}} in Variable ...
Vinaya Maheshwari's user avatar
2 votes
2 answers
10k views

Get my custom variable into an email template

We currently use a plugin for gaining points when ordering items. I want to display the users points balance inside various emails, now the plugin company gave me the code to echo out the current ...
KiwisTasteGood's user avatar
1 vote
2 answers
127 views

I want to store the detail's in custom variable any one know how to done this?

I want to store the detail in custom variable any one know how to done this? like {{order_number}},{{order_price}} i want set variable at backend.
Ajay Patel's user avatar
  • 1,513
1 vote
0 answers
163 views

Set custom field value in customer registration

I created a custom field named location_city in customer. In the admin, under Account Information tab, the name of the field is: account[location_city] Now during new registration, I want to set the ...
Ashutosh Pandey's user avatar
1 vote
1 answer
337 views

How to use custom variable in magento custom module

I have created a custom module for send SMS at the time of order place, I have created a observer for this which works and send SMS to customer. I have provide message field in system configration and ...
Vinaya Maheshwari's user avatar
2 votes
3 answers
2k views

Use a custom variable in a category description

I recently created a custom variable named storecount - which I'll be programatically increasing for every store that is added to my store locator plugin. I'd like to show this in various locations ...
Liam McArthur's user avatar
1 vote
1 answer
3k views

Custom Variable Plain Value in Email template

I'm aware that it's possible to call the HTML value by: {{customVar code=custom_variable_code}} Question is simple: Is it possible to receive plain value of custom variable in email template (Magento ...
versedi's user avatar
  • 2,059
0 votes
1 answer
68 views

Custom variable in block always giving last requested value in phtml file

I've injected custom variable named slider_id to my block like below, <reference name="content"> <block type="sliderpro/sliderpro" name="defaultslider" as="defaultslider" before=...
Vinoth Pandiyan's user avatar