Zen Cart Logo
Forums / General Questions / Help Query - How can I clone a Cart to have a different set of items?

Help Query - How can I clone a Cart to have a different set of items?

Views: 1,239

Results 1 to 13 of 13
19 Dec 2011, 4:34 AM
#1
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Help Query - How can I clone a Cart to have a different set of items?

I have responsibility for a site with a working ZEN CART which I have been supporting for a few years. Although I did not do the initial install and configuration of the software nor creation of the initial set of items, I have not had any problem with adding new items and removing old ones.

Recently I have been thrown a curve ball by a request to create a new batches of items which are to be isolated from the current set of items.

I assume that the simplest method of doing this is to clone my current zencart directory, create a new MySQL Database, populate it from my current one via an export and import run, and then open the new database and hide the original items and create the new ones (like I have been doing all along).

If this is the correct method, what I need help with is some hand holding on what I need to change/update in the cloned directory to point at the new database in lieu of the current one.

OTOH, if there is a way to use the current database and somehow when I access it automatically select which set of items are to be displayed, then I would like instructions on how to do that.

I lean towards the separate database method since it is looking like I am going to end up with 4 sets of items. Thus I want to have a solution where depending on which link I use to access the cart I get only the correct set of items.

Thank You for any assistance I can be provided to achieve this goal.

19 Dec 2011, 11:03 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help Query - How can I clone a Cart to have a different set of items?

rarpsl:

Recently I have been thrown a curve ball by a request to create a new batches of items which are to be isolated from the current set of items.

I don't know exactly what that means. You want a separate store with different products, but with the same customers, etc ?

You might look in the Free Software Add Ons for the Multisite mod - I haven't used it.

19 Dec 2011, 9:46 PM
#3
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Re: Help Query - How can I clone a Cart to have a different set of items?

stevesh:

I don't know exactly what that means. You want a separate store with different products, but with the same customers, etc ?

You might look in the Free Software Add Ons for the Multisite mod - I haven't used it.

Basically yes. This is for a convention. Right now we have one cart for memberships at the convention. What I have been asked to do is set up a separate cart to sell tables in our dealers room to the dealers and a 3rd cart to sell display space in our art show to the artists. Thus we need to display different items depending on who we are selling to (ie: Dealers, Artists, or Attendees).

I will look into your mod to see if it meets my needs. I was looking at a short cut so I do not need to establish the initial carts from scratch. I just need to know which files I need to edit in the cloned ZenCart directory to point at the new database (which I will then add the new items to while removing the Membership items). While I can live with one database I do not think there is a way to select which items are to be displayed based on who we are selling to - Thus the idea of having multiple databases.

19 Dec 2011, 9:56 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help Query - How can I clone a Cart to have a different set of items?

Who decided that you/they needed separate carts for the three functions? I know other festivals where admission tickets and artists or dealers use separate categories (and separate paths to get to them) on one main website. See my festival site for an example.
All you really need to do is create separate portal pages (ez-pages can work well) for the different destinations. You would not use one overall categories menu, but link directly to the relevant categories.

12 Jan 2012, 3:45 AM
#5
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Re: Help Query - How can I clone a Cart to have a different set of items?

gjh42:

Who decided that you/they needed separate carts for the three functions? I know other festivals where admission tickets and artists or dealers use separate categories (and separate paths to get to them) on one main website. See my festival site for an example.
All you really need to do is create separate portal pages (ez-pages can work well) for the different destinations. You would not use one overall categories menu, but link directly to the relevant categories.

This sounds much simpler. I have created a 2nd category for my dealer's room and added one item to test with. Right now when I go to my convention registration cart it goes to that category and lists the two items in it (Children and Adult). The URL is a pointer to the zencart directory. How do I set up the pointer to point at my dealer's room category as you suggest? Once I do that I can create the 2 needed categories and populate them and supply separate URLs for each category (as well as setting up the Registration URL in the same way).

12 Jan 2012, 4:17 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help Query - How can I clone a Cart to have a different set of items?

What is the category id of your dealers room? You can just put that in the URL in place of the existing category id to get the proper link.
I would have to see how you have these links set up to advise on the best way to add new links.

12 Jan 2012, 9:05 AM
#7
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Re: Help Query - How can I clone a Cart to have a different set of items?

gjh42:

What is the category id of your dealers room? You can just put that in the URL in place of the existing category id to get the proper link.
I would have to see how you have these links set up to advise on the best way to add new links.

The URL to get the current Registration Category items is http://www.lunacon.org/zencart/. This is a redirect from http://registration.lunacon.org/ (either works).

This is category 65. I have a second set of items as category 66 for dealers. I also have an empty 67 which will be Art Show.

