Post by Selective555 » Tue Dec 23, 2014 3:13 pm

So I decided to try a simple Mod which is just taking existing script, and copying it with a name change to create a second text field in the Admin panel, for the purpose of adding scrolling text to the top of the front shop page.

Here are my notes, what I did so far
I finished the mod, so I removed the notes as they had some errors
Refreshed my shop and all is fine in the admin panel, and the extra option is there and saves the text in the text field. Refreshed the online shop, and looks fine, but when I go to the contact page, the text isn't there and there's an error there instead that reads "Undefined Variable: news in /catalog/view/theme/default/template/information/contact.tpl on line 25".

Do I need to do something in the database?
Last edited by Selective555 on Mon Jan 05, 2015 8:12 pm, edited 4 times in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by yodapt » Thu Dec 25, 2014 12:26 am

Th error says you're missing a file, that calls contact.tpl (should be catalog/controller/information/...), and fetch the new field into the tpl.

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by Selective555 » Thu Dec 25, 2014 1:48 am

yodapt wrote:Th error says you're missing a file, that calls contact.tpl (should be catalog/controller/information/...), and fetch the new field into the tpl.
Thanks, I forgot about doing that page when I decided to test it on that page.

Here are my notes for what I did on that page.
I finished the mod, so I removed the notes as they had some errors
Now I'm getting a white page with this error message.

Code: Select all

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /catalog/controller/information/contact.php on line 124
I'm going to start looking at my notes, and see if I missed anything.
Last edited by Selective555 on Mon Jan 05, 2015 8:09 pm, edited 2 times in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by Selective555 » Thu Dec 25, 2014 2:24 am

I just checked all of my notes, and went through all of those pages again. I did everything exactly like the "Open" script, and the "Open" script works, so why this isn't, I'm not sure!

Is there something not done in the script on the pages that would cause this?
Last edited by Selective555 on Mon Jan 05, 2015 8:09 pm, edited 1 time in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by Selective555 » Thu Dec 25, 2014 3:23 am

This is odd, I guess.....

I just removed this line of code

Code: Select all

					'news'        => nl2br($location_info['news']),
and now it works!

I guess I didn't need that last piece of code.

I'll now look into adding the scroll script.

Any suggestions on where I should put it so it becomes embedded into the "news" word with the text?
Last edited by Selective555 on Mon Jan 05, 2015 8:08 pm, edited 1 time in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by Selective555 » Thu Dec 25, 2014 3:58 am

I want to add this scroll script so that it makes the text scroll, but how do I insert it into an already existing php echo script for "news"?

here is my scroll script
I finished the mod, so I removed this script as it had some errors
Last edited by Selective555 on Mon Jan 05, 2015 8:08 pm, edited 2 times in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by Selective555 » Thu Dec 25, 2014 11:42 am

I figured it out, how to add the scroll script to the text.

I'm now seeing about placing it on the front page.
Last edited by Selective555 on Mon Jan 05, 2015 8:08 pm, edited 1 time in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by Selective555 » Thu Dec 25, 2014 12:15 pm

I got it on the top of the front page, but now it pushed the top links (that were on the top right) a space row a few spaces below it!

Here is the code I used, and how it is currently placed
I finished the mod, so I removed this script as they had some errors
There isn't anything in the scroll script to make it jump down a line, so I guess I could try using an html table to position everything.
Last edited by Selective555 on Mon Jan 05, 2015 8:16 pm, edited 2 times in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by Selective555 » Thu Dec 25, 2014 1:16 pm

I just finished this mod, so I'll be posting it soon.

Here are screen shots of it

What it looks like on the front shop page
News Scroll Mod For OpenCart 2.0 SCREENSHOT 1.png

News Scroll Mod For OpenCart 2.0 SCREENSHOT 1.png (18.1 KiB) Viewed 924 times

What it looks like in the Admin panel
News Scroll Mod For OpenCart 2.0 SCREENSHOT 2.png

News Scroll Mod For OpenCart 2.0 SCREENSHOT 2.png (32.61 KiB) Viewed 924 times

Last edited by Selective555 on Mon Jan 05, 2015 8:07 pm, edited 1 time in total.

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm

Post by mattalt » Mon Jan 05, 2015 11:57 am

Hi! Have you finished the scroll module? Is it available? Regards

New member

Posts

Joined
Thu May 31, 2012 7:12 am

Post by Selective555 » Mon Jan 05, 2015 8:05 pm

mattalt wrote:Hi! Have you finished the scroll module? Is it available? Regards
Yeah, it's finished!

Here it is
Latest News/Messages Scroll Across Top Of Shop (MOD)

I created a MOD, take a look at it ---> Latest News/Messages Scroll Across Top Of Shop (MOD)


Active Member

Posts

Joined
Wed Nov 26, 2014 1:29 pm
Who is online

Users browsing this forum: No registered users and 24 guests