• DivaVocals

    (@divavocals)


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

Viewing 8 replies - 46 through 53 (of 53 total)
  • Thread Starter DivaVocals

    (@divavocals)

    No doesn’t shed any light for me…. if you read the post that started this thread, this is exactly the result I said I got..

    Thread Starter DivaVocals

    (@divavocals)

    Another thought.. I’m using the Catalyst theme framework on the site I tested.. It includes a Text/PHP widget.. This is what I used for the instructions I posted.. Perhaps there is a difference between the TextPHP widget I used and the one I suggested that you use.. Suggest trying a different Text/PHP widget plugin and follow all of my instructions again and see if you get a different result..

    @divavocals I hope you are still following this thread. Just wondering what version of wordpress you are using. I posted on the Zen Cart forum and was told it won’t work in WordPress. I am getting this error when application_top.php is called.
    PHP Fatal error: Call to a member function sql_cache_exists() on a non-object in /home/xyz/public_html/store/includes/classes/db/mysql/query_factory.php on line 125
    I tracked it down to:

    if ( $zf_cache AND $zc_cache->sql_cache_exists($zf_sql, $zf_cachetime) )
    zf_cache = 1
    zf_sql = select configuration_key as cfgkey, configuration_value as cfgvalue from configuration
    zf_cachetime = 150

    Any suggestions for what I should look at? I followed your instructions above. Using WP v3.3.1 and Genesis v1.8. I’m wondering if it might be something in Genesis. Sigh… so close. Many Thanks (ZeroGravity on ZC)

    Thread Starter DivaVocals

    (@divavocals)

    Not sure what you mean by

    I posted on the Zen Cart forum and was told it won’t work in WordPress.

    What wouldn’t work?? and where on the Zen Cart forum did you post???

    ETA: Nevermind.. found your post: https://www.zen-cart.com/forum/showthread.php?t=194136&highlight=WordPress

    Assuming it was a problem with Sidebox Anywhere I posted on ZC as you suggested. I was basically told Sidebox Anywhere wouldn’t work in wordpress. This is the link to the thread.

    I have been trying to track down what may be causing the conflict without much luck. I don’t have any problems on the ZC pages where I have pulled the WP template in so was wondering if it is where/when application_top.php was being loaded by Sidebox Anywhere. I haven’t had any luck trying to load it early when on a WP page where I would like the sidebox to show.

    Thread Starter DivaVocals

    (@divavocals)

    In my last PM to you on the Zen Cart forum, I think I told you that since I posted this long rant, I have come up with a completely different method of displaying Zen Cart sideboxes in WordPress. **LOL**

    While I got pretty far down the beaten path using a Text/PHP widget to display the Sideboxes Anywhere code in WordPress, I ran into a few snags and decided I needed to take a different approach to this whole idea.

    One big issue issue for me was the images.. I KNOW the method I came up with to get them to display was all the wrong way to do it, and I couldn’t put a site out in the wild that way.. i knew that the whole approach was wrong, and I wasn’t fully comfortable with going forward with it.

    So I scraped this approach altogether and decided to take a stab at building REAL WordPress widgets to display Zen Cart sideboxes. I decided that I would continue using the code from Sideboxes Anywhere, but take a different approach to how it was displayed in WordPress.

    I got my widgets working. What you see here: https://clientyourplateormineinc(dot)overthehillweb(dot)com/about-our-services/ is the result of that effort. (This is using the latest version of WordPress)

    So now I have a fully functioning Zen Cart widget solution that will display the following Zen Cart sideboxes as WordPress widgets using the Zen Cart Sideboxes Anywhere add-on:

    • New Products
    • Specials
    • Featured Products
    • Shopping Cart
    • Login

    The Featured Products and Specials widgets will even hide themselves when specials and featured products reach their expiration dates (just like the Zen Cart Sideboxes do)

    I am fairly comfortable with launching my client’s site with this solution in place, but I will eventually pay a REAL developer **LOL** to tweak some minor things I am not fully satisfied with and would make my good solution a better solution.

    Thanks!! Just before I hit the submit button on my last post I thought I should look at your PM’s first. LOL should have listened to that thought. I’m going to look at a few things and may send you a PM via ZC.

    The site is looking good. I’ve been meaning to ask you how it was going and when it might be live.

    Thread Starter DivaVocals

    (@divavocals)

    **LOL** No worries..

    Yes I’m pretty pleased with the site.. There is one small thing I need to tweak, and I’m a little stumped on it.. It’s a CSS thing with the header that I have to address. It’s not anything anyone would really notice on the surface, but I know it’s there.. **LOL**

    The planned launch is at the end of April. My client has been mad busy and the hold up on the launch has been the configuration of her products. She is finally gonna have some time to get started working on this next week.. So I am hoping that end of April will be THE launch!!!

Viewing 8 replies - 46 through 53 (of 53 total)
  • The topic ‘Display Zen Cart Sidebox inside Widget’ is closed to new replies.