Zen Cart Logo
Forums / Addon Sideboxes / Can't Get Side Box Anywhere to work

Can't Get Side Box Anywhere to work

Views: 1,992

Results 1 to 10 of 10
27 Nov 2011, 9:09 AM
#1
tracib avatar

tracib

Zen Follower

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

Can't Get Side Box Anywhere to work

I am trying to have a sidebox on my self-hosted workdpress blog to show my new products. I followed the instructions for the Side Box Anywhere, but couldn't get it to work.

So I researched other posts on it, and followed what this one said to do:
http://www.zen-cart.com/forum/showthread.php?t=177541&highlight=single_sidebox.php
so in the single_sidebox.php file, I set the full path to the application_top to this:

require('/home/MY-USERNAME/public_html/zen/includes/application_top.php');

I uploaded the single-sidebox in my zen folder.

I tried pasting this code:

<?php
  $zcSBmodule = 'whats_new.php';
  $zcSBlayout = 'right';
  require ('/home/MY-USERNAME/public_html/zen/single_sidebox.php');
?>

into my sidebar.php and tried it in different places, but couldn't get it to work--I want it to be on the right sidebar. Here's the code for that file for the right sidebar:

<!-- start sidebar-wrapper-right -->
<div id="sidebar-wrapper-right" class="sidebar">
	<ul id="sidebar-2">
	<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
		<div class="widget">
		<li><h2 class="title"><?php _e('Profile'); ?></h2>
			<p>This is a test profile widget</p>
		</li>
		</div>
	<?php endif; ?>
	</ul>
</div>
<!-- start sidebar-wrapper-right -->

I also tried using some wordpress plugins/widgets that are supposed to let you put php in the text box widgets, but that didn't work.

Also, I put in the width for the side box into the single_sidebox.php file in case my zen cart default was too big:

 if (!isset($zcSBwidth)) $zcSBwidth  = (isset($_GET['width'])) ? zen_db_input($_GET['width']) : 180;

Any ideas on what I'm doing wrong, or where exactly I should paste the code on my sidebar.php file?

My blog is http://www.TraciBunkers.com/blog

THANKS!

3 Dec 2011, 3:05 PM
#2
tracib avatar

tracib

Zen Follower

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

Re: Can't Get Side Box Anywhere to work

Anyone have any ideas? I'm not sure if I haven't gotten any replies because I called it Side box instead of sidebox, so people aren't finding it.

3 Dec 2011, 6:10 PM
#3
drbyte avatar

drbyte

Sensei

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

Re: Can't Get Side Box Anywhere to work

The Zen Cart piece works fine: http://www.tracibunkers.com/zen/single_sidebox.php

As for how to get WordPress to display it, I'm sorry that's not code I'm familiar with.

.
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.

3 Dec 2011, 8:04 PM
#4
tracib avatar

tracib

Zen Follower

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

Re: Can't Get Side Box Anywhere to work

Hi DrByte,
I figured it wasn't an issue with the addon since I was able to see it at http://www.tracibunkers.com/zen/single_sidebox.php

I was just hoping someone could tell me where to paste in my sidebar.php file for wordpress, or how to make it work in a sidebar widget in wordpress. I posted on the wordpress forum also, but no luck.

Thanks for looking at it.

4 Jan 2012, 3:39 AM
#5
tracib avatar

tracib

Zen Follower

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

Re: Can't Get Side Box Anywhere to work

I'm still struggling with this. What I don't understand is why this works: http://www.tracibunkers.com/zen/single_sidebox.php

But, I'm unable to call the single_sidebox.php file--not just in wordpress, but even on a plain html page.

I made a php file called zen_whats_new_sidebox.php to call the single_sidebox.php file. Here's what I have in it:

<?php
  $zcSBmodule = 'whats_new.php';
  $zcSBlayout = 'left';
  $zcSBwidth = 180;
  require ("/home/tracibu/public_html/zen/single_sidebox.php");
