Questions tagged [variables]
The variables tag has no usage guidance.
104
questions
1
vote
0answers
17 views
Magento 2 common css variables not applied for third party modules
I am using a custom theme, declared common variables under,
app\design\frontend\Zero\my_theme\web\css\source\components
1) _variables.less
Eg:
@h1__font-size: 48px !important;
2) common.less
Eg:
h1 {
...
0
votes
1answer
27 views
Other Method for call a custom customer attribute
I am doing an internship in a company, and my internship supervisor wants me to display customer data.
More precisely, on the back office in the customer information there is a custom attribute that I ...
0
votes
1answer
14 views
Magento 2 Notice: Undefined variable: images
I use custom variable in Mirasvit Extension for export parent images also from variants.
For test I export single product and working correct. Now I set filter with export all configurable products in ...
0
votes
1answer
35 views
Magento 2 - How to add customer name in CMS page/block?
I need to add the name of the customer into a CMS Site or Block. I tried to insert {{var customer.name}} as seen in the documentation, but it does not work.
0
votes
1answer
19 views
Global variable override by Bootstrap style
I have declare h1 tag font size in global variable,
app\design\frontend\zero_theme\theme\web\css\source\components_variables.less
@h1__font-size: 48px !important;
Declare inside the custom less file,
...
0
votes
0answers
8 views
Magento2 unidentified variable
I wanted to display the attribute "brand name" in slider.phtml above product name.
I add below code:
<?php
$optionText = '';
$attr = $_product->...
0
votes
1answer
46 views
How to input these variables in a magento 2.3.4 mail template
We would like to display these variables in a new email template (which is currently assigned to a orderstate):
Ordernumber, Customername, Order Status & Invoicenumber.
The following code does not ...
0
votes
0answers
9 views
Advanced Search Amending Base URL
Using the base URL variable {{config path="web/unsecure/base_url"}} on advanced search page (url/catalogsearch/advanced?) seems to display different results based on whether the variable is ...
0
votes
0answers
11 views
Magento 2.3 - Adding Product Name and Price into a New Order email template
I want to be able to pull the Product Name and Price from a new order to include it in the New Order email template.
I need to add both variables into a url to redirect users somewhere else once they'...
0
votes
1answer
31 views
Custom variable access using 'var' on working on product detail page in magento 2
I am trying to access custom product attributes value in product description on product detail page using 'var' Like for e.g {{var waz_origin}}
But i am not getting its value on frontend. See https://...
2
votes
0answers
66 views
How to use product name variable in product description - Magento 2.3.5
I would like to create one product description that I can copy and paste into multiple products. Is there a way to pull the product name and other product attributes with a custom variable into the ...
0
votes
1answer
27 views
Can i import theme variables to custom less file?
I want to add a variable that located in "web/css/source/_theme.less" to my custom less file, that I created specialy for home page. I added my less file in "Magento_CMS/layout/cms_index_index.xml"
&...
1
vote
0answers
43 views
Adding Predefined Variables to New Email Template?
I am creating a new email template and am trying to attach predefined variables (specifically Order Id) to the new template. I would like the option of clicking on the "Insert Variable" button and ...
1
vote
1answer
51 views
Display Customer Email, Customer Phone, Product Name, Product SKU in email template in magento 1.9
I need to display Customer Email, Customer Phone, Product Name, Product SKU in order email.
{{template config_path="design/email/header"}}
{{inlinecss file="email-inline.css"}}
<p><...
1
vote
0answers
23 views
M2 - Variables empty in CMS Pages
No matter if System Variable or from the STORES > CONFIGURATION > Store Information fields, I can not output variables in cms pages. It feels like I'm missing something so basic, that I can not even ...
0
votes
0answers
256 views
Magento2 Back End is working fine but front end is not working and showing This page isn’t working error
I am working on a Magento 2 project, and it was working fine until today, but now when I try to open it, the page is not working.
The following error is coming in error log:
PHP Fatal error: ...
6
votes
2answers
1k views
Magento 2: Pass variable from phtml to js
here is my layout
<referenceContainer name="minicart.addons">
<block class="Vendor\Mymodule\Block\Cart\Sidebar" name="shipping_bar" template="Vendor_Mymodule::cart/minicart.phtml">
...
0
votes
2answers
293 views
Email variable order.getShippingAddress().getStreet1() returns null
I have created custom order email template and placed some order shipping address variables inside it.
Most variables work ok, but the following are always returning no value:
{{var order....
2
votes
1answer
148 views
Variable for invoice date - Magento 2.2.6
Is there a variable for the invoice date (invoice created on...) in Magento 2? I would like to add this to the standard template for invoice pdfs.
Thanks in advance!
5
votes
3answers
2k views
Magento2.3 : Email template address variable not displays the value
The email template doesn't get a shipping method variable.
As you can see $billing.getName not works.
Shipping and Billing information is empty.
Maybe something wrong with forms or submitting ...
1
vote
1answer
488 views
Dynamically add year variable to meta title / description in Magento 2
I am trying to automatically add the current year to the meta title and description in for example category-pages. I want to achieve something like this:
Meta title: "The best category items for {{...
0
votes
1answer
21 views
get querystring variables to display on static page
How to get querystring information and display on a landingpage?
This is a link created on another website with variables to pass to magento2.3.1 website.
www.mymagentowebsite.com/staticpage.html?w=...
1
vote
1answer
401 views
M 2.3.1: Imprint variables are not showing up in E-Mail templates
I have the following problem.
I have populated the bank and imprint data as per Configuration -> General -> Imprint for all my store views under Magento 2.3.1
Now I am populating my e-mail template, ...
0
votes
1answer
1k 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.
0
votes
1answer
160 views
how to validate custom fields using variables in magento 2
here have two fields
1)Fields_1
2)Fileds_2
here i want to validate Field_2 < Filed_1 (less than )
how i do this in magenot 2???
Field_2 Tag
<div class="field">
...
0
votes
1answer
174 views
How to convert template variables to custom data in magento 2
I have configured a back-end screen where I will enter a string as
{{price}} for guest user. click here {{sign_up}}.
So after I fetch the field value I want to dynamically replace the {{price}} ...
1
vote
0answers
25 views
Email templates - variables names get translated instead of showing the value
I'm using magento 2.2.6.
My email templates are displaying the translation of the variable used and not their value.
I have installed a translation pack for Romanian.
0
votes
1answer
72 views
Magento variable for access token
currently I have hardcoded my API token in my controller, Need to make it configurable so that it can be configured when the code is deployed in production.
So how can I store it on Magento variable ...
2
votes
0answers
29 views
magento 2 I want to write the dynamic {{var shipping_company}} into the xml file
Helllo,
i want to set the the dynamic value of variable into xml file
try {
$om = \Magento\Framework\App\ObjectManager::getInstance();
$filesystem = $om->get('Magento\Framework\...
2
votes
4answers
2k views
how to pass a variable from one phtml to another?
I have two phtml which have its own unique block file. I need to pass variable from one phtml to another.
PHTML 1
<?php
$option_id = 20;
?>
<a href="<?php echo $baseUrl ?>/...
2
votes
3answers
762 views
Magento 2 add customer group as Email Template variable
In magento 2 it is possible to create Email Template variables, however, those variables are html or plain text.
I'd like to create a variable containing the user group, so i can use this variable to ...
1
vote
2answers
2k views
Magento 2 system variable for “Order Created at” for email templates
What is the email template system variable for "Order Created at" for Magento ver. 2.2.6?
Using the variable name: {{var order.getCreatedAtFormated('long')}} doesn't work for me. This is a variable ...
2
votes
1answer
163 views
How to get value in function that is retrieved and stored in a variable of another function in same class | Magento 2
I want to use $orderId value in other functions.
Here is class
<?php
namespace vendor\module\Observer;
use Magento\Framework\Event\ObserverInterface;
class Observer implements ObserverInterface
...
1
vote
2answers
203 views
Passing magento username and email variables into js script (Magento ver. 2.1.8)
<!-- Head -->
<script src="https://wchat.freshchat.com/js/widget.js"></script>
<!-- Head -->
<script>
window.fcWidget.init({
token: "WEB_CHAT_TOKEN",
host: "...
1
vote
2answers
712 views
Getting the Store Name in a Block
Is it possible to output the store name using double curly brace syntax?
For example, I know I can output the contact page's URL using:
<a href="{{store url="contact"}}">Contact Luma</a>
...
1
vote
1answer
117 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 ...
0
votes
1answer
267 views
Magento 2: Parsing Item information through block
I want to create a phtml file and create a dynamic block with that one to put on CMS pages - Take it as product information blocks where i want to display the product name, the price, the URL - ...
1
vote
2answers
1k views
How can we pass table to an html variable in php code? Magento2 TCPDF
I am using TCPDF Library to get PDF Downloadable. I have to pass retrieved data through loops to single vaiable as:
$tcpdf->writeHTML($html, true, false, true, false, '');
I have to pass these ...
0
votes
2answers
648 views
Magento 2 | Variable with StoreViewCode
I want to get the BaseURL with the StoreViewCode via Magento 2 Variables but with no success. I have the "add Storeview to URL" enabled at the Backend and using the following variable only shows the ...
0
votes
1answer
3k views
How to set session variable
I need to set a variable session in Magento, do I do just procedural PHP or is there a proper way in Magento 2 ?
Example :
$_SESSION['myKey'] = "00001";
@AnsarHunsain code help me, but I can't get ...
0
votes
0answers
43 views
Customising email variables
Is it possible to customer email variables? For example, there is a variable for Shipping description: {{var order.getShippingDescription()}}
In the email I want to change new lines (\n) to be line ...
0
votes
1answer
87 views
Magento2: variables
I need to configure a script that sends a survey to clients to fill in for trusted reviews.
<script type="text/javascript">
client_email = ‘here I want display: CUSTOMER EMAIL ADDRESS’;
...
1
vote
1answer
52 views
Source location for variables that can be change e.g background-color - Magento 2
Sorry for the simply question,
I've seen in several posts that people have made a new theme and changed say the background of the homepage and would like to know where these variables are located. I ...
1
vote
1answer
78 views
{{store url=“ ”}} or {{base_secure_url}} or {{base_unsecure_url}} for my situation?
Which one of these is best if I am running one store and the test environment is running unsecure where as production is running secure and we're only planning to have one store in the Magento ...
1
vote
1answer
1k 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 ...
2
votes
1answer
552 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 "...
0
votes
2answers
488 views
Magento 1 Variable to check if customer is subscribed to newletter
Is there a variable I can include in the transactional emails to show whether the customer has subscribed to the Newsletter or not?
1
vote
1answer
3k views
Sending variable to a bootstrap modal
I have seen this asked before but a lot of the answers I found where people looking to get a variable into a modal to query a database. However thats not what I want. I just want to send a variable ...
0
votes
1answer
520 views
Magento2 : third party js file including issue
I am using three.js (source code) in a module page:
requirejs-config.js
var config = {
map: {
"*": {
three: "Vendor_Module/js/three/build/three",
and in the phtml file :
...
0
votes
1answer
2k views
Magento 2 : How to pass variable to controller from observer
I am not able to pass variables to controller from my observer file.
Below is the code for observer:
class Sendtogateway implements \Magento\Framework\Event\ObserverInterface
{
...