Note that there is no parm being passed and it seems to default to cat 65 automatically.

12 Jan 2012, 2:53 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help Query - How can I clone a Cart to have a different set of items?

It's category 66 which is displaying: id="cat66Table".
What do you have for admin > Configuration > Layout Settings > Categories - Always show on homepage and Main Page Opens with category?
You can get to the other categories by specifying their URL: lunacon.org/zencart/index.php?main_page=index&cPath=67 goes to the Dealers category listing.

12 Jan 2012, 3:18 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help Query - How can I clone a Cart to have a different set of items?

I presume you will want the dealers cart link from the Dealers Room page, and the art show cart link from the Art Show page?

When you go to any of those categories, there will be no way to get to the others without actually entering the URL in the address bar; this should be good for your purpose.

BTW, I noticed some invalid HTML (broken code) ```

<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper"> <tr> <td id="navColumnOne" class="columnLeft" style="width: 150px"> <div id="navColumnOneWrapper" <style="width: 150px"></div></td> <td <!-- bof upload alerts --> <!-- eof upload alerts -->

Actually, this
<div id="navColumnOneWrapper" <style="width: 150px">
is supposed to be one div tag. Somebody inserted a < before the style attribute.
<div id="navColumnOneWrapper" style="width: 150px">
12 Jan 2012, 5:51 PM
#10
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Re: Help Query - How can I clone a Cart to have a different set of items?

gjh42:

It's category 66 which is displaying: id="cat66Table".
What do you have for admin > Configuration > Layout Settings > Categories - Always show on homepage and Main Page Opens with category?
You can get to the other categories by specifying their URL: lunacon.org/zencart/index.php?main_page=index&cPath=67 goes to the Dealers category listing.

Thank You.

That was EXACTLY what I needed. :clap:

I will add the index.php?... to the URL for each of the three links to the respective Zen Carts and that will get me to the respective carts pages.

Since the Main Page Opens setting was 66, I was always going there and the person who originally installed the site (and who I assumed responsibility from) had the link default to that category via the setting instead of having the parms in the URL. That was what I needed to know (ie: Need to supply the index.php with parms,

THANK YOU for the hand holding and I should be able to handle the rest by myself.

12 Jan 2012, 5:53 PM
#11
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Re: Help Query - How can I clone a Cart to have a different set of items?

gjh42:

I presume you will want the dealers cart link from the Dealers Room page, and the art show cart link from the Art Show page?

When you go to any of those categories, there will be no way to get to the others without actually entering the URL in the address bar; this should be good for your purpose.

BTW, I noticed some invalid HTML (broken code) ```

<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper"> <tr> <td id="navColumnOne" class="columnLeft" style="width: 150px"> <div id="navColumnOneWrapper" <style="width: 150px"></div></td> <td <!-- bof upload alerts --> <!-- eof upload alerts -->
> 
> Actually, this
> <div id="navColumnOneWrapper" <style="width: 150px">
> is supposed to be one div tag. Somebody inserted a < before the style attribute.
> <div id="navColumnOneWrapper" style="width: 150px">

Thanks for pointing out the coding error. I will look at the two scripts and fix it.
12 Jan 2012, 5:56 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help Query - How can I clone a Cart to have a different set of items?

You don't actually need to change those admin settings or the existing link to member registration. The new direct page links will work fine with the existing settings left as is, and not having the parameters in the URL for the one link is nice (though not really important).

Though if it matters, with the existing settings, the dealers and art show categories will have the home link that goes to the member registration page. This might actually be desirable, as dealers etc. need to be members as well.

12 Jan 2012, 8:11 PM
#13
rarpsl avatar

rarpsl

New Zenner

Join Date:
Feb 2011
Posts:
26
Plugin Contributions:
0

Re: Help Query - How can I clone a Cart to have a different set of items?

gjh42:

You don't actually need to change those admin settings or the existing link to member registration. The new direct page links will work fine with the existing settings left as is, and not having the parameters in the URL for the one link is nice (though not really important).

Though if it matters, with the existing settings, the dealers and art show categories will have the home link that goes to the member registration page. This might actually be desirable, as dealers etc. need to be members as well.

I did not plan to update the admin settings since, as you noted, just using the extended URL works.

Since I am going to do this for the other two carts, I might as well add it to registration also to be consistent. The actual request for that page is done via sub-domain call (which under the covers maps back to the zencart directory). The location bar shows the sub-domain address not the main domain with the zencart directory.

As to registration, each of the two extra categories will have a registration item so that I can use the comment box to remind them that a registration is required (at least for Dealers and their staff - Artists are optional since they can mail in their art for display but not attend).