Zen Cart Logo

Simple ZC gallery

Locked

Views: 5,316

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
9 Aug 2007, 6:08 AM
#1
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Simple ZC gallery

Here is simple one line way to make a gallery of sold products.

create a file: includes/local/configure.php

and add this one line to it:

<?php if ($_GET['cPath']==12){define('STORE_STATUS',1);} ?>

Be sure to replace the "12" with the category ID of the category that is to be just for your sold products.

Now products viewed in that category will switch the store to showcase mode.

An example/demo is here: http://www.montanapens.com

It's not perfect, but it does solve problem for simple site with one of a kind items.

Move sold products to your "gallery" category.

9 Aug 2007, 6:42 AM
#2
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Simple ZC gallery

kiddo:

Here is simple one line way to make a gallery of sold products.

create a file: includes/local/configure.php

and add this one line to it:

<?php if ($_GET['cPath']==12){define('STORE_STATUS',1);} ?>

Be sure to replace the "12" with the category ID of the category that is to be just for your sold products.

Now products viewed in that category will switch the store to showcase mode.

An example/demo is here: http://www.montanapens.com

It's not perfect, but it does solve problem for simple site with one of a kind items.

Move sold products to your "gallery" category.
Followed instructions above, including altering categoryID to suit...
Not working.. product still shows sold out image..not in showcase mode..

9 Aug 2007, 7:00 AM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Simple ZC gallery

This missing piece of information here is how that new configure file gets invoked. However, that can be side-stepped by simply adding the new line to your existing includes/configure.php. It's a neat idea with very wide applications.

9 Aug 2007, 8:17 AM
#4
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Simple ZC gallery

:clap:
Works.. redid my /includes/local/configure.php file as

<?php
if ($_GET['cPath']==67){define('STORE_STATUS',1);}
?>

Kuroi, it works because in /includes/application_top.php
is the following code

 * Set the local configuration parameters - mainly for developers
 */
if (file_exists('includes/local/configure.php')) {
  /**
   * load any local(user created) configure file.
   */
  include('includes/local/configure.php');
}
/**

Thank you Kiddo...

9 Aug 2007, 8:48 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Simple ZC gallery

misty:

Kuroi, it works because in /includes/application_top.php
is the following code

  • Set the local configuration parameters - mainly for developers
    /
    if (file_exists('includes/local/configure.php')) {
    /
    *
    • load any local(user created) configure file.
      /
      include('includes/local/configure.php');
      }
      /
      *
19 Aug 2007, 9:22 PM
#6
styledata avatar

styledata

Zen Follower

Join Date:
Feb 2006
Posts:
290
Plugin Contributions:
0

Re: Simple ZC gallery

I'm trying to get this to work... I did not have a "includes/local" directory, so I created one and added a configure.php file with the following contents:

<?php if ($_GET['cPath']==42){define('STORE_STATUS',1);} ?>

42 is the number of the category I created to showcase. Then I created a product in this category. It shows in the category but as an item for sale.
Did I miss something?
Thank you!

edit... got to wondering if it was supposed to be in the admin/includes/local, so I put the same file there, too. Still showing as for sale.

20 Aug 2007, 8:16 AM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Simple ZC gallery

That's because this approach reads the category from the URL. However, you are using a URL re-writing mod and so the cPath c=variable isn't there.

You can still use this approach, but you will need to amend the condition to use what you actually have in your URL for this category.

20 Aug 2007, 1:41 PM
#8
styledata avatar

styledata

Zen Follower

Join Date:
Feb 2006
Posts:
290
Plugin Contributions:
0

Re: Simple ZC gallery

kuroi:

That's because this approach reads the category from the URL. However, you are using a URL re-writing mod and so the cPath c=variable isn't there.

You can still use this approach, but you will need to amend the condition to use what you actually have in your URL for this category.

I understand what you are saying, but don't have a clue how to amend the path. If, for example, the below is the URL to the category I wish to use, can you tell me how to amend the condition?
Thank you,

http://www.photoimprints.com/gallery-c-42.html

9 Oct 2007, 8:33 PM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Simple ZC gallery

I like this.. However, if I wanted to remove all of the shopping cart buttons and only leave the "Next" and "Previous" nav buttons, how would I do that?

I would like to give this a stab, but I want to make sure that I understand what it is I am doing.. I would modify my includes/configure.php file correct.. Is this what it should look like??

<?php
/**
 *
 * @package Configuration Settings
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */


/*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/

// Define the webserver and path parameters
  // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
  // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
  define('HTTP_SERVER', 'http://mydomain.com');
  define('HTTPS_SERVER', 'https://mydomain.com');

  // Use secure webserver for checkout procedure?
  define('ENABLE_SSL', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
  define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

  define('DIR_WS_PHPBB', '/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_CATALOG', '/home/content/m/a/n/maneattractions/html/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
  define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'XXXXX.XXXXXX.net');
  define('DB_SERVER_USERNAME', 'XXXXXXX');
  define('DB_SERVER_PASSWORD', '*******');
  define('DB_DATABASE', 'XXXXXXXX');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'none'); 
  define('DIR_FS_SQL_CACHE', '/home/content/m/a/n/maneattractions/html/cache');

  if ($_GET['cPath']==12){define('STORE_STATUS',1);} 
?>
11 Nov 2007, 5:34 PM
#10
anir24 avatar

anir24

New Zenner

Join Date:
Jun 2007
Location:
Morocco_Canada
Posts:
24
Plugin Contributions:
0

Re: Simple ZC gallery

Hello

Firstly I did all what is required and had it working very well, the only problem that I have is that the sold products can be shown in new products for november, in the main page.

Any one have a solution for the products in the gallery category not to show anywhere else?

Kinds

Anir

12 Nov 2007, 1:12 PM
#11
mommydesigns avatar

mommydesigns

Zen Follower

Join Date:
Jul 2006
Posts:
135
Plugin Contributions:
0

Re: Simple ZC gallery

This is brilliant if I could get it to work....

I created the new "local" directory and copied in the config.php file, added the line as noted (with the category for my new directory) and nothing's happened.

Do I need to move all my sold out products into this category now?

12 Nov 2007, 1:28 PM
#12
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Simple ZC gallery

Do I need to move all my sold out products into this category now?
Yes, you move all sold products to your new category
i.e.

<?php
if ($_GET['cPath']==42){define('STORE_STATUS',1);}
?>

Alter 42 in code above to reflect number of your new category
HTH