AdSense with OpenCart - templates

After hours upon hours of searching through stackoverflow and AdSense forums, i am not able to find anything to help me implement my google adsense code in my opencart template.
Originally i put the code in the welcome module hoping it would show up on the top of each page but this did not work at all.
I found an extension called KINZA which was free but once installed, this simply outputs the javacript code on my website and not the actual ad.
My question is this: I would like to have one of my ads up top across the page and maybe one on the sidebar as a thin skyscrapper size. How would one do this ? Where in my opencart template would i implement the code ?? I do not want to spend money on an extension to get this to work. I would rather just dive in the code and paste it where it needs to be.\Any help is GREATLY appreciated.
Thank you !

there are 6 files that are included in every page of frontend
catalog/view/theme/your_theme/template/common/header.tpl , footer.tpl , column_left.tpl , column_right.tpl , content_top.tpl , content_bottom.tpl
you can put your code in any one of these and it should work fine
you can make a module for adsense so that you can control its layout and position from admin .... here is a guide of to make/duplicate a module at opencart forums http://forum.opencart.com/viewtopic.php?t=6696

Opencart 3 onwards does not support google adsence you can not show ads just go for wordpress or any other

Related

Opencart store page and links

I have locally installed opencart into the ".../shop" part of my website. Now I want to fit my site header and footer to appear around the site.
Please can people help advise the best way of doing this. I have a header.php and footer.php included on ever page of my site but am not clear how to implement this on the shop page.
I am thinking that there is going to be conflicts especially linking to other pages via the shop section. Will the hrefs in my header in the shope section need to direct differently?
You'd want to goto your catalog/view/theme/default/template/common/header.tpl and footer.tpl and make the changes.

opencart checkout not expand,just show the 6 steps

Hi i have problem with opencart 1.5.6.4,my checkout dont like to expand and to show register or login when you proces to buy the product just,show the 6 step whit out to expand,The buttons at the one-page checkout are not expanding. If u visit this link: http://imeibox.com/index.php?route=checkout/checkout u can see there is not button are not doing anything, so we cannot fill in any information or select any options. Is there a simple solution for this problem or is there bad coding behind those buttons?
kind regards
GEORGI
Well this looks like it could be anything.
First thing that comes to mind,have you added a Jquery library to the header.tpl file recetly? if you have,there's your problem.
Try some checkups to see where the issue is coming from
1:turn off the theme you are using and check the cart again
2:Turn off any new modules you have installed
3:check your error log,and see what you have there,dont forget to check the vqmod/logs
usually that area of opencart works without a problem.so its either some code you did,the theme you are using or a bad module
DO not forget to do a backup before you do anything

How to add link to orders page with filter inside link?

I want to add direct link with filter_date_added=(DATE(NOW()) in Dashboard in Opencart's Administration to orders page.
I'm not a programmer and if somebody can help me with this I'll be very grateful.
If you a not a programmer may I suggest you searching the modules on OpenCart modules forum. Alternatively you can edit the order_sales.tpl in view/templates and simply add a column inside that and pull the variable from the PHP module.
The archiecture is found in
admin\controller\sale\order.php
admin\model\sale\order.php
admin\view\template\sale\order_list.tpl
admin\language\english\sale\order.php
http://www.opencart.com/index.php?route=extension/extension/info&extension_id=14230
There is a module out there that allow you to do this for country, viewing sales by country. Maybe you can download and play around with it and try to experiment. It will only help you to become a better programmer.

Track down where content comes from

Being new to Joomla I do not know all the tricks for troubleshooting etc. Currently I have a page that has a section of content on it. The content is created by DT Register but I've been through the CP several times and cannot find the section?
I hope someone is up and can share with me how to track down where pieces of content come from so I can find where this is being generated and change as needed.
The page in question is a DT Register form. I can locate and modify every section of the page EXCEPT one.
The section is titled USER INFORMATION and captures userid & password to create an account. Looking at the element in developer tools it would appear it is part of the dt register generated code but as I mentioned I can't find it.
The sandbox I am playing in is here: http://take7.lamplighterguild.com/index.php/register?eventId=15&controller=event&task=individualRegister
The section is towards the top and is hard to read on the page...which is why I want to find it.
Thank you for any help or direction.
So unfortunately my question was poorly worded. I have no trouble at all getting the css changed. It is the origin of the content that I am really trying to track down. Where does it come from etc. Is there a way to detect if it came from an article, or a component, etc. I thought there might be clues as how to figure that out.
For troubleshooting issues like this, tools like Firebug or Web Inspector for Chrome and Safari are your go to tools. If you aren't already familiar with them you'll find lots of help online.
There is default body text styling of colour #D9A362 getting into your page from one of the stylesheets. I can't find the source quickly myself, though it's easy enough to write an override.
One place you could do this is open http://take7.lamplighterguild.com/templates/theme1001/css/template.css with a text editor. Below the existing body rule # line 7, add something like
body.cssstyle-style1{
color:black;
}
This will fix the H2 text at the top of the page which you mention, plus the 'user information' line immeadiately above the form.
Hope this helps!
EDIT
You have something which is writing the following style to your page head and this is the culprit:
body {font-family:Arial, Helvetica, sans-serif; font-size:13px; line-height:21px; color:#D9A362; }
It's even on your home page so it's not necesaarily related to DT Register. To me it looks like it's coming from your menu extension.

Opencart module development - Inject javascript/html code in some pages

I'm a beginner on Opencart and just started developing a module for Opencart which it must inject some lines of javascript and html code in these pages:
- Cart Page
- Product Page
- Confirmation Order Page
- Register form page
The official documentation doesn't have informations about how can i do that, I've tried to find a good documentation about OpenCart but I didn't find anything.
I need help. How can I do that?
Diggin necro topics;) :
The easiest way i think:
upload/catalog/view/theme/[themename]/template/product/product.tpl - here you can add your custom html for product page
[your theme name, you shouldnt overwrite default theme because it can cause damage after update]
It depends on where you're trying to insert the HTML/JavaScript.
Doing things the proper way in OpenCart, you're limited to the column-left, column-right, content-top, and content-bottom positions.
The files you'll need to create are:
admin/controller/module/mymodule.php
admin/language/english/module/mymodule.php
admin/view/template/module/mymodule.tpl
catalog/controller/module/mymodule.php
catalog/language/module/mymodule.php
catalog/view/theme/default/module/mymodule.php
To learn how to do this the first time, it's easiest to replicate an existing stock OpenCart module (preferably a simple one, such as information). Once you've replicated it you'll need to go through each of those files and replace any references to "information" with "mymodule".
After that, if you've done it properly, you should be able to navigate to Admin > Extensions > Modules and see your module in there. Then install it, use the "Add module" button to position the module on all the relevant layouts, hit save and hey presto you have a working module on the front-end.
To modify the front-end output, just edit catalog/view/theme/default/module/mymodule.php
If you want to insert your HTML somewhere other than the 4 available positions OpenCart gives you, position your module in the content-bottom position and use JavaScript/jQuery to inject some HTML where you want.
If this is for your own personal website then as Pawel S suggested it would be easiest to simply modify the relevant view files (ie. catalog/view/theme/[themename]/template/product/product.tpl), however if you're making a module which you plan to distribute then this should be a last resort.
Hope that helps!
I realize this is probably long dead by now, but if you're creating a module that needs to modify existing controllers, languages, models or views the correct tool to use is vQMod.
vQMod allows you to modify existing code on the fly using XML.
https://code.google.com/p/vqmod/