Jump to content

Themeszone products carousel clone (help needed)


MartynasMa2015

Recommended Posts

Hello,

 

I'm trying to make 4 themes zone carousels by different information : 1 carousel (featured products) , 2 carousel (newest products) , 3 (best sellers), 4 (custom products from category). Can anybody help me to clone that module?

I'm trying to do this by myself but with no luck...

Link to comment
Share on other sites

Hello Pascal,

 

First of all thank you for reply... I'm using 1.6.0.13. No the slider is not a default prestashop it's ThemesZone made products carousel. URL to module :

https://www.prestashop.com/forums/topic/380202-products-carousel-free-prestashop-16-module/?hl=%20carousel

 

i also send u a login details to my custom page to yours PM

Link to comment
Share on other sites

Hi Martynas,

 

Sorry, as a little busy.

 

Changes to make:

 

 

 

- Copy folder (with contents) from  /modules//themeszonecarousel/     to modules/themeszonescar_1

 

 

 

- Rename file: /modules/themeszonecar_1/themeszonecarousel.php    to   /modules/themeszonecar_1/themeszonecar_1.php

 

 

- Edit this new file (  /modules/themeszonecar_1/themeszonecar_1.php   )    (add/change red code):

 

<?php
 
/*
 * ThemesZoneCarouselModule 1
 * 
 * @author Themes Zone <[email protected]>
 * @copyright 2014 Themes Zone
 * @version 0.9.5
 */
 
if (!defined('_PS_VERSION_'))
    exit;
 
class ThemesZoneCar_1 extends Module {
 
    public function __construct() {
        $this->name = 'themeszonecar_1'; // internal identifier, unique and lowercase
        $this->tab = ''; // backend module coresponding category - optional since v1.6
        $this->version = '0.9.5'; // version number for the module
        $this->author = 'Themes Zone'; // module author
        $this->need_instance = 0; // load the module when displaying the "Modules" page in backend
        $this->secure_key = Tools::encrypt($this->name);
        $this->bootstrap = true;
        parent::__construct();
 
        $this->displayName = $this->l('Themes Zone Products Carousel 1'); // public name
        $this->description = $this->l('Products Carousel 1 Module by Themes Zone'); // public description
 

 

 

and save.

 

 

 

Edit file:

/themeszonecar_1/views/templates/hook/hook.tpl

 

Change (Add red '_1':

 

{if isset($products) && $products}
 
    <div class="tz-carousel">
        <h2 class="title_block">
            {$title}
        </h2>
 
        <!-- Products list -->
        <ul id="owl-slider_1" class="owl-carousel product_list grid">
            {foreach from=$products item=product name=products}
 

 

and almost at the end of the file (add '_1') :

 

    <script>
 
        $(document).ready(function() {
 
            var owl = $("#owl-slider_1");
 
            owl.owlCarousel({
 

 

 

 

Then, go to back office, modules->modules

 

and install the new module:

    "Themes Zone Products Carousel 1"

 

If needed, mode in modules->modules the module to a different position.

Then go to the configure page and change as appropriate.

 

 

For a third module, do as above, with but _2

 

Hope this helps,

pascal.

Link to comment
Share on other sites

Not working... :/ it shows that module is already installed.. :( and i need that cloned module would use different information from first module like :

 

first module : featured products

second module : newest products and so on... thank you in advance

If it says it's already installed, I think you forgot to make some of the changes, especially the name of the Class, or the name of the module (which should be the same, only name is lowercase)

 

 

class ThemesZoneCar_1 extends Module {
 
    public function __construct() {
        $this->name = 'themeszonecar_1'; // internal identifier, unique and lowercase
 
 
I made a second one this way, and I can use different categories or so for it, so it should work...
 
Please recheck if you made all the changes. Let me know if this doesn't fix it, then I will try to attach some files for you here.
 
pascal.
Link to comment
Share on other sites

  • 8 months later...

Any additional advice on this?  I was able to get this to install, configure it on the back end with a different data set and it will transplant to a hook.  So it appears that everything is working as needed but I can not get it to show up in the Front Office on the hook I applied to on the home page (displayHome).  I have cleared cache etc.....

 

Any additional help on this is appreciated as I also need a couple more of these and it is soooo close!

Edited by jennywill (see edit history)
Link to comment
Share on other sites

  • 7 months later...

I found 1 error in Pascal's manual: Copy folder (with contents) from  /modules//themeszonecarousel/     to modules/themeszonescar_1

 

!not themeszoneScar_1 but themeszonecar_1

 

All works fine if fix this mistake

Link to comment
Share on other sites

Change line 131 of modules/homefeatured/homefeatured.php from:

				HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');

to:

				HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_add', 'desc');

Then go to Advanced Parameters > Performance and click the "Clear cache" button to clear your cache.

Link to comment
Share on other sites

  • 10 months later...

public function renderForm() {

$fields_form = array(

'form' => array(

'legend' => array(

'title' => $this->l('Themes Zone Products Carousel')

 

 

change to

 



public function renderForm() {

$fields_form = array(

'form' => array(

'legend' => array(

'title' => $this->l('Themes Zone Products Carousel 1')



Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...