Post by nowhinjing » Thu Dec 06, 2007 1:32 am

Hi,

I have just added a contribution to add Modules to identify Featured and Special Offer Products and to list these and list Latest Products, enabling you to get rid of it from home.php/home.tpl.

The archive contains all you need, files, full instructions, a hint for usage, etc.

Code: Select all

http://www.opencart.com/contribution/category/category_id/1
Hope you all like it.

@Daniel, please feel free to use whatever may be useful (?)

NWJ

Newbie

Posts

Joined
Thu Nov 15, 2007 10:35 pm

Post by JohnnyO » Thu Dec 06, 2007 5:51 am

Thanks for the great plugin!

I am however having some issues getting this to work. I have uploaded all of the files you provided to my test site. Added the tables to the database. Installed the modules in the admin. And verified everything twice.

The home page of my site is not displaying the new product listings and the options/flags to enable a product as a featured item are non-existent.  I'm confused now, hoping you can help me out.

Thanks,

If you make it idiot proof, they will just build a better idiot.


User avatar
New member

Posts

Joined
Wed Nov 14, 2007 7:31 am
Location - Denver, CO - USA

Post by nowhinjing » Thu Dec 06, 2007 4:17 pm

This is because I left out the product related files from Admin  :-[

I have updated the package and instructions to suit.

All you need to do is copy the three product files from the admin section and it should all leap into life .... ::)

Sorry for the problem - old timer's moment !

NWJ

Newbie

Posts

Joined
Thu Nov 15, 2007 10:35 pm

Post by JohnnyO » Fri Dec 07, 2007 1:22 am

nowhinjing wrote:
Sorry for the problem - old timer's moment !

NWJ
No need to be sorry .. Thank you for your help.

The product options / flags now exist in the admin  :)  But it is still not rendering on my catalog pages where the "Latest Products" used to be???

I will keep looking into this ..

Thanks, -JO

If you make it idiot proof, they will just build a better idiot.


User avatar
New member

Posts

Joined
Wed Nov 14, 2007 7:31 am
Location - Denver, CO - USA

Post by nowhinjing » Fri Dec 07, 2007 1:57 am

Hum ...... strange ! ::)

Try clicking on the home tab, if it all then leaps into action the fault is in layout.tpl  ;D

try modifying your code to read something like :

Code: Select all

	     <?php if (($_REQUEST['controller'] == 'home') OR (!$_REQUEST['controller']))  { ?>
	     <?php if (isset($latest)) { ?>
	       <?php echo $latest; ?>
	     <?php } ?>
	     <?php if (isset($featured)) { ?>
	       <?php echo $featured; ?>
	     <?php } ?>
	     <?php if (isset($specials)) { ?>
	       <?php echo $specials; ?>
	     <?php } ?>
	     <?php } ?>
hopefully it will then work reliably (?)  ???

Newbie

Posts

Joined
Thu Nov 15, 2007 10:35 pm

Post by kelvin_wang » Thu Feb 14, 2008 5:07 pm

Thank you very much for the contribution!

it does help.  ;) Thanks

however, i got a small problem on the display of featured products and special offers after i installed to opencart 0.7.7.  if there's no spcial offer product, the following message will display in the  special off section "Notice: Undefined variable: products in catalog\template\default\module\specials.tpl on line 3".  i tried modifying specials.tpl and get the error message away.


specials.tpl

Code: Select all


<p class="heading"><?php echo $heading_title; ?></p>

<?php if (isset($products)) { ?>

<?php if ($products) { ?>
  <table style="width:100%;">
  <?php foreach ($products as $product) { ?>
    <tr class="products">
	<td style="width:108px;"><a href="<?php echo $product['href']; ?>">
         <img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>"
           alt="<?php echo $product['name']; ?>" /></a></td>
       <td><b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b> - <?php echo $product['desc']; ?></td>
	  <td><?php echo $product['price']; ?></td>
    </tr>
  <?php } ?>
  </table>
<?php } else { ?>
  <p><?php echo $text_notfound; ?></p>
<?php } ?>

<?php } else { ?>
  <p><?php echo $text_notfound; ?></p>
<?php } ?>

Last edited by kelvin_wang on Thu Feb 14, 2008 5:09 pm, edited 1 time in total.

Newbie

Posts

Joined
Thu Feb 14, 2008 4:52 pm

Post by bruce » Fri Feb 15, 2008 7:48 am

I recently installed this contribution as follows and it works perfectly.

After following the installation instructions, I put the following (some surrounding code shown for positioning) into catalog\controller\home.php