?>

I have tried calling that file in wordpress with no luck. And on a plain html page just to see if I can get it to work--but nothing shows up.

I've tried pasting the above code into the body of an html page; I've tried pasting this:

<?php
include ('http://www.tracibunkers.com/zen_whats_new_sidebox.php');
?>

and this:

<?php
include (home_url( '/' ) . 'zen_whats_new_sidebox.php');
?>

but I can't get anything to show up. I've got the single_sidebox.php in my shop folder, and the zen_whats_new_sidebox.php in my public folder. Any ideas? I'm getting pretty frustrated. Thanks!

4 Jan 2012, 4:31 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Can't Get Side Box Anywhere to work

Many servers don't let you run PHP code inside a .html page. You would need to name the page with a .php extension instead of .html.

.
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 Jan 2012, 5:18 AM
#7
tracib avatar

tracib

Zen Follower

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

Re: Can't Get Side Box Anywhere to work

I was able to paste php code into an html page to show a form--and it worked. But not this:

<?php
include ("/home/tracibu/public_html/zen_whats_new_sidebox.php");
?> 

oi! :cry:

And maybe that doesn't really matter because I want to show it on my blog. But when I paste it into a php page in my blog, it doesn't show up. I've tried it in various places, and even started a new test blog, with a different theme in case the problem was with my theme. But that didn't make a difference.

5 Jan 2012, 7:09 AM
#8
tracib avatar

tracib

Zen Follower

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

Re: Can't Get Side Box Anywhere to work

Tonight I pasted this

<?php
include ("/home/tracibu/public_html/zen_whats_new_sidebox.php");
?>

into the index.php file of my wordpress blog theme, and the new products showed up! Of course it wasn't where I wanted it, but it was there. BUT, if I pasted it into any other php file for my theme, like the sidebar, it didn't show up. Depending on where I put it, it either made no difference, or made the right sidebar content disappear (since that's where I was trying to put it).

Does that give any clues to what I'm doing wrong & how to fix it? Please oh please?

9 Jan 2012, 7:48 PM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Can't Get Side Box Anywhere to work

"throw it up against the wall to see what sticks" brand of troubleshooting is not always the best way to get an answer to a problem.. Especially this problem.. Getting Sideboxes Anywhere to work within WordPress is not likely to be answered by anyone unless someone knows BOTH platforms well enough to answer you (and that they are willing to share the information).. It's just not a quick answer..

As I explained on the WordPress forum, what you've posted here ALL BY ITSELF will not give anyone a clue as to why this code won't work in a WordPress widget vs a WordPress page (which is what you are trying to do) unless they know BOTH platforms.. I'm sure the answer is a simple one, but it will take someone who knows BOTH platforms to get it to work properly. (the gentleman who tried to help you with this is DEFINITELY not that guy..:no::smile:)

Personally I'd prefer to find the right answer versus implementing a hacky solution that works today, but breaks on the next WP or ZC update..

I know that still doesn't give you the answer, but it might be time to consider paying for an expert to give you the right solution.. If there is an expert out there who knows the answer they appear to not be in a sharing mood on this one..:smile:

tracib:

Tonight I pasted this

<?php include ("/home/tracibu/public_html/zen_whats_new_sidebox.php"); ?>
> 
> Does that give any clues to what I'm doing wrong & how to fix it? Please oh please?

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

9 Jan 2012, 7:50 PM
#10
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Can't Get Side Box Anywhere to work

tracib:

I was able to paste php code into an html page to show a form--and it worked. But not this:

<?php include ("/home/tracibu/public_html/zen_whats_new_sidebox.php"); ?>
> 
> And maybe that doesn't really matter because I want to show it on my blog. But when I paste it into a php page in my blog, it doesn't show up. I've tried it in various places, and even started a new test blog, with a different theme in case the problem was with my theme. But that didn't make a difference.It wouldn't work because you can't paste PHP code into a page using the blog page editor..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.