Forums / Basic Configuration / custom sidebox, i.e. perhaps for SSL or trust seal

custom sidebox, i.e. perhaps for SSL or trust seal

Locked

Views: 14,841

Results 1 to 20 of 34
This thread is locked. New replies are disabled.
13 Aug 2007, 5:32 AM
#1
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

custom sidebox, i.e. perhaps for SSL or trust seal

I recently had a client who wanted various items placed within the side columns of her site, but not within actual sideboxes. After initially playing around with tpl_main_page.php in the templates/MYTEMPLATE/common/ folder, I found a better way to do this.

You can actually create side panel features that can be controlled just like any other sidebox (Tools --> Layout Boxes Controller), but aren't actually displayed within a sidebox template.

This is particularly useful if you wish to display a SSL security seal or trust seal within a column on your website.

To create a custom side panel feature, create a new PHP file with the code below. Be sure to change CUSTOM_NAME with your own chosen name.

<?php
// -----------------------------------
// MY CUSTOM SIDE PANEL ITEM
// -----------------------------------

  // test if box should be displayed
  $show_CUSTOM_NAME = true;

  if ($show_CUSTOM_NAME  == true) {
      ?>
			
      <div align="center" style="padding:5px;">
         PLACE YOUR BOX CONTENTS HERE
      </div>
			
      <?php }
?>

Save the file as CUSTOM_NAME.php (replacing CUSTOM_NAME with your own name, providing it is consistent with the one used in the page code). Upload the file into the includes/modules/sideboxes/ folder. Then log into admin, and select Tools -> Layout Boxes Controller to manage your new feature. You can select which column to display it within, along with its sort order, just like any other module.


P.S. My apologies if this has been discussed a thousand times before.

13 Aug 2007, 5:44 AM
#2
moebiusenterprises avatar

moebiusenterprises

Zen Follower

Join Date:
May 2005
Location:
Phoenix Arizona (whew!)
Posts:
167
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

That obviously works... but I know what I did was create my own sideboxes to do that by using the 'blank sidebox' mod.

Cheers!

Vicki
www.moebiusenterprises.com
Fragrancejewelrymetaphysical suppliesartLIFE ... 'bout sums it up....

13 Aug 2007, 6:58 AM
#3
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

The main difference between this code and the blank sidebox mod is that this code does not use the sidebox template.

This can be useful if you don't want your side column content to be displayed within a box.

It is also useful if you want to create a sidebox that uses a different template than the rest of your sideboxes.

1 Sep 2007, 8:58 AM
#4
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Just wanted to add, thanks your a star. I have been looking for this mod for ages. Its good for me because if you want to display the google checkout acceptance logo you have to enter their code. With the normal blank sideboxes addon you got the style around it too. Where as this you just get the logo!.

Thankyou very much!

1 Sep 2007, 12:01 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: custom sidebox, i.e. perhaps for SSL or trust seal

phil99:

Just wanted to add, thanks your a star. I have been looking for this mod for ages. Its good for me because if you want to display the google checkout acceptance logo you have to enter their code. With the normal blank sideboxes addon you got the style around it too. Where as this you just get the logo!.

You could also use a regular sidebox and just use CSS to turn off the styling for just that sidebox.
Nevertheless, use whatever works for you.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Dec 2007, 6:14 PM
#6
rtx avatar

rtx

New Zenner

Join Date:
Oct 2007
Posts:
26
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Hi,
I am trying to use rowanwa's code to put a PayPal logo in one of my side panels. Here is the code:

<?php // ----------------------------------- // PAYPAL ACCEPTED SIDE PANEL ITEM // ----------------------------------- // test if box should be displayed $show_MYK_PAYPAL = true; if ($show_MYK_PAYPAL == true) { ?>
  <div align="center" style="padding:5px;"> 

<!-- PayPal Logo --><table border="0" cellpadding="10" cellspacing="0" align="center"><tr><td align="center"></td></tr>

<tr><td align="center"><a href="#" onclick="javascript:window.open('https://www.paypal.com/uk/cgi-bin/webscr?cmd=xpt/cps/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');"><img src="https://www.paypal.com/en_GB/i/bnr/vertical_solution_PP.gif" border="0" alt="Solution Graphics"></a></td></tr></table><!-- PayPal Logo --> </div>
  <?php } 

?>

