Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

I am feeling pretty dense right now. The define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

line wasn't there, so I added it. I am not sure what is mean't by adjust to my settings? How should I do this. I have never played with this file before. Any help would be great.

 

Here is what the code now looks like.

 

<?php

/*

$Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', ''); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers

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

define('HTTP_COOKIE_DOMAIN', '');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '');

define('HTTPS_COOKIE_PATH', '');

define('DIR_WS_HTTP_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

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', 'pub/');

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', ''); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '');

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

I am feeling pretty dense right now. The define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

line wasn't there, so I added it. I am not sure what is mean't by adjust to my settings? How should I do this. I have never played with this file before. Any help would be great.

 

Here is what the code now looks like.

 

...

Please note that you now have the constant DIR_FS_CATALOG defined twice.

 

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

 

Also note the comment "// * DIR_FS_* = Filesystem directories (local/physical)", this means that all constants starting with "DIR_FS_" are local directories of your server. Make sure you have these directories created and that they are configured correct due to security etc. Use "chmod" or similar on Windows to change the permission.

 

/Fred

Link to comment
Share on other sites

Thanks for trying to help Fred. I really appreciate it.

 

Strider mentioned these two defines in his reply:

define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

 

You pointed out that now I have the constant DIR_FS_CATALOG defined twice. Which should I remove?

 

Also, when you say: Also note the comment "// * DIR_FS_* = Filesystem directories (local/physical)", this means that all constants starting with "DIR_FS_" are local directories of your server. Make sure you have these directories created and that they are configured correct due to security etc. Use "chmod" or similar on Windows to change the permission.

 

Now this define: define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

 

I have no idea where this is supposed to be pointing to. My catalog is where most peoples are: jewelrycabin/catalog (jewelrycabin being the store name). Should I be replacing the /home/oscworks/work/new_oscworks/ with jewelrycabin/catalog ?

 

As far as the download.php is concerned, this is here: jewelrycabin/catalog/download.php

 

Permissions have been set. What do I have to change in configure.php to match where my files are? If you could give me an example, that would be great. I am sorry to be such a pain. I have thought about just uninstalling this contribution so that I don't need the download.php to work but I really like this contribution, so I am very thankful for your quick replies.

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

JaaMor: I was just giving you an example of where the directory is suppose to go on the define_fs_catalog. From what you gave as an example

Warning: The downloadable products directory does not exist: /hsphere/local/home/jade2001/jewelrycabin.com/catalogdownload/. Downloadable products will not work until this directory is valid.

 

it appears that your dir_fs_catalog didn't have the trailing / and this caused your download directory to be concantenated with your physical catalog. Your physical should be /hsphere/local/home/jade2001/jewelrycabin.com/catalog/

(my knowledge is so small you would think that an ant was a genius in comparison)

Link to comment
Share on other sites

Now this define: define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

 

I have no idea where this is supposed to be pointing to. My catalog is where most peoples are: jewelrycabin/catalog    (jewelrycabin being the store name). Should I be replacing the /home/oscworks/work/new_oscworks/ with jewelrycabin/catalog ?

 

As far as the download.php is concerned, this is here: jewelrycabin/catalog/download.php

On a regular installation of OSC, you have all your catalog files in a a directory called "catalog" in this directory you should have more directories like "admin" and also "download".

 

The constant DIR_FS_DOWNLOAD in configure.php is supposed to point to the absolut "download" directory. On a typical Win32 installation you would have these constants:

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', 'c:/inetpub/wwwroot/catalog');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

This means that you have all your catalog-php-files in "c:/inetpub/wwwroot/catalog" and in there you will also have a directory named "download", i.e. it's physical path is "c:/inetpub/wwwroot/catalog/download".

 

I hope this will get you going.

 

/Fred

Link to comment
Share on other sites

fred: so nice to see you again... but you need to add the ending slash on the dir_fs_catalog

 

mary: you might look at adding the lines you talked about in your splitpage class in the catalog side. I have never heard or seen this and we don't actually do anything with either of the files you were talking about. But I always thought my coding made the moon shine brighter but hey who knows .. maybe it does reach into other netherlands.

 

selcuk: it appears you included your class twice somehow.

 

karen_l: is that the only payment module you are using?

(my knowledge is so small you would think that an ant was a genius in comparison)

Link to comment
Share on other sites

Thanks Strider. I will try to fool around with that and see what I can accomplish. Before I do though, I have to fix this new error on my front page.

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/configure.php:49) in /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/configure.php:49) in /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/functions/sessions.php on line 67

 

Line 49 is the ?>

 

// define our database connection

define('DB_SERVER', ''); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '');

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

I have seen this before and have fixed it before by taking out any empty lines before the ?> but this time, there are no empty lines. Any suggestions on what I have messed up now? Thanks Strider.

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

Actually, here is the block of code that is giving me the above errors.

 

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

The line in question is define('DB_DATABASE', 'osCommerce');

 

Can anyone see what is wrong here? I am at my wits end with all of this. Thanks.

Edited by JaaMor

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

Thanks!! Between Strider and Fred, I was able to understand exactly what everything meant and I no longer have this on my front page.

 

Warning: The downloadable products directory does not exist: /hsphere/local/home/jade2001/jewelrycabin.com/catalogdownload/. Downloadable products will not work until this directory is valid.

 

Unfortunately, I must have messed something else up because I am still getting this error:

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/configure.php:48) in /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/configure.php:48) in /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/functions/sessions.php on line 67

 

Here is where the error apparantly is (Line 48 is define('DB_SERVER_PASSWORD', '');

 

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

 

Once I fix this error, I believe all will be well. Can anyone spot the problem. Thanks again!

Edited by JaaMor

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

First of all, I am just logged in as my husband to get some help as he is at this pesky place called work and cannot fix this for me.

 

We have the credit class contrib installed and I am trying to create a coupon for one particular manufacturer. I would settle for the voucher to be usable on categories as is the option I currently have but I cannot get that to work.

 

Has anyone else tried to select the particular categories and not had it work or do you know a way to select a manufacture to discount??? Please help!

 

-Rebecca

Link to comment
Share on other sites

I loaded the credit class contribution from

http://www.oscommerce.com/community/contributions,282

 

I want to use the coupon component, but I don't see any place for the customer to enter the coupon on my site. Can someone describe how this is supposed to work or provide an illustration?

 

I merged the changes into MS1, if that gives a clue to the problem.

 

 

-Matt

Link to comment
Share on other sites

Ok. Actually, line 48 is this line

 

?>

 

Entire block of code:

// define our database connection

define('DB_SERVER', ''); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '');

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

This has really messed up my site so I am desperately hoping someone can figure out why I am getting those warning messages. Thanks.

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/configure.php:48) in /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/configure.php:48) in /hsphere/local/home/jade2001/jewelrycabin.com/catalog/includes/functions/sessions.php on line 67

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

I loaded the credit class contribution from

http://www.oscommerce.com/community/contributions,282

 

I want to use the coupon component, but I don't see any place for the customer to enter the coupon on my site. Can someone describe how this is supposed to work or provide an illustration?

 

I merged the changes into MS1, if that gives a clue to the problem.

 

 

-Matt

Have you activated coupons?

 

Try Admin | Modules | Order Total | Discount Coupons.

 

You should then see a redeem box in stage "Payment" of the checkout process.

 

/Fred

Link to comment
Share on other sites

Ok. Unfortunately, I think we all knew I would be back lol. I have read all 77 pages of this topic and have not seen where there is a definite fix for the queueing problem. I have queues set to true. But after I purchase a gift voucher, nothing shows in the queue for me to ok. Because of this, I haven't gotten any further to see if everything goes ok after this fix. Any help would be greatly appreciated. Here is my sort order

 

Discount Coupons 740

Gift Vouchers 760

Low Order Fee

Shipping 2

Sub-Total 1

Tax 3

Total 900

 

Here are the other parameter settings:

 

Display Total

true

 

Sort Order

760

 

Queue Purchases

true

 

Include Shipping

true

 

Include Tax

true

 

Re-calculate Tax

None

 

Tax Class

--none--

 

Credit including Tax

false

We will not regret what we have done. We will regret what we didn't do.

Link to comment
Share on other sites

Hello.

 

I have installed CCGV 2.2.2 and everything seems to work except for two areas, which are major.

 

1st, when a user goes to checkout, whether they have a gift certificate, coupon code, etc, or not, all the right column produces is:

 

1146 - Table 'b2c_osc.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'

 

[TEP STOP]

 

2nd, I tested emailing a gift voucher, when I follow the link back to claim the voucher, my browser gets caught in an endless loop. Newer mozilla browsers stop the loop and say that the URL redirction has been terminated. IE and netscape just keep looping over and over and over.

 

Any ideas?

 

I did a clean install, right over top of a fresh MS 2.2.

Link to comment
Share on other sites

Found a new one just now.

 

When trying to create a new user, screen goes blank and I get:

 

Fatal error: Call to undefined function: create_coupon_code() in /home/b2c/public_html/catalog/create_account.php on line 250
Link to comment
Share on other sites

That depends on the version of osCommerce that you are using.

 

It could be /catalog/includes/application_top.php or /catalog/includes/database_tables.php.

 

BTW.... All of this is in the instructions.

 

-R

Link to comment
Share on other sites

I followed the instructions.

 

I installed a fresh copy of OSC 2.2-MS2, copied all the files over from the CCGV distribution file, and then I hand-edited files numbers 24, 25, 26, 60, 70, 71, 76, 77 and 78 as it said to. I used phpMyAdmin to process the .sql file as well.

 

I have since checked the files at least 2-3 times each and I'm still getting the errors. I'll keep tyring and looking for something I did wrong, but I thought I was going the easiest route by just using the files that came in the contirb zip file.

 

Not everyone is a PHP programmer, though, so it's not obvious where things go and how things work.

Link to comment
Share on other sites

Simply add the Simply add the TABLE_COUPON_GV_CUSTOMER define in the appropriate place. in the appropriate place.

 

If I do need to add this, as it seems I do, what is the "the TABLE_COUPON_GV_CUSTOMER define"?

Link to comment
Share on other sites

Ok I fixed that by adding the define statements I found in other CCGV files to the database_tables file.

 

At what state during the checkout is the customer supposed to be able to enter a coupon code? I'm usint a fresh install of OSC and of the CCGV contrib and nowhere can I enter a coupon during checkout.

 

redeem.php is just looping over and over and over again reloading itself, customers cannot redeem gift vouchers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...