Richard Dewan

theme layout design conflict with 3rd party module

After installing the module my theme layout went off mostly the css not applied properly .
What would be the solution for this kind of issue. We really need this module no option to disable it.

Thank you

Best place to call external API from


I have a magento popup model where i have create a form when user submits the form it should do request response on the external api.
currently i am calling the controller from popup model form submit using ajax and doing all API calling from controller. Is there any better way to do it

Invalid return type

In my controller execute function i have below code but it always returnΒ  Exception #0 (InvalidArgumentException): Invalid return type
public function execute()
public function checkIfAlreadySubscribed()
        $resultResponse = $this->resultFactory->create(ResultFactory::TYPE_JSON);
        $subscriber_hash = md5(strtolower($this->request->getParam('email')));
        try {
            $result = $this->mailchimp->lists->getListMember($this->list_id, $subscriber_hash);

            //if response is unsubscribed then create new audience
            if ($result->{'status'} === 'unsubscribed') {
            } elseif ($result->{'status'} === 'cleaned') {
                return $resultResponse->setData(
                        "message"=>'Sorry! The contact bounced and was removed from the list.'

            return $resultResponse->setData(
                    "message"=>'Sorry! You have already subscribed.'
        } catch (ApiException $e) {
            return $resultResponse->setJsonData($e->getMessage());

Add Google font on Custom Module


How do i add a font to my custom module. I would like to add,400,500,700|Poppins:300,400,500,700|Roboto:300,400,500,700|Arvo:300,400,500,700|Lobster:300,400,500,700|Varela+Round:300,400,500,700

Thank you.

ViewModel for CMS

We have a custom theme design by outsource team. I am trying to refactor it as it has lot of Object Manager usage . I try to create a ViewModel and setup as argument in layout and access it in .phtml file.
The problem is i create the ViewModel inside the design/frontend/vendorname/themename/Magento_Cms/ViewModel/Β  but i am getting exception xception #0 (ReflectionException): Class Tonggarden/tg/Magento_Cms/ViewModel/Home does not existΒ 
And if i create a ViewModel in Magento\Cms\ViewModel\Home it works perfectly .
Is there any way to override this behavior?

_module.less is not loading on custom module

I have added a _module.less file at app/code/RDewan/SignupOffer/view/frontend/web/css/source/_module.less but it does not load at all .I have added a css file at app/code/RDewan/SignupOffer/view/frontend/web/css/signupoffer.css it can load correctly.

ResultFactory::TYPE_LAYOUT load a empty page

Hi there,

I am try to create a blank empty page without the default header and footer . I just need a blank empty full pageΒ 

I am returning in controller:
return $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
and in layout:
<page xmlns:xsi="" layout="empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="root">
            <container htmlTag="div" htmlId="signup-offer-container">
                <block name="signup.offer.home"
but it's not loading my template file
Like Comment

How to add a bootstrap css and js to custom module

Hi guys,

I trying to create a custom much which has some form . I want to use a bootstrap 4 to design it but haveΒ  no idea to add the required files.

Any help is helpful.

Thank you