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

YOU ARE HERE:
Seperate Stores at Multiple Domains...Need Help

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Seperate Stores at Multiple Domains...Need Help »
Welcome, Guest. Please Login or Register.
12/14/17 at 08:24:43
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   Seperate Stores at Multiple Domains...Need Help
(Moderator: Marty)
Pages: 1 2 » Reply Notify of replies Send the topic Print 
   Author  Topic: Seperate Stores at Multiple Domains...Need Help  (Read 2463 times)
Skool
White Dragon
**

Posts: 11



Rock on with yo' bad self!
   

WWW E-Mail
Seperate Stores at Multiple Domains...Need Help
« on: 05/21/02 at 12:48:12 »
Reply with quote Modify message

Quick question, I have a bunch of domains/websites on my server and I want to add a particular Cafe Press store to each one...  Does anyone know off-hand how to do this?  I only have one cgi-bin directory, and in following the installation instructions, it says place the scripts in there.  Now, I already have one of my sites stores up and running.  Can I just create another directory ([first store] /store/cpshop.cgi; [second store] /joesstore/cpshop.cgi) and copy the script into that directory?  Does this make sense?  I will need an admin screen for the second website... Any thoughts on this?  Thanks much!

Skool
www.scorchboards.com/store.html
Logged

Scorchboards.Com
A message board site of young celebrities and up & coming young actors! News, Galleries, Online Store and more! A site for the young and the young at heart...
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Separate Stores at Multiple Domains...Need Hel
« Reply #1 on: 05/21/02 at 16:07:18 »
Reply with quote Modify message

cpshop supports multiple stores with the same set of scripts.  Each store simply has its own copies of cpshop.cgi and cpshop.cgi.config.

