How to use custom variables in Magento 2?Use a custom variable in a category descriptionHow to use custom...

Why zero tolerance on nudity in space?

What is the difference between rolling more dice versus fewer dice?

Difference between i++ and (i)++ in C

Why do neural networks need so many training examples to perform?

I will be going to Sweden on business purpose .Can I visit London from Sweden and how much UK visa will cost?

How can my powered armor quickly replace its ceramic plates?

Story about a person invited to join council of intellects

Why was Lupin comfortable with saying Voldemort's name?

How should I handle players who ignore the session zero agreement?

Is boss over stepping boundary/micromanaging?

Publishing research using outdated methods

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

Comparing two arrays of unequal length

How to prevent cleaning lady from hunging my lock screen in ubuntu 16.04

The use of the spellings -zz- vs. -z-

Why is working on the same position for more than 15 years not a red flag?

What are the exceptions to Natural Selection?

Why would space fleets be aligned?

IGBT transistor with auxiliary emitter

Does theoretical physics suggest that gravity is the exchange of gravitons or deformation/bending of spacetime?

Can you tell from a blurry photo if focus was too close or too far?

How do you funnel food off a cutting board?

use of 4/2 chord more compelling than root position?

Play Zip, Zap, Zop



How to use custom variables in Magento 2?


Use a custom variable in a category descriptionHow to use custom variable in magento custom moduleGet my custom variable into an email templateCustom shipping methodMagento 2: How to create custom email template for a specific form?How to create my own custom variables for order emails?Get custom variable in phtml file - Magento 2 theme Luma | HELPShowing Variable in Magento DescriptionHow to add custom configs variables to custom shipping method?Magento2 How to create custom variables to use on config.xml













1















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.










share|improve this question














bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Did my answer solve your query?

    – Vivek Kumar
    Feb 28 '18 at 11:58











  • @VivekKumar, No, I am looking for something configure variable from backend and it will work in the frontend. Like frontend showing product counts category beside.

    – Bojjaiah
    Feb 28 '18 at 12:14











  • I thought you asked about custom variable at mentioned path at admin

    – Vivek Kumar
    Feb 28 '18 at 14:38
















1















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.










share|improve this question














bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Did my answer solve your query?

    – Vivek Kumar
    Feb 28 '18 at 11:58











  • @VivekKumar, No, I am looking for something configure variable from backend and it will work in the frontend. Like frontend showing product counts category beside.

    – Bojjaiah
    Feb 28 '18 at 12:14











  • I thought you asked about custom variable at mentioned path at admin

    – Vivek Kumar
    Feb 28 '18 at 14:38














1












1








1








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.










share|improve this question














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.







admin-panel magento-2.1.3 custom-variable






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 28 '18 at 5:33









BojjaiahBojjaiah

2,4802571




2,4802571





bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Did my answer solve your query?

    – Vivek Kumar
    Feb 28 '18 at 11:58











  • @VivekKumar, No, I am looking for something configure variable from backend and it will work in the frontend. Like frontend showing product counts category beside.

    – Bojjaiah
    Feb 28 '18 at 12:14











  • I thought you asked about custom variable at mentioned path at admin

    – Vivek Kumar
    Feb 28 '18 at 14:38



















  • Did my answer solve your query?

    – Vivek Kumar
    Feb 28 '18 at 11:58











  • @VivekKumar, No, I am looking for something configure variable from backend and it will work in the frontend. Like frontend showing product counts category beside.

    – Bojjaiah
    Feb 28 '18 at 12:14











  • I thought you asked about custom variable at mentioned path at admin

    – Vivek Kumar
    Feb 28 '18 at 14:38

















Did my answer solve your query?

– Vivek Kumar
Feb 28 '18 at 11:58





Did my answer solve your query?

– Vivek Kumar
Feb 28 '18 at 11:58













@VivekKumar, No, I am looking for something configure variable from backend and it will work in the frontend. Like frontend showing product counts category beside.

– Bojjaiah
Feb 28 '18 at 12:14





@VivekKumar, No, I am looking for something configure variable from backend and it will work in the frontend. Like frontend showing product counts category beside.

– Bojjaiah
Feb 28 '18 at 12:14













I thought you asked about custom variable at mentioned path at admin

– Vivek Kumar
Feb 28 '18 at 14:38





I thought you asked about custom variable at mentioned path at admin

– Vivek Kumar
Feb 28 '18 at 14:38










1 Answer
1






active

oldest

votes


















0














From what I have used custom variable, it is only for passing admin manageable value to your code, you can access it as follows;



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$model = $objectManager->get('MagentoVariableModelVariable')->loadByCode('custom-variable-code');
$plain_value = $model->getPlainValue();


Reminder that you should not use objectmanager directly in your code






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f215354%2fhow-to-use-custom-variables-in-magento-2%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    From what I have used custom variable, it is only for passing admin manageable value to your code, you can access it as follows;



    $objectManager = MagentoFrameworkAppObjectManager::getInstance();
    $model = $objectManager->get('MagentoVariableModelVariable')->loadByCode('custom-variable-code');
    $plain_value = $model->getPlainValue();


    Reminder that you should not use objectmanager directly in your code






    share|improve this answer




























      0














      From what I have used custom variable, it is only for passing admin manageable value to your code, you can access it as follows;



      $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      $model = $objectManager->get('MagentoVariableModelVariable')->loadByCode('custom-variable-code');
      $plain_value = $model->getPlainValue();


      Reminder that you should not use objectmanager directly in your code






      share|improve this answer


























        0












        0








        0







        From what I have used custom variable, it is only for passing admin manageable value to your code, you can access it as follows;



        $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        $model = $objectManager->get('MagentoVariableModelVariable')->loadByCode('custom-variable-code');
        $plain_value = $model->getPlainValue();


        Reminder that you should not use objectmanager directly in your code






        share|improve this answer













        From what I have used custom variable, it is only for passing admin manageable value to your code, you can access it as follows;



        $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        $model = $objectManager->get('MagentoVariableModelVariable')->loadByCode('custom-variable-code');
        $plain_value = $model->getPlainValue();


        Reminder that you should not use objectmanager directly in your code







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 28 '18 at 7:03









        Vivek KumarVivek Kumar

        2,4582629




        2,4582629






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f215354%2fhow-to-use-custom-variables-in-magento-2%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

            How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

            變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...