Questions tagged [variables]

The tag has no usage guidance.

36 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
0 answers
190 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 ...
Josiah's user avatar
  • 56
2 votes
0 answers
159 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 ...
pkc21's user avatar
  • 21
2 votes
0 answers
62 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\...
Rasik Miyani's user avatar
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
0 answers
39 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(...
Brobil's user avatar
  • 21
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
1 vote
1 answer
432 views

Magento 2: How to include auto-generated coupon code in Newsletter Subscribe email template

I want to include auto-generated coupon code that expires in 1 usage in newsletter subscribe email template. Any help will be appreciated.
mechanic's user avatar
  • 440
1 vote
0 answers
222 views

Magento 2: Credit Memo refund amount in transactional email

So, I have a custom email setup for credit memo and I am using {{var creditmemo.grand_total}} variable to display refunded amount in my transactional email. Everything is fine except I want to show ...
Shivani Singh's user avatar
1 vote
0 answers
76 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 { ...
zus's user avatar
  • 155
1 vote
0 answers
36 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 ...
Dave Es's user avatar
  • 21
1 vote
1 answer
646 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 ...
Ben's user avatar
  • 141
1 vote
0 answers
220 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.
Cristi Daniliuc's user avatar
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
1 vote
1 answer
4k 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 ...
Jayreis's user avatar
  • 705
1 vote
1 answer
569 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/...
devastato's user avatar
1 vote
1 answer
686 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 ...
Magento Learner's user avatar
1 vote
0 answers
164 views

Magento 2: How to get JSON API Variable in Model

Below is the REST API called on Checkout Page, when you have multiple address & u click on "Ship here" magento/rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id It passes ...
Jackson's user avatar
  • 9,889
1 vote
1 answer
96 views

Email customer when price changes on the product

At the moment I have managed to create a form that will insert product_ID, customer_Email and customer_Price to a table I created in The database. the customer inputs there email and desired price. ...
Mike Tim Turner's user avatar
0 votes
1 answer
135 views

How to get the Order Id, Name and Email variables for a Shopper Approved survey?

Magento 2.4.2-p1 Smartwave Porto theme extensions from Amasty subscribed to a Review service from Shopper Approved We have been subscribed to the service from Shopper Approved for a long time. This ...
Allysin's user avatar
  • 250
0 votes
1 answer
103 views

Migrated Magento 1 Customer address does not show (shows variables as output instead)

First off, I have searched for a solution here, and on Github, this has never been answered specifically from what I can see, none of the answered items work. Migrated Magento 1 address information ...
CvRChameleon's user avatar
0 votes
1 answer
200 views

Convert Magento 1 (migrated) email templates to Magento 2 (variables)

Migrated Magento 1 into Magento 2 does not seem to contain any 'default' Magento 2 email templates (using the Magento 2 migration tool). It only contains the Magento 1 email templates that were ...
CvRChameleon's user avatar
0 votes
1 answer
30 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 ...
Mikishilia's user avatar
0 votes
1 answer
360 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 ...
Sylvester's user avatar
  • 2,204
0 votes
1 answer
167 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 ...
Mike Henze's user avatar
0 votes
0 answers
363 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: ...
Muhammad Azam's user avatar
0 votes
1 answer
30 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=...
goodlook's user avatar
  • 152
0 votes
1 answer
390 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}} ...
Kaushik Kumar Roy's user avatar
0 votes
0 answers
84 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 ...
Goose84's user avatar
  • 2,581
0 votes
1 answer
671 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 : ...
Alexglvr's user avatar
  • 1,675
0 votes
0 answers
545 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?
gh darvishani's user avatar
0 votes
1 answer
80 views

Empty getAddToCompareUrl only in guest mode

I have this variable $_compareUrl=$this->getAddToCompareUrl($_product) to get compare url but this is empty in guest mode, only when i signed in magento it's not empty. I recently migrate from ...
unknownmx's user avatar
0 votes
0 answers
69 views

Can I store a custom variable in a quote? (temporarily) M1.9.2.4

In Magento, can I store a custom variable in a quote? (temporarily) We use an observer for quote item ... but I need to store a variable in the qupte to use later .... this cannot be used sales/...
snh_nl's user avatar
  • 5,422
0 votes
1 answer
88 views

Javascript - Read script js only if radio is checked

i'm stuck in a problem with a script js. This is the condition: var stampProd = "?php $stampProd = '10001'; ?"; function valiAnswPos(){ if (document.getElementById("positive")....
Gabriel91's user avatar
  • 487
0 votes
1 answer
498 views

Discount label and code variable

I am trying to create custom variable in Magento, but how do I get the discount label for the code used and variable for discount description. I have found the following code, but am not sure how to ...
pasujemito's user avatar
0 votes
2 answers
358 views

I have send custom mail and set the custom variable but. When I access the variable in transaction mail template then it will not work

This is my email sending code if (isset($_POST['send'])) { $templateId = 9; $sendername = 'Call To Order'; $senderemail = $_POST['email']; $sendermobile = $_POST['mobile']; $...
Amaresh Tiwari's user avatar