For example, if you wanted to have 3 separate stores, you might have these files in your cpshop directory:

  • cpadmin.cgi
  • cpdata.lib
  • cplogin.lib (in the new version I'll be sending out soon)
  • cppage.lib
  • cpshop_cats.cgi
  • cpshop_cats.cgi.config
  • cpshop_dogs.cgi
  • cpshop_dogs.cgi.config
  • cpshop_fish.cgi
  • cpshop_fish.cgi.config

To use cpadmin.cgi, just refer to the correct store.  For example, to reference the "cats" store, you'd go to:

.../cpadmin.cgi/cpshop_cats.cgi

(For those of you who have had to set the "Use Clean Store URLs" setting to "use query string" due to server issues, I haven't forgotten you. The new version of cpshop will have a fix for your problem as well: you'll upload a new cpadmin.cgi file for each copy of cpshop.cgi.)
« Last Edit: 05/21/02 at 16:16:30 by Marty » Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Skool
White Dragon
**

Posts: 11



Rock on with yo' bad self!
   

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #2 on: 05/21/02 at 17:19:53 »
Reply with quote Modify message

Thanks Marty!  That does it I think...

Skool
Logged

Scorchboards.Com
A message board site of young celebrities and up & coming young actors! News, Galleries, Online Store and more! A site for the young and the young at heart...
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #3 on: 06/07/02 at 06:23:01 »
Reply with quote Modify message

Hey Gang!

With multiple stores, I want to have them in sub groups. Can I accomplish that with multiple cpshop.cgi's in different folders in the cgi-bin?

What does that do the breadcrumbs?

Is there a way to include images in the page that cpshop.cgi generates with all of the names from the site id's section of cbadmin?

[link]http://www.eshirtlabs.com[/link]
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Separate Stores at Multiple Domains...Need Hel
« Reply #4 on: 06/07/02 at 08:48:07 »
Reply with quote Modify message

I'm not exactly sure what you're asking, but I'll try to answer anyway.



With multiple stores, I want to have them in sub groups. Can I accomplish that with multiple cpshop.cgi's in different folders in the cgi-bin?

You can, although it's easier to put all the cpshop.cgi's in the same folder, and just rename them (like in the answer above).  You can rename them more appropriately of course, like catstore.cgi, dogstore.cgi, etc.

Otherwise you'll have to perform a separate installation in each sub-folder.

Are you trying to say you want to have a Yahoo-style multi-level directory of stores?  If that's the case, cpshop isn't explicitly programmed to handle that sort of thing.  But yes, you could setup a three-tier directory this way:

  • setup a main page with links to various cpshop.cgi files
  • create a new instance of cpshop.cgi for each sub-category (i.e. tech.cgi, women.cgi, animals.cgi, etc.)
  • set the main page as the homepage in each copy of cpshop.cgi
  • place appropriate store IDs in with each copy of cpshop.cgi
That would produce your breadcrumb trail back to the main directory page.

The other way to accomplish it would be to follow the instructions as above, but then to complete customize the output in each copy of cpshop.cgi (perhaps with a "require" command to another perl script).  Then you could have a directory with as many tiers as you wanted.  Of course, you'd have to hack it together yourself.



What does that do the breadcrumbs?

Nothing.  Each instance of cpshop.cgi is individual and unrelated.



Is there a way to include images in the page that cpshop.cgi generates with all of the names from the site id's section of cpadmin?

What page?  The homepage?  A separate page entirely?  The product thumbnail page?

If you're referring to the homepage, you'd just put the code for the images in the Name section for each store ID (on the admin screen).  Be sure to include the text name of the store in HTML comment tags in with your code.

Code:
<img src="/images/store/mystore.gif" height=80 width=400 alt="Store Name" border=0><!--Store Name-->


If you're referring to using one template with different store IDs (for, say, the thumbnail and product pages), then you'd use the <[storeid]> template tag in your template:

Code:
<img src="/images/store/<[storeid]>.gif" height=80 width=400 alt="<[title]>">




Let me know if this is what you're looking for, or if you're looking for something totally different.
« Last Edit: 06/07/02 at 08:56:14 by Marty » Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #5 on: 06/07/02 at 13:53:41 »
Reply with quote Modify message

Ok, sorry for the confusion. I think I was a little punchy when I wrote it.

Here is what I am shooting for.

Breadcrumbs

Home>Catagory>Shirt Name>Shirt Type

Emample:

Lab>Soccer>USA Soccer>White T-Shirt

I want buttons that can go to the catagory. I've got them set up. I'm just looking for the best way to do it.

Does that make better sense? I hope?

Lab Tech - "The Happy Chair Dancer"
Logged
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #6 on: 06/07/02 at 15:55:25 »
Reply with quote Modify message

Another question.

I am setting up a links page to keep track of all my links to my stuff for this site.

It is just going to reside on my machine.

Can I link a button to cpadmin that will include the password and go straight to it?
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #7 on: 06/08/02 at 02:33:35 »
Reply with quote Modify message

Well, you are ambitious, aren't you?  

Anyway, I think I've got it.  You do want to add the extra tier of categories, and have it reflected in the breadcrumb.

There are several ways to accomplish something like that with cpshop.  (One of the advantages -- or curses? -- of being flexible.)

The least-technical way is probably to have multiple instances of cpshop.cgi.  This is pretty easy; just set it up with one copy of cpshop.cgi the way you want it, and then copy it (and its corresponding .config file) to make new categories, renaming the files accordingly.

The downside is that changes have to be made to all the installations, not just the one.

Another (more technical) way would be to create a special thumbnail page template and a special product info page template, incorporating your breadcrumb system.  Then, with a custom homepage, and a tiny bit of hacking at cpshop.cgi, you could have your special categorized breadcrumb trail, and only one installation.

The next update will have two new template tags, <[storename]> and <[productname]>.  You could use them to make your breadcrumb trail by hand.

Here's what I mean:

  • Create a homepage that includes your list of categories, linking each one to its special category page.
  • On each special category page, link to the appropriate stores in cpshop.
  • Create a thumbnail page template and a product page template with a special handcoded breadcrumb trail, using templates tags (<[storeid]>, <[storename]>, <[productnumber]>, <[productname]>) and two currently nonexistant tags, <[catid]> and <[catname]>
  • Add some code to cpshop.cgi to parse the special tags.  Typically this would include creating an associative array of store IDs to category IDs, and then category IDs to category names.  Something like this would do it:

    Code:
    %CATID_NAMES = (
      "at"     => "Attitude",
      "spsc"   => "Soccer",
      "spfb"   => "Football",
      "gm"     => "Gamers",
    );
    %STOREID_CATS = (
      "esl_spsc_002"  => "spsc",
      "esl_spff_001"  => "spfb",
      "esl_gm_002"    => "gm",
    );
    $html =~ s/<\[catname\]>/$CATID_NAMES{$STOREID_CATS{$storeid]/g;
    $html =~ s/<\[catid\]>/$STOREID_CATS{$storeid}/g;

    That could turn this:

    Code:
    <a href="/">eShirtLabs.com</a> &gt;
    <a href="/stores/<[catid]>"><[catname]></a> &gt;
    <a href="/cgi-bin/stores/cpshop.cgi/<[storeid]>"><[storename]
    > &gt;
    <[productname]>

    into this:

    Code:
    eShirtLabs.com > Soccer > USA Soccer > Tank Top


I'd go with the second option, but, of course, it's my program.

As for your login button question, try a link like this:

http://www.eshirtlabs.com/cgi-bin/stores/cpadmin.cgi/cpshop_spsc.cgi?password=my
password
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #8 on: 06/08/02 at 04:11:05 »
Reply with quote Modify message

What the heck.

In for a penny, in for a pound.

I'll try door #2 Monty...

Ooops Marty.


I'll get back to you on the results.

Thank You, Thank You, Thank You, Thank You Marty!
Logged
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #9 on: 06/08/02 at 13:42:05 »
Reply with quote Modify message

If I do it this way, will I have to code each store that I add in the future?

Can I still use Admin?
Logged
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #10 on: 06/08/02 at 14:12:33 »
Reply with quote Modify message

Am I still going to be able to use admin to ad new stores to the cpshop.cgi or am I going to have to hack it each time?

Maybe a work around might be to ad a link to the Store name in Admin?
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #11 on: 06/08/02 at 23:52:42 »
Reply with quote Modify message

You would both add the store through the admin screen, and add it to the list in cpshop.cgi.

It is possible, of course, to put together a more advanced workaround.  For example, you might use the description as a place to hide codes.

Say if for esl_spsc_002 you put this in the description box:

Code:
(Soccer|spsc) A blah blah blah soccer design, etc...


If you did that for every store, you could use code like this:

Code:
$DESC{$storeid} =~ m/^\(([^\|]+)\|([^\)]+)\)/;
$catname = $1;
$catid   = $2;
$html =~ s/<\[catname\]>/$catname/g;
$html =~ s/<\[catid\]>/$catid/g;

If you were to use this sort of setup, you wouldn't have to touch cpshop.cgi again, and you could just do everything through the admin panel.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #12 on: 06/10/02 at 21:34:41 »
Reply with quote Modify message

So, if I do it like in reply #11, I don't need the code in reply #7?
Logged
Lab_Tech
Green Dragon
*

Gender: male
Posts: 9



Go Scots!
    grfxjams

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #13 on: 06/10/02 at 21:50:40 »
Reply with quote Modify message

and... Where does it go? lol
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Seperate Stores at Multiple Domains...Need Hel
« Reply #14 on: 06/11/02 at 02:20:21 »
Reply with quote Modify message

So, if I do it like in reply #11, I don't need the code in reply #7?

Exactly.  Please notice that the code above was displaying incorrectly before, and has now been corrected.

and... Where does it go? lol

It goes in cpshop.cgi, like this:

Code:
} else {
   &gettemplate;
   $html =~ s/<\[title\]>/$pagetitle/g;
   $html =~ s/<\[breadcrumb\]>/$breadcrumb/g;
   $html =~ s/<\[content\]>/$content/;

   $DESC{$storeid} =~ m/^\(([^\|]+)\|([^\)]+)\)/;
   $catname = $1;
   $catid   = $2;
   $html =~ s/<\[catname\]>/$catname/g;
   $html =~ s/<\[catid\]>/$catid/g;

   print "Content-Type: text/html\n\n";
   print $html;
   exit;
}

Keep in mind that you will need the next version of cpshop to use the productname and storename template tags.  Or you can add these lines above the Content-Type line:

Code:
   $html =~ s/<\[productname\]>/$productname/g;
   $html =~ s/<\[storename\]>/$TITLE{$storeid}/g;
« Last Edit: 06/11/02 at 02:38:38 by Marty » Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Pages: 1 2 » 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.