A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [variables]

The tag has no usage guidance.

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

Magento 1 - Debug magento backend variables

I added some checkboxes to the contact form. e.g. <input name="katalogcheckbox[]" id="katalog_1" title="Katalog für Insektenschutz bestellen" value="katalog_A" type="checkbox" class="checkbox" /&...
1
vote
1answer
23 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
19 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
18 views

Magento 2.3 Custom Variables in blocks

I have the next problem, I want to use the Porto Owl carousel in combination with a custom variable for the category_id tag. But it would turn out looking like this: {{block class="Smartwave\...
0
votes
0answers
240 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
210 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
73 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....
1
vote
1answer
18 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!
0
votes
0answers
35 views

Magento 2 insert Custom variables in Order Update Email Template {{var custom.customattribute}}

Does anyone know how I can manage to make variable to insert a specific data field from a custom checkout field in the email templates for Order update? I am using the module One Step Checkout for ...
3
votes
2answers
543 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
79 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
15 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
116 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
510 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
0answers
36 views

when creating trying to insert variable in email template I receive [object Object]

I'm experiencing an issue when trying to insert variables in email templates. Instead of receiving a list with variables I'm receiving [object Object] I'm using Magento 2.3 and I migrated from 1.7 ...
0
votes
1answer
65 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
47 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
20 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
43 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 ...
1
vote
0answers
22 views

in 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
3answers
738 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
358 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 ...
0
votes
1answer
487 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
55 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
166 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
354 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
56 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
164 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
615 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
254 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
1k 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
42 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
65 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
33 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
65 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 ...
0
votes
1answer
570 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
434 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
359 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
2k 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
421 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 { ...
2
votes
0answers
35 views

Passing variable into head.phtml

I want to generate dynamic meta title categories, based on category level. In view.phtml category this is my code: <?php $category = Mage::getSingleton('catalog/layer')->getCurrentCategory(...
2
votes
2answers
1k views

Getting the shipping method code in transactional emails

We’re currently calling the variable "{{var shippingMethod}}” but it’s retrieving the description “fedex_STANDARD_OVERNIGHT”. Is there a way to grab the code in place of the description. For the ...
1
vote
1answer
163 views

How can I use my own custom system settings in e-mail templates?

I have this custom configuration in my system.xml: <system> <section id="general"> <group id="store_information"> <field id="support_phone" translate="...
4
votes
2answers
3k views

How to retrieve variable from CMS page in Magento 2

In Magento 1.9.x, we can do it like below In CMS page, add content: {{block type="core/template" name="..." my_vars="123,456" template="path-to/test.phtml"}} Create path-to/test.phtml: <?php ...
1
vote
1answer
492 views

Display Polls with a custom template shows only empty results

Meta Magento 1.9.2.1 Custom Template Poll works fine when in sidebar Poll works fine when loaded by layout xml History Based on this information: http://inchoo.net/magento/magento-frontend/...
0
votes
0answers
433 views

create custom variable for custom module in magento 2

Is it impossible to create a custom variable, such as {{var customer.getName()}} in a custom module and use it?
0
votes
1answer
579 views

Where can I change the value for direct_url privacy-policy-cookie-restriction-mode?

Although I can edit the cookie_restriction_notice_block to change the link to the relevant Privacy Policy page I would like to be able to change the value of {{store direct_url="privacy-policy-cookie-...
1
vote
1answer
1k views

Magento 1.9 {{var payment_html}} alternative

I'm writing my own function for sending emails. In the Magento email template, there's a variable {{var payment_html}} which I need to convert to $order object. The question is how can I get the ...
1
vote
1answer
396 views

Magento 1.9 sendTransactional doesn't show value from {{var payment_html}}

I'm using sendTransactional() to send emails programmatically. All working fine beside the variable {{var payment_html}} is empty. How to pass this value? below is the code I'm using now. private ...