marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
Using CPSHOP info on other site pages.

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Using CPSHOP info on other site pages. »
Welcome, Guest. Please Login or Register.
12/13/17 at 17:04:25
Home Help Search Login Register
   marty.net message board
   About cpshop
   Tutorials
   Using CPSHOP info on other site pages.
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: Using CPSHOP info on other site pages.  (Read 2222 times)
Scottoons
Gold Dragon
****

Gender: male
Posts: 64



I do not Math; therefor, I Art!
   

WWW E-Mail
Using CPSHOP info on other site pages.
« on: 05/09/06 at 20:02:08 »
Reply with quote Modify message

I have a dream....

I'd like to show my newest products from my cpshop on the homepage of my web site -- outside of cpshop.

I've set up a cpfilter to grab the newest products. Is there an accessible variable that I can use to output the filtered results?

Thanks,
Scott
Logged

Scott Sauer: Cartoon Artist
www.Scottoons.com
Scottoons
Gold Dragon
****

Gender: male
Posts: 64



I do not Math; therefor, I Art!
   

WWW E-Mail
Re: Using CPSHOP info on other site pages.
« Reply #1 on: 05/12/06 at 18:30:03 »
Reply with quote Modify message

In a round about way, I have turned my dream into reality.

I'll explain what I did in hopes it may help others.


I'll type out the cpshop code and just explain the programming I've done so that others can do something similar using PHP or other server side languages (I use ColdFusion).


My goal was to feature my three most recent products on the front page of my web site; which is not in cpshop and has other content.

In cpshop I made a new Store ID. I gave it the alias of "newest" and applied the following:

Code:
*,cpfilter_newest:3,cpfilter_sort:new2old,cpfilter_template:http://www.scottoons.com/store/blankTemplate.cfm


* uses the first wildcard I created (which is simply Scottoons/all) so all my items will be looked through to find the most recently added items.

cpfilter_newest:3 grabs the 3 most recently added products.

cpfilter_sort:new2old does exactly what it says: puts the found items in order from newest to oldest.

cpfilter_template:http://www.scottoons.com/store/blankTemplate.cfm tells cpshop to display the filter results using a custom template called blankTemplate.cfm (or in your case .php or .htm). It is a very complicated template. Are you ready? The template has one line (well not even that) of code:


Code:
<[content]>


Yep, that's it. I just want to output the filter results without any extra code around it.

After I empty the cpshop cache and save all pages, I have a page that I can visit that will return just the last three products in order of newest in front.

Here's what mine looks like: http://www.scottoons.com/store/cpshop.cgi/newest

Pretty plain. But that's okay because I'm not going to link to that page.

WARNING: This is where things get a little bit trickier and a whole lot nerdier.

On my home page, using a server scripting language (ColdFusion in my case) I wrote some code that grabs content from a URL (http://www.scottoons.com/store/cpshop.cgi/newest).
That content gets stored in a variable.

I parse that variable to either find and remove or find and replace code. In my case I remove the cafepress generated table HTML tags and replace them with DIV tags, add CSS style classes, and even resize the images.

Then I output the variable contents to the page in a format that I prefer.

That's how I display my newest cafepress/cpshop creations on my home page (http://www.scottoons.com), outside of cpshop.

Happy Customizing!
Logged

Scott Sauer: Cartoon Artist
www.Scottoons.com
Scottoons
Gold Dragon
****

Gender: male
Posts: 64



I do not Math; therefor, I Art!
   

WWW E-Mail
Re: Using CPSHOP info on other site pages.
« Reply #2 on: 05/19/06 at 18:38:12 »
Reply with quote Modify message

Here's a discussion on how to grab page content using PHP...

http://www.php.net/manual/en/function.fopen.php
Logged

Scott Sauer: Cartoon Artist
www.Scottoons.com
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright 2000-2001, X-Null. All Rights Reserved.