X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   delete subscriptions form from before footer (https://forum.x-cart.com/showthread.php?t=78219)

pablo 04-16-2021 05:52 AM

delete subscriptions form from before footer
 
Hi guys

Can anyone tell me please why this code doesn't do anything (5.4.1)?

I am simply trying to remove the big newsletter subscription box from above the footer.

I have a customskin created, and I am using main.php, which already has a function for moveTemplatesInLists with some add and delete functions that do work.

But this one doesn't do anything.

'modules/XC/NewsletterSubscriptions/form/subscribe.twig' => [

static::TO_DELETE => [

['layout.main.footer.before', \XLite\Model\ViewList::INTERFACE_CUSTOMER],

],

],

memoto 04-19-2021 12:10 AM

Re: delete subscriptions form from before footer
 
Simply find the needed template via Template editor and delete the responsible code. Otherwise - apply the "display: none;" style to this block.

To be honest, I'm not sure you are using the best way just to get rid of the specific section.

pablo 04-19-2021 01:53 AM

Re: delete subscriptions form from before footer
 
My understanding was it was best to stop the code from running in the first place.

What I really want to do though is move the subscription from before the footer, to within the footer.

If I copy and paste the template in to the footer, it gives a fatal error.

I have even tried to have the equivalent "TO_ADD" code in my main.php file.

Ed B. 04-20-2021 11:44 PM

Re: delete subscriptions form from before footer
 
Since you want to move the place of the template, you can override the viewer class
The code responsible of outputting the template where it is, is
Code:

/**
 * SubscribeBlock
 *
 * TODO: Make placeholder for subscribed user/profile
 *
 * @ListChild (list="layout.main.footer", weight="50")
 */


in

classes/XLite/Module/XC/NewsletterSubscriptions/View/SubscribeBlock.php


Now, I am a bit confused on how to override. The code above precedes the line
Code:

class SubscribeBlock extends \XLite\View\AView


which would probably mean that you can't override by writing a class extending
classes/XLite/Module/XC/NewsletterSubscriptions/View/SubscribeBlock.php

If nothing else works, you can always edit by hand the line
Code:


 * @ListChild (list="layout.main.footer", weight="50")

(and remember doing it each time you upgrade the newsletter subscription module).

cflsystems 04-21-2021 04:38 AM

Re: delete subscriptions form from before footer
 
Since the list is defined in the class you have to use moveClassesInLists not moveTemplatesInLists


All times are GMT -8. The time now is 03:44 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.