Richard Dewan

theme layout design conflict with 3rd party module

hi,
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

Hi,

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

Hi
In my controller execute function i have below code but it always returnΒ  Exception #0 (InvalidArgumentException): Invalid return type
public function execute()
    {
        $this->checkIfAlreadySubscribed();
    }
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') {
                $this->createAudience();
            } elseif ($result->{'status'} === 'cleaned') {
                return $resultResponse->setData(
                    [
                        "success"=>false,
                        "message"=>'Sorry! The contact bounced and was removed from the list.'
                    ]
                );
            }

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

Add Google font on Custom Module

Hi,

How do i add a font to my custom module. I would like to add https://fonts.googleapis.com/css?family=Roboto+Condensed:300,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

Hi,
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="http://www.w3.org/2001/XMLSchema-instance" layout="empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="root">
            <container htmlTag="div" htmlId="signup-offer-container">
                <block name="signup.offer.home"
                       template="RDewan_SignupOffer::home.phtml">
                </block>
            </container>
        </referenceContainer>
    </body>
</page>
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