Forums / Addon Sideboxes / Upcoming Products

Upcoming Products

Views: 11,767

Results 1 to 11 of 11
24 Jan 2016, 4:37 PM
#1
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Upcoming Products

Hi all.

Just wondered if anyone has managed to get Upcoming Products working in a sidebox. The only one available is for v1.3 so doesn't work with 1.5.4

Thank you :)

24 Jan 2016, 5:15 PM
#2
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Upcoming Products

Sorry this title should have read 1.5.4 and not 1.5.5 :/

24 Jan 2016, 6:17 PM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Upcoming Products

There really isn't much of any difference in any product side-box except the product query.

Copy the /includes/modules/sideboxes/whats_new.php
Rename it to /includes/modules/sideboxes/whats_expected.php

Copy the /includes/templates/template_default/sideboxes/tpl_whats_new.php
Rename it to /includes/templates/template_default/sideboxes/tpl_whats_expected.php

In /includes/modules/sideboxes/whats_expected.php

find:

  $display_limit = zen_get_new_date_range();

replace with

$display_limit = zen_get_upcoming_date_range();

$limit_clause = "  order by " . (EXPECTED_PRODUCTS_FIELD == 'date_expected' ? 'date_expected' : 'products_name') . " " . (EXPECTED_PRODUCTS_SORT == 'asc' ? 'asc' : 'desc') . "
                   limit " . (int)MAX_DISPLAY_UPCOMING_PRODUCTS;

in the query, find:

pd.products_name,

add after:

products_date_available as date_expected,

same query, find:

$display_limit

add after:

 . $limit_clause

find:

    require($template->get_template_dir('tpl_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_new.php');

change to:

    require($template->get_template_dir('tpl_whats_expected.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_expected.php');

find:

    $title =  BOX_HEADING_WHATS_NEW;
    $title_link = FILENAME_PRODUCTS_NEW;

change to:

    $title =  'Upcoming Products';
    $title_link = '';

Now in /includes/templates/template_default/sideboxes/tpl_whats_expected.php
find:

    $content .= '<div>' . $whats_new_price . '</div>';

add after:

    $content .= '<div>' . zen_date_short($random_whats_new_sidebox_product->fields['date_expected']) . '</div>';

Go to admin and activate new box

This will work as is!

However I would consider changing every instance of $random_whats_new_sidebox_product and $whats_new to $random_whats_expected_sidebox_product and $whats_expected

24 Jan 2016, 6:22 PM
#5
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Upcoming Products

Hi I found the v1.3 on here in Sidebox Plugins .... uploaded 4 files which do not change any existing files .. Admin acknowledged the new plugin .. activated it and NOTHING!!!! I know we have 4 upcoming products if I switch that on in the centre bar ... these are not activating the sidebox ..

24 Jan 2016, 7:13 PM
#6
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Upcoming Products

I was kind of hoping you gave a link, so I would not have to guess. So now i geuss you used this mod. If that's the case, it is expecting the product has a dat in the future and the status has to be green, or in stock.

$expected_query = "select p.products_id, p.products_image, pd.products_name, products_date_available as date_expected, p.master_categories_id
                     from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                     where p.products_id = pd.products_id
                     and p.products_status = 1
                     and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
24 Jan 2016, 7:53 PM
#7
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Upcoming Products

Sorry yes I should have given you a link .. my bad. OK so now I have both the scrolling and the static upcoming products working but in order to do that I have to switch Upcoming Products to more than zero in the Maximum Values definitions in Admin .. which switches back on the list at the bottom centre of the page ... that's the bit I want to dispense with .. no sense in having it in a sidebox and at the bottom of every page .... Now just need to know how to deactivate this centre box

24 Jan 2016, 8:03 PM
#8
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Upcoming Products

:smile:

In includes/modules/sideboxes/upcoming.php find:

  $limit_clause = "  order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                   limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;

and change ```php
" . MAX_DISPLAY_UPCOMING_PRODUCTS

```php
  $limit_clause = "  order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                   limit 9";
24 Jan 2016, 8:24 PM
#9
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Upcoming Products

Sorry .. I think I may be confusing the issue. There is no upcoming.php in includes/modules/sideboxes.

Sideboxes are not the problem .. I see that the includes/templates/template_default/templates/tpl_index_default calls the centre box at line 74 on mine .. I have tried to comment these lines out with /** (doesn't work) and <!-- down to --> and it still produces the centre-box with --> after it. I'm using EditPlus 3 and this is a really strange new one on me!

24 Jan 2016, 8:39 PM
#10
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Upcoming Products

Ok I have got it sorted .. thanks guys you were pointing me in the right direction .. just took a few trials to make it work.

You're right the v1.3 scrolling plugin does work as long as you have the number of expected products more than zero but that then also displays the expected books at the bottom of the index page TWICE! I have finally found the right combination of comment out lines in includes/templates/template_default/templates/tpl_index_default by putting line returns after every <?php and before every ?> so that I casn see where the IF statement starts and finishes .. thank you for your time

24 Jan 2016, 9:01 PM
#11
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Upcoming Products

Only thing left is to increase the depth of the scroller and change American date formats to UK date formats :)