Code: Select all

        $template->set('content', $view->fetch('content/home.tpl'));

        $template->set($module->fetch());

        $template->set('show_latest', true);
        $template->set('show_specials', true);
        $template->set('show_featured', true);

        $response->set($template->fetch('layout.tpl'));
and modified catalog\template\default\layout.tpl as follows

Code: Select all

  <div id="content">
    <?php 
        if (isset($content)) echo $content; 
        if (isset($latest) & isset($show_latest)) echo $latest; 
        if (isset($featured) & isset($show_featured)) echo $featured; 
        if (isset($specials) & isset($show_specials)) echo $specials; 
    ?>  
  </div>
So for example, $latest is set if the module is enabled and you only have to set $show_latest in the template of the controller(s) where you want to display the latest products.

Please note
  • the code snippet as shown, would display them all on in the home page.
  • the isset check on $content that was around the content div is moved inside the content div
  • putting everything including $content inside the content div maintains a continuous line on the left side for the default template

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by jzm » Mon Feb 18, 2008 11:45 am

How do we layout the .xls document

jzm
New member

Posts

Joined
Mon Jan 14, 2008 11:38 am

Post by JNeuhoff » Wed Feb 20, 2008 2:25 am

I just installed it, too, and it works fine. Well done!

Question: At the moment, when I edit a product via the

/admin/index.php?controller=product&action=update&product_id=nnn

and I select the data tab, it won't show the new special_offer and featured fields.

It would be nice if these could be set there, too. This would require an update of the files

admin/controller/product.php
admin/template/default/content/product.tpl

and shouldn't be too difficult!

I am planning to add these two new product fields as optional features to my Bulk Export/Import module when I have time.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by bruce » Wed Feb 20, 2008 9:48 am

It should do, the version (latest) I downloaded to try, shows these fields for editing.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by nowhinjing » Wed Feb 20, 2008 5:32 pm

Unfortunately I am not allowed to delete the out of date version of this contribution, so if you want it make sure you download the amended version !

NWJ

Newbie

Posts

Joined
Thu Nov 15, 2007 10:35 pm

Post by JNeuhoff » Thu Feb 21, 2008 12:32 am

It should do, the version (latest) I downloaded to try, shows these fields for editing.
You are right, I have now installed the latest version which lets me edit the additional product fields, too.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dedymahdan » Tue Mar 11, 2008 12:23 am

kelvin_wang wrote: Thank you very much for the contribution!

it does help.  ;) Thanks

however, i got a small problem on the display of featured products and special offers after i installed to opencart 0.7.7.  if there's no spcial offer product, the following message will display in the  special off section "Notice: Undefined variable: products in catalog\template\default\module\specials.tpl on line 3".  i tried modifying specials.tpl and get the error message away.


specials.tpl
--cut --
Thanks..it works!  :D
Last edited by dedymahdan on Tue Mar 11, 2008 12:43 am, edited 1 time in total.

Newbie

Posts

Joined
Mon Mar 10, 2008 11:20 pm

Post by johny2k » Fri Mar 28, 2008 12:10 pm

nowhinjing wrote: Hum ...... strange ! ::)

Try clicking on the home tab, if it all then leaps into action the fault is in layout.tpl  ;D

try modifying your code to read something like :

Code: Select all

	     <?php if (($_REQUEST['controller'] == 'home') OR (!$_REQUEST['controller']))  { ?>
	     <?php if (isset($latest)) { ?>
	       <?php echo $latest; ?>
	     <?php } ?>
	     <?php if (isset($featured)) { ?>
	       <?php echo $featured; ?>
	     <?php } ?>
	     <?php if (isset($specials)) { ?>
	       <?php echo $specials; ?>
	     <?php } ?>
	     <?php } ?>