The bit I have highlighted red is straight from the PayPal web site. I am getting the following error message when I turn the sidebox on:
Parse error: syntax error, unexpected T_STRING in /pathtomystore/store/includes/modules/sideboxes/MYK_PAYPAL.php on line 7
Line 7 is the one that says: $show_MYK_PAYPAL = true;

I am no expert in PHP, in fact I have never programmed in PHP... if anyone can say what the problem might be I would be very grateful.

Thanks,
RtX

4 Dec 2007, 11:03 PM
#7
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Hi RtX,

I tested your code and it worked for me on Zen Cart 1.3.6. Have you tried re-uploading the file and testing it again? From what I can see, there's no syntax error in the code you have provided.

I will be updating my module contributions for version 1.3.8 over the next week or so. At the same time, I will check to make sure the custom sidebox code still works for 1.3.8.

5 Dec 2007, 11:15 AM
#8
rtx avatar

rtx

New Zenner

Join Date:
Oct 2007
Posts:
26
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Hi, rowanwa,
I have uploaded various versions of the same text and get the same or similar error messages regardless. Someone has advised me that:

if ($show_MYK_PAYPAL == true) {

should be

if ($show_MYK_PAYPAL == "true") { 

Frankly, I do not know if this is right, but I may give it a try.

Maybe I'll also try re-typing the whole file rather than copying and pasting and editing. If I have any luck, I'll post again.

Thanks,
RtX

5 Dec 2007, 11:40 AM
#9
rtx avatar

rtx

New Zenner

Join Date:
Oct 2007
Posts:
26
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

I completely re-entered (by re-typing) the code and it worked. It looks the same but clearly is not. I think there must be a funny character or one that looks ok but is not what php expects somewhere in there. Thanks for responding.
RtX

7 Jan 2008, 6:15 PM
#10
lkzone avatar

lkzone

New Zenner

Join Date:
Jan 2008
Location:
Georgia
Posts:
68
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

rowanwa:

I recently had a client who wanted various items placed within the side columns of her site, but not within actual sideboxes. After initially playing around with tpl_main_page.php in the templates/MYTEMPLATE/common/ folder, I found a better way to do this.

You can actually create side panel features that can be controlled just like any other sidebox (Tools --> Layout Boxes Controller), but aren't actually displayed within a sidebox template.

This is particularly useful if you wish to display a SSL security seal or trust seal within a column on your website.

To create a custom side panel feature, create a new PHP file with the code below. Be sure to change CUSTOM_NAME with your own chosen name.

<?php // ----------------------------------- // MY CUSTOM SIDE PANEL ITEM // ----------------------------------- // test if box should be displayed $show_CUSTOM_NAME = true; if ($show_CUSTOM_NAME == true) { ?>
  <div align="center" style="padding:5px;">
     PLACE YOUR BOX CONTENTS HERE
  </div>
		
  <?php }

?>

> 
> Save the file as CUSTOM_NAME.php (replacing CUSTOM_NAME with your own name, providing it is consistent with the one used in the page code). Upload the file into the **includes/modules/sideboxes/** folder.  Then log into admin, and select Tools -> Layout Boxes Controller to manage your new feature.  You can select which column to display it within, along with its sort order, just like any other module.
> 
> ---------------------------------------
> 
> P.S. My apologies if this has been discussed a thousand times before.

I found your post in searching the forum.  You indicate to save the file "providing it is consistent with the one used in the page code."  Can you please tell me where (and on what page - index.php?) this new php page would be referenced?

Thx,
Lynne
7 Jan 2008, 6:20 PM
#11
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

In the Downloads section, see link at top of this page, there is a Module called "Sidebox Anywhere". Would be easier to use that as it works and is fairly easy to install.

The learning is in the doing.

Potent Products

7 Jan 2008, 11:07 PM
#12
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

lkzone:

I found your post in searching the forum. You indicate to save the file "providing it is consistent with the one used in the page code." Can you please tell me where (and on what page - index.php?) this new php page would be referenced?

Thx,
Lynne

Hi Lynne,

Basically, you replace the words CUSTOM_NAME in the PHP code with the name that you want to choose for your sidebox. You then save the file with the with a name that is identical to what you replaced CUSTOM_NAME with. For example, if you replaced CUSTOM_NAME with my_sidebox, then you should save the code with the filename my_sidebox.php. You would upload this file into the includes/modules/sideboxes/ folder.

The new file would not be referenced using index.php? because it isn't a new page on your store. It is simply a sidebox module that can be turned on and off using Zen Cart admin. Once the new file has been uploaded, log into your admin area and select Tools -> Layout Boxes Controller. Click on the sidebox with the filename you have chosen. You can then use the Edit button to control the display of the box on your store.

Hopefully that clears a few things up. Let me know if you still have questions.

10 Feb 2008, 7:20 AM
#13
tenpercentfirearms avatar

tenpercentfirearms

New Zenner

Join Date:
Mar 2006
Posts:
14
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

I did a search and found this link. PERFECT! Thank you so much. I was able to move my Hacker Safe logo over to the right sidebox very easily. Thank you!

https://www.tenpercentfirearms.com/index.php

17 Feb 2008, 9:37 PM
#14
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Thank you rowanwa for the code. This works great. I have been trying to figure how to do something just like this. Thank you again.

<?php // ----------------------------------- // MY CUSTOM SIDE PANEL ITEM // ----------------------------------- // test if box should be displayed $show_CUSTOM_NAME = true; if ($show_CUSTOM_NAME == true) { ?>
  <div align="center" style="padding:5px;">
     PLACE YOUR BOX CONTENTS HERE
  </div>
        
  <?php }

?>

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

20 Feb 2008, 9:10 AM
#15
tombenson2 avatar

tombenson2

New Zenner

Join Date:
Jan 2007
Posts:
8
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Great stuff! Thank you.

22 Oct 2008, 2:29 PM
#16
dudeshouse avatar

dudeshouse

New Zenner

Join Date:
Dec 2005
Location:
Portishead, UK
Posts:
32
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Cool, thanks, works well. Does what it says on the tin.

...there is nothing worse than aggresive stupidity...

26 Nov 2008, 2:01 AM
#17
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

I tried this and all I got was a broken link image ( a blue square with a "?"). This is what I've done with the code:

<?php // ----------------------------------- // Store locations 1 // ----------------------------------- // test if box should be displayed $show_CUSTOM_NAME = true; if ($show_CUSTOM_NAME == true) { ?> <div align="center" style="padding:5px;"> <a target="_self" href="http://xxxxxxx.net.au/store/index.php?main_page=page&id=6"><img src="http://xxxxxxx.net.au/images/AW_banner.jpg"></a> </div> <?php } ?>

Heres a screen shot of the problem:

Do I add the code into an alredy existing sidebox or just make a new php as i have done

Tooty Fruity

26 Nov 2008, 2:06 AM
#18
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

sorry, in the previous post I entered an earlier version of the code that also did'nt work. The code I used for the above screenshot was:

<?php // ----------------------------------- // MY CUSTOM SIDE PANEL ITEM // ----------------------------------- // test if box should be displayed $show_STORE_LOCATION1 = true; if ($show_STORE_LOCATION1 == true) { ?>
  <div align="center" style="padding:5px;"> 
     <img src=http://adultworld.net.au/store/images/banners/AW_banner.jpg/> <a target="_self"

href="http://adultworld.net.au/store/index.php?main_page=page&id=6">
</div>

  <?php } 

?>

Tooty Fruity

26 Nov 2008, 2:19 AM
#19
rowanwa avatar

rowanwa

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

If you would like a sidebox with a header like the rest of the sideboxes I suggest you use the blank sidebox contribution: http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_52&products_id=174

The custom sidebox contribution you are trying to use doesn't use sidebox headers.

The reason your image link is broken is probably due to the lack of quotation marks

<img src=http://adultworld.net.au/store/images/banners/AW_banner.jpg/>

change to

<img src="http://adultworld.net.au/store/images/banners/AW_banner.jpg" />

Hope that helps.

26 Nov 2008, 5:05 AM
#20
demz001 avatar

demz001

New Zenner

Join Date:
Sep 2008
Location:
Gold Coast, Australia
Posts:
56
Plugin Contributions:
0

Re: custom sidebox, i.e. perhaps for SSL or trust seal

Thanks for the advice on the quotation marks, it worked.

I did end up using the blank sidebox contribution in the end. I had a slight problem with it... I tried to duplicate it, renaming the 3 files and the code in them. I wanted 2 pemanent adds in both rifgt and left columns. I managed to display 2 different headers for each sidebox but the images were the same, even though I had different image links in each "blank_sidebox_defines.php" and "blank_sidebox_defines2.php" file.

My solution (for now) was to only have one banner sidebox switched on and in its place in the opposite column I've got the blank sidebox "on". As the banners are linked to a store locations page I wont need stats on them as yet. :)

Tooty Fruity