Jump to content
razaro

[MODULE] Category featured products v 0.2

Recommended Posts

Hi,

this is my first module for Prestashop.I made it to get acquainted Prestashop code so any suggestion are more then welcome :)

 

Description:

This module displays featured products for different categories in jquery carousel.

Carousel is displayed only on category page in center column or you can hook it to left/right column.

In Back Office you can choose which products will be displayed.

 

Installation:

1.Add hook variable in ../prestashop/header.php.Add this line after other hooks

'HOOK_CATEGORY_FEATURED' => Module::hookExec('categoryFeaturedHook'),

 

2.Add hook by adding this code into template file category.tpl (../themes/prestashop/)

 

{$HOOK_CATEGORY_FEATURED}

 

3. Install module and make sure categoryfeatured folder have ‘write’ permissions (also known as “CHMOD 777” )

and apply these permissions recursively (to their subfolders) then hit configure.

 

4. In BO choose category, search and add product.

 

5.In FO go to your category page

 

Module is tested on Prestashop 1.2.5 and 1.3.1 and Firefox,Chome and IE.

 

UPDATE: version 0.2 added configuration of carousels in Back Office,tested with Prestashop 1.3.1

 

But it still need some adjustments. So please comment.

 

I uploaded detailed instruction in manualv01.zip file.

19412_8IlV5eYHd6CcNFLqmscz_t

19413_F6kAMRYYk4Q4Mxr2bg5O_t

manualv01.zip

categoryfeatured.zip

