Post by seths » Mon Nov 23, 2009 3:20 am

It's a very simple blog module, but it should do the trick for most folks:

http://tinyurl.com/opencart-blog

Enjoy!

New member

Posts

Joined
Sat Oct 03, 2009 10:38 am

Post by leprimo » Mon Nov 23, 2009 4:04 am

thank you, good for news.!
Easy to install, works well!

Active Member

Posts

Joined
Wed Nov 04, 2009 8:31 pm

Post by DannyMacD » Thu Nov 26, 2009 11:15 pm

do you have any demo stores with this on to see please?

many thanks :)

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by richard211986 » Sun Nov 29, 2009 9:22 pm

would this be suitable for older versions of oc 1.3.2?

Active Member

Posts

Joined
Sun Sep 20, 2009 5:34 am

Post by seths » Mon Nov 30, 2009 10:43 am

I can't think of any reason why it wouldn't work with an older release.

New member

Posts

Joined
Sat Oct 03, 2009 10:38 am

Post by vimal » Sun Dec 06, 2009 9:11 pm

Followed everything but i get an error saying

Notice: Undefined variable: blog in C:\Server\xampp\htdocs\oc134\catalog\view\theme\dark_red\template\common\home.tpl on line 8

Any idea what it is?

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by seths » Mon Dec 07, 2009 4:01 am

Yes, it sounds like the home.php controller doesn't have the $this->children[] = 'module/blog' in the right place (or perhaps it's missing altogether).

New member

Posts

Joined
Sat Oct 03, 2009 10:38 am

Post by vimal » Mon Dec 07, 2009 10:40 pm

Hi My home.php file (\catalog\controller\common\home.php) is as below.

Code: Select all

<?php  
class ControllerCommonHome extends Controller {
	public function index() {
		$this->children[] = "module/blog";
		$this->language->load('common/home');
		
		$this->document->title = $this->config->get('config_title');
		$this->document->description = $this->config->get('config_meta_description');

		$this->document->breadcrumbs = array();

      	$this->document->breadcrumbs[] = array(
        	'href'      => $this->url->http('common/home'),
        	'text'      => $this->language->get('text_home'),
        	'separator' => FALSE
      	);
		
		$this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_store'));
		$this->data['welcome'] = html_entity_decode($this->config->get('config_welcome_' . $this->language->getId()));
		
		$this->data['text_latest'] = $this->language->get('text_latest');
		$this->load->model('catalog/product');
		$this->load->model('catalog/review');
		$this->load->model('tool/seo_url');
		$this->load->helper('image');
		
		$this->data['products'] = array();

		foreach ($this->model_catalog_product->getLatestProducts(8) as $result) {			
			if ($result['image']) {
				$image = $result['image'];
			} else {
				$image = 'no_image.jpg';
			}
			
			$rating = $this->model_catalog_review->getAverageRating($result['product_id']);	
			
			$special = FALSE;
			
			$discount = $this->model_catalog_product->getProductDiscount($result['product_id']);
			
			if ($discount) {
				$price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
			} else {
				$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
			 
				$special = $this->model_catalog_product->getProductSpecial($result['product_id']);
			
				if ($special) {
					$special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
				}						
			}
				
          	$this->data['products'][] = array(
            	'name'    => $result['name'],
				'model'   => $result['model'],
            	'rating'  => $rating,
				'stars'   => sprintf($this->language->get('text_stars'), $rating),
				'thumb'   => image_resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')),
            	'price'   => $price,
				'special' => $special,
				'href'    => $this->model_tool_seo_url->rewrite($this->url->http('product/product&product_id=' . $result['product_id']))
          	);
		}

		if (!$this->config->get('config_customer_price')) {
			$this->data['display_price'] = TRUE;
		} elseif ($this->customer->isLogged()) {
			$this->data['display_price'] = TRUE;
		} else {
			$this->data['display_price'] = FALSE;
		}
				
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/common/home.tpl';
		} else {
			$this->template = 'default/template/common/home.tpl';
		}
		
		$this->children = array(
			'common/header',
			'common/footer',
			'common/column_left',
			'common/column_right'
		);
		
		$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
	}
}
?>

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by leprimo » Mon Dec 07, 2009 11:31 pm

