Zen Cart Logo

Whats New Sidebox

Views: 1,947

Results 1 to 14 of 14
22 Apr 2013, 1:11 AM
#1
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Whats New Sidebox

Hello ,

I want to customize the "Whats new?" products sidebox.... i want the box to be certain height and width... and want there to be a background image behind the links. I want the new items to display with certain size font and would like custom set margins in between the products and also on the sides of the links... I want the sidebox to only display the 6 most recent additions. Can anyone provide some guidance on how to do this? Thanks! -Aaron

22 Apr 2013, 1:40 AM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,843
Plugin Contributions:
17

Re: Whats New Sidebox

Sounds like you need to get FireFox with the Firebug add-on to help you with CSS changes.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

22 Apr 2013, 1:43 AM
#3
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Whats New Sidebox

aaronjmorgan:

i want the box to be certain height and width

You can set the height and width via your stylesheet.css file

div#whatsnew.leftBoxContainer {
height:XXXpx!important;
width:XXXpx!important;
}

replacing XXX with desired width and height

aaronjmorgan:

and want there to be a background image behind the links.

div#whatsnew.leftBoxContainer a {
background-image: url(../images/YOUR_IMAGE);
}

replacing YOUR_IMAGE with image name
../images/ indicates YOUR_TEMPLATE/IMAGES folder

aaronjmorgan:

I want the new items to display with certain size font and would like custom set margins in between the products and also on the sides of the links

fonts, padding, margins can also be added to the div#whatsnew.leftBoxContainer CSS rules

aaronjmorgan:

I want the sidebox to only display the 6 most recent additions

admin > Configuration > Maximum Values > New Product Listing - Limited to ...

will limit new products added within a certain time frame

22 Apr 2013, 10:58 PM
#4
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

thanks for your help. Rather than having the whatsnew sidebox limited to "7 days" is there a way to modify the script to allow an option to display for only the 6 most recent items?

22 Apr 2013, 11:08 PM
#5
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

Also- i was trying to apply the CSS stylesheet settings u mentioned up above and for some reason the entire whatsnew sidebox will not show no matter what I do... any ideas what may have caused this to happen?

23 Apr 2013, 12:11 AM
#6
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

disregard previous comment about the sidebox not displaying... it is displaying now... the problem of the 6 most recent items.... is still on my priority list. I also do not want to display the product images in this area...

my background image is not displaying correctly for this sidebox. as you can see on my page https://www.toyzeum.com/store/ the background image in the whatsnew sidebox is displaying behind the product text and not for the actual sidebox itself.

Also- the CSS code modification for this sidebox on the style sheet is not creating new size for this sidebox... it needs to be 293 x260 px

#whatsnew {border: none;}

#whatsnewHeading {display: none;}

#whatsnew.rightBoxContainer a {
background-image: url(https://www.toyzeum.com/store/images/main/rightsidebar_latestfinds_bg.jpg%29;
height:260px;
width:293px;
}

23 Apr 2013, 12:56 AM
#7
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Whats New Sidebox

aaronjmorgan:

disregard previous comment about the sidebox not displaying... it is displaying now... the problem of the 6 most recent items.... is still on my priority list. I also do not want to display the product images in this area...

my background image is not displaying correctly for this sidebox. as you can see on my page https://www.toyzeum.com/store/ the background image in the whatsnew sidebox is displaying behind the product text and not for the actual sidebox itself.

Also- the CSS code modification for this sidebox on the style sheet is not creating new size for this sidebox... it needs to be 293 x260 px

#whatsnew {border: none;}

#whatsnewHeading {display: none;}

#whatsnew.rightBoxContainer a {
background-image: url(https://www.toyzeum.com/store/images/main/rightsidebar_latestfinds_bg.jpg%29;
height:260px;
width:293px;
}

original request

aaronjmorgan:

and want there to be a background image behind the links.

just remove the a

#whatsnew.rightBoxContainer {
background-image: url(https://www.toyzeum.com/store/images/main/rightsidebar_latestfinds_bg.jpg);
height:260px!important;
width:293px!important;
}

!important after the width and height forces width and height

As far as only pulling the (6) most recent NEW Products, it is doable and I have the code somewhere in my sandbox, give me a few to find it if not I will re-write at my earliest convenience.

23 Apr 2013, 4:13 PM
#8
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

Thanks so much for your help RB... I made some major steps forward now in getting the whats new sidebox to appear as I wanted it to (thanks to your help), There is a few more things i am aiming to accomplish with this sidebox:

Attachment 12386

as you can see- in comparison to my live site- I am having some formatting issues: https://www.toyzeum.com/store/

  1. Formating (for some reason i cant get margins for the text links) not sure what im doing wrong...

  2. The sidebox needs to display the 6-7 most recent additions only (not the newest items in the last 7 days)

  3. The sidebox needs to display the most recent additions on the top. Currently it is putting the most recent adds on the bottom for some reason

  4. Would like custom product attributes to be able to called up in this line... Such as (where i found the figures / toys)

Sorry that I am adding new things to this list... This sidebox is a work in progress and trying to learn how to do this. Thank you for your kindness!

-Aaron

23 Apr 2013, 6:33 PM
#9
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Whats New Sidebox

Not at the sandbox today but try this for displaying most recent 6 items added.

in /includes/modules/sideboxes/YOUR_TEMPLATE_NAME/whats_new.php

find:

// display limits
// $display_limit = zen_get_products_new_timelimit();
  $display_limit = zen_get_new_date_range();
  $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name,
                                              p.master_categories_id
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_status = 1 " . $display_limit;

change to:

// display limits
// $display_limit = zen_get_products_new_timelimit();
//  $display_limit = zen_get_new_date_range();
$orderBy = 'order by p.products_date_added desc LIMIT 0 , 6'; 
  $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added, p.products_price, pd.products_name,
                                              p.master_categories_id
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_status = 1 " . $orderBy;
25 Apr 2013, 12:05 AM
#10
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

It works great- Thank you so much! :yes:

25 Apr 2013, 1:49 PM
#11
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

Does anyone know how to get custom product attributes to show up in the line for the whats new sidebox? :blush:

25 Apr 2013, 3:28 PM
#12
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Whats New Sidebox

What do you mean by custom attributes?

Attributes through the Attribute Controller?

Or an additional field added to the product?

25 Apr 2013, 3:32 PM
#13
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Whats New Sidebox

I am looking at your product info page, It would require allot of custom coding to put product attributes in the sidebox hence "no replies".

Take a look in the plugin section for numinix extra product fields, adding an extra field to the sidebox would require minimal code.

3 May 2014, 5:04 AM
#14
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Whats New Sidebox

Actually.. the modification is not working... I have been trying to figure out what the problem is...

The whats new sidebox is only showing three items per reload rather than 6...

Also... it seems to not keep the correct order from most recent to older additions...

Any help would be appreciated...
\

https://www.toyzeum.com/store/