Hi

Has anyone managed to embed Zazzle.com shop content on a Drupal site?
I'm looking for a way to have articles from my Zazzle.com shop on my site, but dont quite know how to achieve this.
Zazzle offers the "Zazzle Store Builder" with which you can create a web page showing store products.
It basically consists of the following components:
The main folder with the files I have placed in the site root folder.
In the zazzlestore folder:
* c folder (empty)
* css folder (contains zstore.css, the Cascading Style Sheet for your Zazzle Store Builder)
* include folder (contains the main Zazzle Store Builder files, including configuration.php, which you must edit)

& sample pages such as the one below where the shop content is shown.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>Zazzle Store Builder: Sample page with full grids</title>
  	<link id="ext_css" rel="stylesheet" type="text/css" href="/zazzlestore/css/zstore.css"/>
</head>
<body>
<h1 class="sampleTitle">Sample page with full grids (all display options enabled)</h1>

<?php

// configure Zazzle Store Builder display
include "/zazzlestore/include/zstore.php";
 
?>
</body>
</html>

In the form above as a separate page outside Drupal, I get the products shown.

My problem is not knowing how to embed it in a Drupal page.
Exactly what contents above do I embed and where do I place the CSS file?

I have tried different variations but only get errors.

Thanks in advance

Comments

vm’s picture

are you using the php input format provided by the core php filter.module?

lionheart8’s picture

Hi,
yes I am :)

vm’s picture

And adding the body tag and html tag? if so they aren't required. have you tried viewing the source of the non rendered page to see if anything at all is bring printed?

lionheart8’s picture

Hi
This is all I'm adding on the page:

<?php

// configure Zazzle Store Builder display
include "/zstore/include/zstore.php";
 
?>

This what I get with nothing else printed:

    * warning: include(/zstore/include/zstore.php) [function.include]: failed to open stream: No such file or directory in /home/habaris1/public_html/rootfolder/includes/common.inc(1685) : eval()'d code on line 4.
    * warning: include() [function.include]: Failed opening '/zstore/include/zstore.php' for inclusion (include_path='.:/usr/lib/php') in /home/habaris1/public_html/rootfolder/includes/common.inc(1685) : eval()'d code on line 4.

Not sure where to add the css file.
No idea why it cannot open those files.

lionheart8’s picture

Could someone please help??

vm’s picture

<?php

// configure Zazzle Store Builder display
include "./zstore/include/zstore.php";

?>

note the . in front of the trailing front /

found using google search with a hit on http://drupal.org/node/80709#comment-157812

lionheart8’s picture

Great! That did the trick. :)

The content now gets printed.
I need to read more about that magical dot at the reference you gave.

Lots of thanks!

vm’s picture

tells the include to look for your file on level up from where you were. you were likely still at the node level rather than root folder level where drupal couldn't locate the file because it couldn't find the folder the file resides in.

Drupal doesn't have a node folder, just like it has no admin folder. Thats .htaccess magic going on there.

lionheart8’s picture

Hi there

I know this is a quite old thread, but may be be i will get some response. For introduction, please look at first post above, regarding the structure/role of "zstore" & its contents.

As mentioned above, I managed to have content displayed, but the only problem being Drupal ignoring the formatting, probably because of a problem communicating with the css & other code in "/zstore" folder and showing items in one loooong column, instead of 5 columns x 20 rows, etc.

That was with Drupal 6.

With Drupal 7, if the code suggested by VM is used (

<?php

// configure Zazzle Store Builder display
include "./zstore/include/zstore.php";

?>

), the items are displayed BUT above them, a very ugly long list of such error messages I do not remember in Drupal 6 appears:

Notice: Undefined index: clean_cache in include() (line 109 of /home1/que1/public_html/orb/zstore/include/zstore.php).
Notice: Undefined variable: gridNumber in include() (line 116 of /home1/que1/public_html/orb/zstore/include/zstore.php).
Notice: Undefined variable: currentSort in include() (line 192 of /home1/que1/public_html/orb/zstore/include/zstore.php).
Notice: Undefined variable: currentSort in include() (line 196 of /home1/que1/public_html/orb/zstore/include/zstore.php).
Notice: Undefined index: gridPage in include() (line 209 of /home1/que1/public_html/orb/zstore/include/zstore.php).
...
...
...

What in Drupal 7 makes it generate those errors, that Drupal 6 didn't and how can I avoid them?

This is in part of the code in /zstore/includes/zstore.php

// import our external class libraries
require_once 'cacheMgr.php';
require_once 'lastRSS.php';
require_once 'configuration.php';
require_once 'strings.php';

Also, whereas the items are shown, the formatting I suppose determined by /zstore/css/zstore.css is ignored so we have something like here instead of this using exactly the same code in a non-Drupal php/Smarty site.

Thank you in advance

vm’s picture

the issue doesn't look to have anything to do with Drupal. The code in the files you are including are having issues with the version of PHP on the server. My guess is that the version of PHP with the D6 site was older than the version of PHP you are using with the D7 site.

lionheart8’s picture

Thank you for the response.
Actually, I upgraded my hosting account's php version to 5.3.14 from a version of 5.2. a couple of weeks back.
So you mean downgrading back to 5.2 would help get rid of the error messages??

On the other hand, in the past, even without the error messages, the items were shown in a long column - unlike on a non-Drupal php site were the formatting using the scripts css & other stuff is not ignored. Something in Drupal seems to "act" against this.

Thank you & kind regards

vm’s picture

downgrading or rewriting the code (in the files being included) to satisfy the changes in PHP 5.3 will correct the errors.

without seeing the output of the included files it's difficult to know what the issue is or how to correct it. When the included file is called into the browser if it's not calling in it's CSS file and such then it's likley best to use the script in a module which you can inject into drupal head tag.