This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

oliver63178
oliver63178

I have an .htm file under the controller for example pluginname/controllers/order/_list_toolbal.htm.

The problem is that I don't have any idea how to get the value from the model specifically the switch so I can hide the button if the switch is disabled. How can I achieve this?

this is the code inside the file


    <?php

    ?>
    <button
        data-request="onSync" class="btn btn-default oc-icon-recycle"
    >
        Quickbook Sync
    </button>
    <?php?>

Last updated

oliver63178
oliver63178

This is what I have written and I get "Class not found"


    <?php
        $qb = Order::get('quickbook_switch');
        if($qb ):
    ?>
    <button
        data-request="onSync" class="btn btn-default oc-icon-recycle"
    >
       Sync
    </button>
    <?php endif ?>
daftspunky
daftspunky

You may need to use the fully qualified class name for Order, such as

        $qb = \Author\Plugin\Models\Order::get('quickbook_switch');
oliver63178
oliver63178

daftspunk said:

You may need to use the fully qualified class name for Order, such as

       $qb = \Author\Plugin\Models\Order::get('quickbook_switch');

Hello,

This is my complete file path of the order model C:\xampp7\htdocs\octobernew\plugins\xtendly\ecommerce\models\Order.php I tried : \xtendly\ecommerce\models\Order::get('quickbook_switch'); It worked perfectly ! Thanks!

Last updated

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.