hopefully it will then work reliably (?)  ???
hi, i`m a newb here, may i know where should i put in the code as you provide? I mean in layout.tpl which line? Thx u.  ;)

Update: ok, now i already know where need to put in the code, but now i got a problem, pls see the picture i post, hope someone can help me, thx u.  ;)

http://www.toplamp.com.my/image/before.png[/img]
http://www.toplamp.com.my/image/after.png[/img]
Last edited by johny2k on Fri Mar 28, 2008 12:50 pm, edited 1 time in total.

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by nowhinjing » Fri Mar 28, 2008 11:13 pm

Check your HTML code

"class=... " should not be appearing, guess there is a < missing.

NWJ

Newbie

Posts

Joined
Thu Nov 15, 2007 10:35 pm

Post by braken2000 » Tue Apr 22, 2008 9:12 pm

I have used the code and it works on IE7, but on FireFox it wont render the page properly.

Is there a tool to fix this?

Also, as a completely dumb question:

How do I change the:

Powered By OpenCart
Copyright © 2006

at the bottom of the page?

I want to add something to it.

Thanks once again

Braken2000

Newbie

Posts

Joined
Tue Apr 22, 2008 9:10 pm

Post by bruce » Tue Apr 22, 2008 10:12 pm

Actually, a few other pages render differently on these two browsers. There is no tool specific to OpenCart to solve it, you will have to play with the HTML and styles to find a consistent result.

The answer to your second question has been answered many times on the forums. You only need to search.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by fisher318 » Wed Apr 23, 2008 4:28 am

Hey, can anyone offer me a live version of this feature so I can take a look?

Denver Colorado Web Site Design and Internet Marketing | Tactical Flashlights


New member

Posts

Joined
Tue Feb 26, 2008 5:16 am

Post by servispaketi » Wed May 07, 2008 12:45 am

bruce wrote: I recently installed this contribution as follows and it works perfectly.

After following the installation instructions, I put the following (some surrounding code shown for positioning) into catalog\controller\home.php

Code: Select all

        $template->set('content', $view->fetch('content/home.tpl'));

        $template->set($module->fetch());

        $template->set('show_latest', true);
        $template->set('show_specials', true);
        $template->set('show_featured', true);

        $response->set($template->fetch('layout.tpl'));
and modified catalog\template\default\layout.tpl as follows

Code: Select all

  <div id="content">
    <?php 
        if (isset($content)) echo $content; 
        if (isset($latest) & isset($show_latest)) echo $latest; 
        if (isset($featured) & isset($show_featured)) echo $featured; 
        if (isset($specials) & isset($show_specials)) echo $specials; 
    ?>  
  </div>
So for example, $latest is set if the module is enabled and you only have to set $show_latest in the template of the controller(s) where you want to display the latest products.

Please note
  • the code snippet as shown, would display them all on in the home page.
  • the isset check on $content that was around the content div is moved inside the content div
  • putting everything including $content inside the content div maintains a continuous line on the left side for the default template



I have done all what you said.  But it didnot work. I want to display special products on my homepage. I have read all here but I got some confused, So I am requesting you to straighten the matter up , please.

Newbie

Posts

Joined
Fri May 02, 2008 4:52 am

Post by anmp3r » Wed Jul 23, 2008 12:51 am

i have followed the instructions but am having trouble....

after i include:
     
     
     
     
after the:
 

 

part my site goes and does what the other person's did and replicate the welcome msg and stuff the template up....
though the products appear lower on the page.... (not the best)

here is a copy of my /catalog/template/default/layout.tpl

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html dir="<?php echo $direction; ?>" lang="<?php echo $code; ?>">

<head> 

<title><?php echo $title; ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>">

<base href="<?php echo $base; ?>">

<link rel="stylesheet" type="text/css" href="catalog/template/default/css/default.css">

</head>

<body>

<h1><?php echo $title; ?></h1>

<div id="container">

  <?php if (isset($header)) { ?>

  <div id="header"><?php echo $header; ?></div>

  <?php } ?>

  <div id="bar">

    <?php if (isset($language)) { ?>

    <?php echo $language; ?>

    <?php } ?>

    <?php if (isset($currency)) { ?>

    <?php echo $currency; ?>

    <?php } ?>

    <?php if (isset($search)) { ?>

    <?php echo $search; ?>

    <?php } ?>

  </div>

  <div id="column">

    <?php if (isset($cart)) { ?>

    <?php echo $cart; ?>

    <?php } ?>

    <?php if (isset($category)) { ?>

    <?php echo $category; ?>

    <?php } ?>

    <?php if (isset($review)) { ?>

    <?php echo $review; ?>

    <?php } ?>

    <?php if (isset($information)) { ?>

    <?php echo $information; ?>

    <?php } ?>

  </div>

  <?php if (isset($content)) { ?>

  <div id="content"><?php echo $content; ?></div>
     <?php  if (isset($content)) echo $content; ?>
     <?php  if (isset($latest) & isset($show_latest)) echo $latest; ?>
     <?php  if (isset($featured) & isset($show_featured)) echo $featured; ?>
     <?php  if (isset($specials) & isset($show_specials)) echo $specials; ?>

  <?php } ?>

  <?php if (isset($footer)) { ?>

  <div id="footer"><?php echo $footer; ?></div>

  <?php } ?>

</div>

<?php if (isset($time)) { ?>

<div id="time"><?php echo $time; ?></div>

<?php } ?>

</body>

</html>

Attachments

???
Screenshot.png

visit my mobile phone store! ---> http://m-shop.guardhost.net


New member

Posts

Joined
Sun Apr 20, 2008 10:48 pm

Who is online

Users browsing this forum: No registered users and 31 guests