Display Zen Cart Sidebox inside Widget
-
I need help trying to get Zen Cart sideboxes to display within a WordPress widget. Though I think I am on the right path, I have officially hit a wall and was hoping that someone might be able to point me in the right direction on how to get unstuck..
I am using a Zen Cart add-on called Sideboxes Anywhere..
Following these instructions I was successfully able to display the new products sidebox by adding the following code to my template.
<?php $zcSBmodule = 'whats_new.php'; $zcSBlayout = 'left'; require ("/path/to/zencart/single_sidebox.php"); ?>
This is great except I would like to display the sidebox inside a widget, and I have been unsuccessful thus far.
I have tried using the Executable PHP widget with no luck. When I add the code above, all the widgets in the sidebar disappear along with the footer.
I also tried creating my own custom widget with the following code:
<?php /* Plugin Name: Zen Cart Whats New Sidebox Plugin URI: https://www.yoursite.com/ Description: Display Zen Cart Whats New sidebox inside a WordPress widget. Requires the Zen Cart Sideboxes Anywhere add-on to work. Author: Me Version: 1.0 Author URI: https://www.yoursite.com/ */ function zen_cat() { $zcSBmodule = 'whats_new.php'; $zcSBlayout = 'left'; require ("/path/to/zencart/single_sidebox.php"); } function init_zen_cat(){ register_sidebar_widget("ZC Whats New Sidebox", "zen_cat"); } add_action("plugins_loaded", "init_zen_cat"); ?>
This too results in the all the widgets in the sidebar & the footer disappearing.
I am hoping that the solution is something simple that I am overlooking.. Would sure appreciate some input on this from any kind soul who can help..
- The topic ‘Display Zen Cart Sidebox inside Widget’ is closed to new replies.