Find

Code: Select all

		$this->children = array(
			'common/header',
			'common/footer',
			'common/column_left',
			'common/column_right'
		);
Add after

Code: Select all

$this->children[] = "module/blog";
Maybe its the better place???

Active Member

Posts

Joined
Wed Nov 04, 2009 8:31 pm

Post by seths » Tue Dec 08, 2009 2:38 am

Yes, as stated in the documentation, it must appear after

Code: Select all

    $this->children = array(
         'common/header',
         'common/footer',
         'common/column_left',
         'common/column_right'
      );
As this code overwrites any changes to $this->children. Alternatively, you could simply add 'module/blog' to that call as follows:

Code: Select all

    $this->children = array(
         'common/header',
         'common/footer',
         'common/column_left',
         'common/column_right',
         'module/blog'
      );

New member

Posts

Joined
Sat Oct 03, 2009 10:38 am

Post by vimal » Wed Dec 09, 2009 5:50 pm

Thanks all. Got it working.

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by DannyMacD » Wed Dec 09, 2009 6:57 pm

Hello,

i have just installed this on my 1.3.4 shop and i have this error code on main site:

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/disifin/public_html/shop/catalog/controller/common/home.php on line 89

could someone point out what im doing wrong please?

thank you :)

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by DannyMacD » Wed Dec 09, 2009 6:59 pm

dcrap that, just realised i didnt put a ' after blog on it.

sorted :)

good module!!!

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by dannowatts » Mon Dec 14, 2009 8:44 am

odd, when i go to access it via the admin panel, i am gettin a "permission denied"... any reason why?

rocksteady,
danno~

New member

Posts

Joined
Tue Nov 10, 2009 11:40 am

Post by dannowatts » Mon Dec 14, 2009 8:50 am

whelp, solved that issue i just posted, by actually giving my user the ability to use that extension, but now i'm getting this new error:
"Error: Could not load model extension/blog!"

hmmm... help?

rocksteady,
danno~

New member

Posts

Joined
Tue Nov 10, 2009 11:40 am

Post by dannowatts » Mon Dec 14, 2009 8:59 am

aaaaaaand i fixed the other error. i'm working in mac os x's Coda application. for some reason it didn't upload the extension directory along with the blog.php file . after i opened up my server via FTP i could see that it wasn't there. after correctly uploading the file it said was missing, all is well.

sometimes it takes just posting that you have a problem to figure it out yourself ;)

thanks again :)

rocksteady,
danno~

New member

Posts

Joined
Tue Nov 10, 2009 11:40 am

Post by JordanAustin » Thu Dec 24, 2009 6:10 am

seths,
Nice job with this extension, it's really useful. Also you had great documentation.

What do you think this would take to add an RSS feed to the blog? And does anyone else think this would be useful?

Jordan Austin


Newbie

Posts

Joined
Thu Dec 24, 2009 1:01 am

Post by seths » Thu Dec 24, 2009 6:21 am

I don't think it would take much. I just don't have a ton of time to work on it just now. But since I haven't gotten any other requests I will do my best to include it in the next release. I was hoping for some bug fixes to include, but I've yet to get any bug reports...

New member

Posts

Joined
Sat Oct 03, 2009 10:38 am

Post by JordanAustin » Thu Dec 24, 2009 7:31 am

seths wrote:I don't think it would take much. I just don't have a ton of time to work on it just now. But since I haven't gotten any other requests I will do my best to include it in the next release. I was hoping for some bug fixes to include, but I've yet to get any bug reports...
I'm testing it out right now. It's really cut and dry. So hopefully you won't get any bug reports :)

Jordan Austin


Newbie

Posts

Joined
Thu Dec 24, 2009 1:01 am

Post by CEOself » Thu Dec 31, 2009 1:28 am

Great Module, I got it working fine.

Now where to put it. I plan on writing on it alot. Therefore, I would like to give it's own page under the Information area. Is there a way to create a new page under Category> Information> Insert, and use the source code setting in the WYSIWYG to show the blog.php file?

Newbie

Posts

Joined
Tue Dec 29, 2009 3:05 pm
Who is online

Users browsing this forum: No registered users and 23 guests