Edited by razaro (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hi,

I think it's a good module.
But i don't understand to install it .... :-(

which line, I must install your script

Share this post


Link to post
Share on other sites

Sorry i forgot to put code tags in first post .
And here are some pics.

Edit : uploaded manual in first post attachment.

19421_Qxl9OY9jUFDAAto6TI9T_t

19422_d1QJ65q11xNvJ8BrcVTn_t

Share this post


Link to post
Share on other sites

Hi,

I've tried your module and it is wonderful.
Unfortunately though, the featured product seems to appear about 1secs when i enter the page and then it disappears.
The sliding carousel is still there, but the product isn't.

May I know how should I solve this? Is it because of the delay setting or something?

Thanks.

Share this post


Link to post
Share on other sites

Thanks for your comment.

What is your browser and Prestashop version?
How many featured products do you have in category ?

You can send me link (PM if you want) .

And version 0.2 is almost ready, which have options to customize carousel from Back office.

Share this post


Link to post
Share on other sites

Great idea. I just came up with it myself as well, heheh. Should definately be a feature in future releases. Who the hell uses that "Scenes" feature anyways? Hehe. Gonna download aand test it out on 1.3 final now.

Share this post


Link to post
Share on other sites

Well the scenes feature is also awesome. I really like the Imagemap generator.

Share this post


Link to post
Share on other sites

You do? :o Huh, I've never really even tried to use it properly... hmm... come to think of it there propably are alot of uses for it. How do you use it, Diemux? Special offers and such in categories?

Share this post


Link to post
Share on other sites

Installation error (version 1.3.1)

The error:
"Warning: include_once(PS_ADMIN_DIR/../classes/AdminTab.php) [function.include-once]: failed to open stream: No such file or directory in /usr/home/mysite.com/web/modules/categoryfeatured/categoryfeatured.php on line 11"


You can help me, please?
Thank's

Share this post


Link to post
Share on other sites

Module updated to version 0.2 and manual will be updated later.

So Ramonet delete previous version and try again.

Share this post


Link to post
Share on other sites

Ok, good. Thanks. Already working.

Only a small mistake, in admin, when you choose a category, you get this:
"Warning: Cannot modify header information - headers already sent by (output started at /usr/home/mysite.com/web/modules/categoryfeatured/categoryfeatured-ajax.php:2) in /usr/home/mysite.com/web/config/config.inc.php on line 12"

But the module works well.

Another question:
Is it possible to see in all pages this module (in the column), including in the home page?
This way we would have a module to highlight the products that we are interested. For example: "Products of the month."

Thank you very much.

Share this post


Link to post
Share on other sites

Thanks for feedback .

In zip file you have 3 files that you can replace.

I didn't get that error but it seams it caused by blank space before and after

 <?php .. ?>

so I changed that in categoryfeatured-ajax.php.Let me know if that worked.

In categoryfeatured.php and categoryfeaturedvertical.tpl I made changes so it displays products from Home category that you choose in BO and also it displays them in left/right column on all pages including homepage..

So you choose products from Home category in BO (there is a bug here you first need to select some other category and then Home) set display in Vertical carousel tab. and if you haven't already done this transplant module to left/right column.

catfeaturedfromHome.zip

Share this post


Link to post
Share on other sites

Hello,

If you run a PS1.2 replace line 335 in categoryfeatured.php by this

$cat= intval($_GET['id_category']);



Ckarone

Share this post


Link to post
Share on other sites

Tested in 1.3.7 deleting the blank space after <?php and it's running well!

Thank's nice module! :)

P.D: And very nice manual! :D

Share this post


Link to post
Share on other sites

I would love to try this module, but I just dont know what to do.

STEP 1 - My header.php file only has this 2 lines of code:

$controller = new FrontController();
$controller->displayHeader();



So, it doesn't have any "hook" code in there...

STEP 2 - the code in my category.tpl file in my theme Prestashop is completely different from the code that you show in the manual.

I'm I missing something here? Didn't made any change to my theme.

Share this post


Link to post
Share on other sites

You are using prestashop version 1.4?
I think this is not tested in 1.4.
I'm not sure but I think you have to modify you have to find /prestashop/classes/FrontController.php at line 451 (Step 1)
And for Step 2 only add {$HOOK_CATEGORY_FEATURED} where you want, if you want in top of page, put this at top of the template, if you want it before subcategories search {if isset($subcategories)} and put it above it, put the code where you want the module!

IS NOT TESTED!! Be sure to do backup before modify!

See you!

Share this post


Link to post
Share on other sites

great script! Thanks Razaro. Can someone help me to show the price just below the product in the carousel? I'm not so experienced with Presta. Please help me. Will be very much appricated.

Share this post


Link to post
Share on other sites

Great script, thanks a lot. This is very useful form our webshop. I have already implemented it, but there's only 1 problem. By default I show 3 products in the carousel. But when there is only 1 or 2 products in the category, then I will not show anything at all. Is there an easy fix for this? .Would be great.

 

Thanks again!

  • Like 1

Share this post


Link to post
Share on other sites

@indahuser:

I have the same problem.

If there is 1 product in a category then it will show nothing in the sidebar.

 

Jeroen

Share this post


Link to post
Share on other sites

Hi, this is an old post but i have a part of the solution !

here is the modification for working with 1.4.6.2

 

Replace the line 303 and 339 with

SELECT DISTINCT cl.`name` AS catname,cl.`link_rewrite` AS catlink,cfp.`id_product` As prID,pl.`name` AS product,pl.`link_rewrite` AS link_rewrite,i.`id_image`, il.`legend` FROM `' . _DB_PREFIX_ . 'category_featured_products` cfp  

I'working on the js problem!

 

Ckarone

Share this post


Link to post
Share on other sites

Ours is Version 1.3.3.0

 

We have "Featured Auction Products" at the top which we will keep as it is. Those products are fetched on Home by "Auction" module. Below that we want "Featured Products" box and beow that "Featured Categories" would come.

 

I need module which will allow me to choose Products and also Categories [from BO] so that these selected

products and categories would be displayed on Home as "Featured Products" and "Featured Categories".

 

Products will be displayed on Home with their names, prices and partial short descriptions continued with dots..... No "Add to Cart" button but we may display View button.

 

Each row [or box] must accomodate FOUR products and i must be able to arrange those in my sequence. Any module which will fulfill these requirements?

 

 

Thanks!!!

Share this post


Link to post
Share on other sites

Hello. Can you help me with error 500 ? It happen trying to select category in BO.

 

Ps: 1.4.7.3

Here a screenshot

thanks !

Share this post


Link to post
Share on other sites

Hi everyone. I know it is a very old post and probably no-one will reply, but I have to ask. How to force this module to work in newer versions of Prestashop? I'm running 1.6.0.9 and I absolutely love simplicity of it. How do you do that? I know my way around the presta software, but can't figure this out. Are there any other modules with similar functionalities? I am begging you, respond :)

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More