Post by ameliaa » Mon Jan 26, 2015 6:59 pm

How do I set the newsletter to yes by default on registration forum using vqmod?

I have followed the suggestions found at: http://forum.opencart.com/viewtopic.php ... 6&start=20

But I do not see any changes on fronted. What am I doing wrong?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Subscribe to Newsletter By Default</id>
	<version>1.4.x and above</version>
	<vqmver required="true">2.5.0</vqmver>
	<author>vqmod.com</author>

           <file name="catalog/controller/account/register.php">
              <operation="default newsletter">
		         <search position="replace" ><![CDATA[
                                   $data['newsletter'] = '';
                    ]]></search>
			<add><![CDATA[
                                    $data['newsletter'] = 1;
                    ]]></add>
          </operation>
</file></modification>

New member

Posts

Joined
Fri Jan 29, 2010 6:31 pm

Post by dabomb59404 » Mon Jan 26, 2015 9:13 pm

Change this:
<operation="default newsletter">

To this:
<operation>

User avatar
Active Member

Posts

Joined
Thu Jun 09, 2011 5:21 am

Post by ameliaa » Tue Jan 27, 2015 9:14 am

dabomb59404 wrote:Change this:
<operation="default newsletter">

To this:
<operation>

I have tried it. It is not working. Has anyone tried something that does work? I am at a loss here ???

New member

Posts

Joined
Fri Jan 29, 2010 6:31 pm

Post by dabomb59404 » Tue Jan 27, 2015 4:00 pm

What version of OC are you using?
Any errors in your vQmod error log?
Are you sure vQmod itself is installed and working?
I tested your code with the edit to it I mentioned on version 2.0.1.1 and it is working fine for me.

User avatar
Active Member

Posts

Joined
Thu Jun 09, 2011 5:21 am

Post by ameliaa » Fri Jan 30, 2015 1:21 pm

dabomb59404 wrote:What version of OC are you using?
Any errors in your vQmod error log?
Are you sure vQmod itself is installed and working?
I tested your code with the edit to it I mentioned on version 2.0.1.1 and it is working fine for me.
My opencart has been recently upgraded from 1.5.4 to 2.0.1.1.

I am using vqmod 2.5.1. It is installed properly.

I don't know what is the issue with my vqmod. I used to have no problems with it, but after the upgrade some of the xml are working while others are not.

I have checked the error logs. There is nothing that indicates a problem with the codes.

New member

Posts

Joined
Fri Jan 29, 2010 6:31 pm

Post by dabomb59404 » Fri Jan 30, 2015 3:15 pm

Clear your vQmod cache and then go to your register page and then look at this file below in your vqmod/vqcache folder:
vq2-catalog_controller_account_register.php
See if that file is there and the edit the vqmod file does is done to it. If so it should be working and if not vQmod itself is not working or not working correctly.

User avatar
Active Member

Posts

Joined
Thu Jun 09, 2011 5:21 am

Post by pm-netti » Fri Jan 30, 2015 4:07 pm

ameliaa wrote:
dabomb59404 wrote:What version of OC are you using?
Any errors in your vQmod error log?
Are you sure vQmod itself is installed and working?
I tested your code with the edit to it I mentioned on version 2.0.1.1 and it is working fine for me.
My opencart has been recently upgraded from 1.5.4 to 2.0.1.1.

I am using vqmod 2.5.1. It is installed properly.

I don't know what is the issue with my vqmod. I used to have no problems with it, but after the upgrade some of the xml are working while others are not.

I have checked the error logs. There is nothing that indicates a problem with the codes.
Would this change (This is vqMod 2.4.x):

Code: Select all

   <id><![CDATA[Subscribe to Newsletter By Default]]></id>
   <version><![CDATA[1.4.x and above]]></version>
   <vqmver required="true"><![CDATA[2.5.0]]></vqmver>
   <author><![CDATA[vqmod.com]]></author>

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by IP_CAM » Sat Jan 31, 2015 8:49 am

would probably have been much easier to put that simple number into the register.php itself.

Code: Select all

in:
catalog/controller/account/register.php
change:
$data['newsletter'] = '';
to
$data['newsletter'] = '1';
Ernie
ipc.li

I'm rarely still active at the OC Forum. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'000+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by dabomb59404 » Sat Jan 31, 2015 9:13 am

IP_CAM wrote:would probably have been much easier to put that simple number into the register.php itself.

Code: Select all

in:
catalog/controller/account/register.php
change:
$data['newsletter'] = '';
to
$data['newsletter'] = '1';
Ernie
ipc.li
Wow thanks for pointing out the obvious. :laugh:
P.S. You should never directly edit core files as that is what vQmod is for.

User avatar
Active Member

Posts

Joined
Thu Jun 09, 2011 5:21 am

Post by IP_CAM » Sat Jan 31, 2015 12:33 pm

>>You should never directly edit core files as that is what vQmod is for.<<

agree, if one does not know about the possible consequences. But, in your Case, it would never have any impact on anything, because >$data['newsletter'] = '1';< would never be used, anywhere, related with potentially problemsome Mods or updates. Even in a 'matching' OC-File-Update, the Number '1' would just not longer exist.

In a professional environment, I do implement 'avoidable' VqMod-Stuff into Source, it's, to me, of upmost importance, to optimize Server-Performance, to it's best, in the most rational and 'natural' way. Let it work, as it has been designed to. But avoid to carry any Surplus Load, the leaner it comes, the faster it goes! Possibly that bloody swiss mentality again!?

When comparing results, beeing an old Perl-Evernewbie, I just say, Programming-Laws have not changed a bit, just the way, how it can be done. Much easier, I agree, compared with yesterday's ways, but in Reality, it added on Load as well. Too heavy Load, for a meticulous old Swiss...

No Offense !!
Ernie ::)
openshop.li

I'm rarely still active at the OC Forum. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'000+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 37 guests