Hello everyone, I can not run this code!
which folder should I put the file: single_sidebox.php?
in /includes/modules/sideboxes ?
or in /includes/templates/MY_TEMPLATE/sideboxes ?
thanks
Hello everyone, I can not run this code!
which folder should I put the file: single_sidebox.php?
in /includes/modules/sideboxes ?
or in /includes/templates/MY_TEMPLATE/sideboxes ?
thanks
me explain what I did, so you can help:
1. I uploaded the file single_sidebox.php
in http://www.mysitezencart.com/shop/single_sidebox.php
2. I created the file test.php with the following code:
3.I uploaded the file test.php in the<?php
$zcSBmodule = 'whats_new.php';
$zcSBlayout = 'left';
define('DIR_WS_IMAGES', 'http://www.mysitezencart.com/shop/images/');
require ("http://www.mysitezencart.com/shop/single_sidebox.php");
?>
http://www.othersite.com/test.php
but I see a blank page
What did I do wrong?
thanks
Hello everyone, I can not run this code!
me explain what I did, so you can help:
1. I uploaded the file single_sidebox.php
in http://www.mysitezencart.com/shop/single_sidebox.php
2. I created the file test.php with the following code:
3.I uploaded the file test.php in the<?php
$zcSBmodule = 'whats_new.php';
$zcSBlayout = 'left';
define('DIR_WS_IMAGES', 'http://www.mysitezencart.com/shop/images/');
require ("http://www.mysitezencart.com/shop/single_sidebox.php");
?>
http://www.othersite.com/test.php
but I see a blank page
What did I do wrong?
thanks
Sorry I know this is an old thread but I can't get this working.
I copied the code from the Sidebox Anywhere mod and placed it in ezpage_sidebox_include.php. The sidebox I have defined in said include displays correctly but then processing stops. The second <div> is in the code of the page but nothing further.
Can anyone suggest what may be going wrong, especially as it seemed to work for joeguy44.
zencart 1.3.9h
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.
Answering my own question:
Following these instructions I was successfully able to display the categories sidebox by creating a file called external-displayed-categories.php which contained this code:
I created a second file to display new products called external-displayed-whatsnew.php which contained this code:Code:<?php $zcSBmodule = 'categories.php'; $zcSBlayout = 'left'; require ("/path/to/zencart/single_sidebox.php"); ?>
Both work perfectly together on the same page/site.Code:<?php $zcSBmodule = 'whats_new.php'; $zcSBlayout = 'left'; require ("/path/to/zencart/single_sidebox.php"); ?>
BUT, my externally called sideboxes didn't look like they do in the shop.. Soooooooo...
I needed to add some code to get my sideboxes looking like they do in the shop. To do this I simply linked the stylesheet with the declarations which affect my sideboxes in my single_sidebox.php file..
Now in the name of being a stickler for detail, I wanted to make sure that sidebox "pages" will properly validate. So I added the following to my single_sidebox.php file at the VERY top of the file:Just before the <title> opening and closing tags, you will need to add a link to the stylesheet which styles the sideboxes.Code:<!DOCTYPE html> <html> <head> <link rel="profile" href="http://gmpg.org/xfn/11" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> </head>
You add this to the single_sidebox.php file because that is the file the individual sidebox files call. They will inheirit the stylesheet settings from this file.
For the site I'm working on, instead of linking to the Zen Cart stylesheets in my single_sidebox.php file, I created a "mini" Zen Cart "external sideboxes only" stylesheet. This "mini" stylesheet contains only the declarations I needed to style the externally called sideboxes to match the ones in the store.
I also created the "external sideboxes only" stylesheet so that I could use CSS to hide the Zen Cart sidebox titles of my externally called sideboxes without affecting the rest of the Zen Cart shop.
That's it really..
I got it working with more than one sidebox. (It's been reported on this support thread that this was not possible - i wanted to confirm that I had no issue getting more than one sidebox to display using the Sideboxes Anywhere add-on)
I have not tested this with the shopping cart or login sideboxes yet. However, I am fairly certain that cookies and session settings may render some fairly gnarly results with these two particular sideboxes.. I will be testing this over the weekend, and report back my findings.
Once I finish testing, I'll post a link to the site I am working on so folks can see my end result.. :) (FYI, I'm using iframes to display my externally called sideboxes for a variety of reasons...) Wanted to post this to pass on the information to others..
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.
VERY IMPORTANT NOTE: your parenthetical last-minute comment about using iframes is VERY important when coupled with your suggestion of embedding yet another DOCTYPE and opening <HTML> tag on the page. In fact, INSIDE A FRAME is the ONLY time you should do that.
So, if you're not using frames (and they're generally not something one would use, for a myriad of reasons), then YOU SHOULD NOT use the added HTML suggested above.
.
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.
Thanks DrByte.. My apologies.. I should have been MUCH clearer in my post (it was a copy and paste from another forum where the context of my writing would have been clearer -- I should have cleaned it up a bit more before posting it here raw/uncut)..
Yes, the reason I had to do this at all was because the sidebox is being called from inside an iframe. This all started because I was trying to get the sideboxes to look like the rest of the site and the store. Initially based on the an older post in this thread I added the following to the very bottom of the single_sidebox.php file (*after* the closing ?> line).
But that didn't work.. So based on a suggestion from someone who had helped someone else to get an iframed external sidebox to work, I added this to the top of the single_sidebox.php file (*before* the opening <php line).You may have to even make that an entire URL:Code:<style type="text/css"> @import "/includes/templates/MY_TEMPLATE/css/stylesheet.css"; </style>Code:<style type="text/css"> @import "http://yourdomain.com/includes/templates/MY_TEMPLATE/css/stylesheet.css"; </style>
That worked, but I was concerned that the sidebox "pages" wouldn't validate. So I went to http://validator.w3.org/ to validate the sidebox page, and used the "HTML-Tidy" tool to get the "clean" HTML I previously posted.Code:<head> <link rel="stylesheet" type="text/css" href="http://yourdomain.com/includes/templates/MY_TEMPLATE/css/sidebox_stylesheet.css" /> <title></title> </head>
To further clarify my previous statements, I'm truly not advocating the use (or rather overuse) of iframes at all for all the reasons most often cited (accessibility, page loading times, SEO, etc). However, for this particular site, the use of an iframe was the ONLY way I could get the externally called sideboxes to show/behave.
In this case I believe this limited use of an iframe will probably be okay.. I am using a notice of external content for screenreaders to resolve any accessibility issues, there are no serious SEO concerns from displaying 1 or 2 sideboxes, and I do not plan to load more than two iframed sideboxes to ensure that I don't create any performance issues.
All this to say that I'm still testing this implementation and as of this writing I am cautiously optimistic that they will not be problematic down the road. I will of course update my findings if this turns out to NOT be the case..
Again, my apologies for not being clearer in my earlier post..Dr Byte is absolutely correct. The information I shared yesterday is only to be used if the sideboxes are called from inside an iframe..
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.
and she's back..
DOH!
The fact that the iframe worked when my include statement didn't should have given me a HINT on how to get this to work WITHOUT using an iframe..
My original include statement looked like this:
I changed my include statement to the following:Code:<?php include '/home2/mysite/public_html/shop/zencart-sidebox-categories.php'; ?>
and BAM!!! It worked!!! No need for an iframe at all..Code:<?php include 'http://shop.mysite.com/zencart-sidebox-categories.php'; ?>
I kept the link to my sidebox stylesheet in my single_sidebox.php file.. However now that I am not using an iframe to call my sideboxes, can anyone (DrByte??) confirm if I need to include any HTML other than the CSS link to my sidebox stylesheet in my single_sidebox.php file?? In other words will I have validation/other issues if the only thing I add to my single_sidebox.php file is this:
Code:<head> <link rel="stylesheet" type="text/css" href="http://shop.mysite.com/includes/templates/MY_TEMPLATE/css/sidebox_stylesheet.css" /> </head>
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.