Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

This will only work on fresh OSC files as stated in the installation text file. Thats why i need the code. I only need it for 2-3 files. The rest is done and working. One is the orders.php and create_account.php and one other i cant remember.

 

I cant overwite these file with the ones included cause those files are moded and they also do not come with the code to manually write them in or i would have overwritten them and added the code from the others.

 

So is their anyway to find the code and installation for what needs to be replaced and inserted?

 

Thanks

 

no true. what it is says is if you are installing onto a fresh copy of OSC you can just copy the file over. If your store is already modified, you need to edit each file.

 

Like I said, you need to open each file and look for the "comments" and copy that code into your file with the same names. What this means is open each file that came with the contrib and look for: "//ICW ADDED FOR CREDIT CLASS SYSTEM". This means that the code following that comment tag was added and needed for the contribution. you then take that code and copy it into the respective files in your store.

 

I have installed this contrib several times on my store with already 100 contributions installed at the time. This contrib is just a lot of manual work to get working

Edited by carrerarod
Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

no true. what it is says is if you are installing onto a fresh copy of OSC you can just copy the file over. If your store is already modified, you need to edit each file.

 

Like I said, you need to open each file and look for the "comments" and copy that code into your file with the same names. What this means is open each file that came with the contrib and look for: "//ICW ADDED FOR CREDIT CLASS SYSTEM". This means that the code following that comment tag was added and needed for the contribution. you then take that code and copy it into the respective files in your store.

 

I have installed this contrib several times on my store with already 100 contributions installed at the time. This contrib is just a lot of manual work to get working

 

 

Exactly the mod is installed on a FRESH copy of each file not on modded files. So you wont be able to compare as the files will be completely different. Also it doesnt show you what was replaced in order to fit in a certain peice of code.

 

 

Anyone know where i can find the code for each file and what needs to be replaced.

 

Thanks

Link to comment
Share on other sites

Hi guys, I've installed 5.13 and get this error when you click on the "create account" link for a new user:

Fatal error: Call to a member function on a non-object in /hsphere/local/home/diskolog/diskology.com/catalog/create_account.php on line 328

 

That error references this code within create_account.php:

  if ($messageStack->size('create_account') > 0) {

 

I have no idea what this error means or how to fix this. Otherwise, the contribution seems to work fine. TIA.

Link to comment
Share on other sites

Hi guys, I've installed 5.13 and get this error when you click on the "create account" link for a new user:

Fatal error: Call to a member function on a non-object in /hsphere/local/home/diskolog/diskology.com/catalog/create_account.php on line 328

 

That error references this code within create_account.php:

 ?if ($messageStack->size('create_account') > 0) {

 

I have no idea what this error means or how to fix this.  Otherwise, the contribution seems to work fine.  TIA.

 

OK I went in to create_account.php and started editing out php code until I ended up with this:

<?php
//  if ($messageStack->size('create_account') > 0) {
?>
     <tr>
       <td><?php //echo $messageStack->output('create_account'); ?></td>
     </tr>
     <tr>
       <td><?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
//  }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>
          <td class="inputRequirement" align="right"><?php //echo FORM_REQUIRED_INFORMATION; ?></td>

 

The error goes away but I have no idea what I commented out or if it will affect the store adversly.

Link to comment
Share on other sites

Sheesh, it just keeps coming... now, when I list the shopping cart contents by going to shopping_cart.php I get the following errors:

Warning: Variable passed to each() is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/shopping_cart.php on line 65

Warning: Variable passed to each() is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/shopping_cart.php on line 65

 

And under each product in the list I get these:

Warning: reset(): Passed variable is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/includes/modules/order_details.php on line 83

Warning: Variable passed to each() is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/includes/modules/order_details.php on line 84

Link to comment
Share on other sites

If im not mistaken isnt thier suppose to be a field to enter a coupon code on the checkout page. If so i dont have that. Is thier Anything i need to or can check?

 

If there is no active coupon defined in admin nor gift voucher still to be redeemed by a customer, the field will not display. You need also to enable the coupon and/or gift voucher module(s) in the order total config in admin.

 

Can anyone tell me where i can i find the code the needs to be replaced for each file?

The best way to work is to use a compare & merge program to see differences between 2 applications. Keeping a text file with instructions on how to update manually the files is a terribly time consuming and boring job, while using a compare and merge program will save time and hairs, not only for this contribution. I propose Beyond Compare 2 from Scooter Software (even I don't get any penny from them).

 

- Rigadin

Link to comment
Share on other sites

Hi,

I installed the CCGV contrib yesterday and everything went smooth. But when I tried to add a coupon of 10% discount it doesn't show % it shows $ instead. I can't get it to accept % and when I try to redeem the coupon on a purchase it doesn't withdraw the discount at all. It shows coupon as redeemed but I have to pay the full price anyway. Gift vouchers redeem fine. I am using PayPal IPN payment module. I have searched high and low in this forum but haven't found an answer. I will be grateful for any hint in the right direction!

 

Thanks in advance,

Ellinor

Link to comment
Share on other sites

I found out why the % discount didn't work I had checked the free shipping - sorry for asking before I checked everything. But now it won't take off the discount upon checkout... this is when I use the discount coupons, not the gift vouchers who works like a clock. Does anyone have a cure for this one? This is driving me nuts...

 

Thanks in advance,

Ellinor

Link to comment
Share on other sites

Ok, I'm back again, suddenly the % coupon started working...

But yet another problem... How do I enable the purchase of gift certificates? I have added a product GIFT_5 and I purchased it but then what? What attributes should I apply to it? This is the only info I found in the files:

Gift vouchers are a virtual product. In this regard, in many shops, they do not require shipping charges to be added to them. To avert the shipping charge on gift vouchers set the weight of the gift voucher to 0 when creating the product and enable downloads by setting true the value admin->configuration->downloads->enable download

 

Can someone please help? I am almost there with this one :)

Thanks in advance,

Ellinor

Link to comment
Share on other sites

After installing Class voucher over Authorize.net 1.7 ...Authorize can not connect to AUthorize server.

 

I have found the 2 files that Class/voucher alter that Authorize 1.7 consolidated does too. The problem is in the follow 2 files.

 

catalog/checkout_payment.php

catalog/checkout_process.php

 

I did a compare and it's not an easy add. Seems they share some fuctions and the changes are strange or just above my understanding.

 

Could someone please help with this?

 

I can post the files here for some to compare for me.

 

This would be a great FIX for the many users here who take Authorize.net..

Link to comment
Share on other sites

In the Admin's Payment Modules section I see the text "Credit Class Error" instead of what I would expect to see. What does this mean?

 

Thanks.

Link to comment
Share on other sites

OK, the scary thing is that, as previously reported, the Create New User link does not kill the store with the error and I changed nothing.

 

But now I continue to see errors when viewing the shipping cart contents. Just after What's In My Cart? I see this one:

Warning: Variable passed to each() is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/shopping_cart.php on line 65

 

Then after each product I see these listed int he column under the product:

Warning: reset(): Passed variable is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/includes/modules/order_details.php on line 83

 

Warning: Variable passed to each() is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/includes/modules/order_details.php on line 84

 

And I see these listed in the column where the pricing gets listed:

Warning: reset(): Passed variable is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/includes/modules/order_details.php on line 105

 

Warning: Variable passed to each() is not an array or object in /hsphere/local/home/diskolog/diskology.com/catalog/includes/modules/order_details.php on line 106

 

Any ideas on how to fix this? Please?

Link to comment
Share on other sites

Hi, I've installed the 5_13 version of the module, and it seems to work during testing, however, we are getting reports from customers that the coupon is not being applied.

 

I am using it for discount coupons and sent an email offer out to about 1500 customers. A few of them received the discount during checkout, but a larger percentage didn't than did. So I'm trying to figure out where I'm going wrong, barring user error.

 

I did find a suggestion here http://www.oscommerce.com/forums/index.php?showtopic=151637, which was to change:

 

On this line:

$pr_c = $this->product_price(tep_get_prid($order->products[$i]['id'])); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT!

 

Shouldn't it be:

$pr_c = $this->product_price($order->products[$i]['id']); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT!

 

and I've done that. I'm just not sure how to test it more... I've placed several orders and it seems to work on my system.

 

I did upgrade to 5_13a, but removed it because it seemed confusing to go back to the payment page and have to reenter credit card info again, and figure out which button to click (Redeem or Continue).

 

The site is at www.hellynewport.com and the coupon code is HELLYspring05 if somebody has a chance to check it out. Thanks. Meanwhile, I 'll continue to look in the forums.

 

Janet

Link to comment
Share on other sites

I did upgrade to 5_13a, but removed it because it seemed confusing to go back to the payment page and have to reenter credit card info again, and figure out which button to click (Redeem or Continue).

Hi,

 

In modules/order_total/ot_coupon.php, just before the

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT), 'SSL')); // Added in v5.13a by Rigadin

add

    if ($HTTP_POST_VARS['submit_redeem_x'])

This will redirect back to the payment page if they click Redeem.

 

If they continue down the page, enter CC info etc., and click Continue, then all will be well.

 

If they continue down the page, enter CC info and go back up again and click redeem, then the CC info is still lost, but I think that this minor addition makes things a little more sensible.

 

Quentin

Link to comment
Share on other sites

I am using it for discount coupons and sent an email offer out to about 1500 customers.  A few of them received the discount during checkout, but a larger percentage didn't than did.  So I'm trying to figure out where I'm going wrong, barring user error. 

 

I did find a suggestion here http://www.oscommerce.com/forums/index.php?showtopic=151637, which was to change:

and I've done that.  I'm just not sure how to test it more... I've placed several orders and it seems to work on my system.

 

Whilst working through this [the fix for where items have attributes], I also found that, where a product is in multiple category trees (I've got Brand, Age and Activity for toys), things fail if the selected category is not the first one found by tep_get_product_path in general.php.

 

This is cured by adding to general.php

 

  
function tep_get_product_full_path($products_id) {
   $cPath = '';

   $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status <> '0' and p.products_id = p2c.products_id");

   $categories = array();
   while ($category = tep_db_fetch_array($category_query))
   {
     tep_get_parent_categories($categories, $category['categories_id']);

     $categories = array_reverse($categories);
     $categories[] = $category['categories_id'];

   }
   $cPath = implode('_', $categories);

   return $cPath;
 }

and replacing the call to tep_get_product_path in ot_coupon.php with a call to this new function.

 

Hope this helps someone.

 

Quentin

Link to comment
Share on other sites

Hi,

 

In modules/order_total/ot_coupon.php, just before the

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT), 'SSL')); // Added in v5.13a by Rigadin

add

 ? ?if ($HTTP_POST_VARS['submit_redeem_x'])

This will redirect back to the payment page if they click Redeem.

 

If they continue down the page, enter CC info etc., and click Continue, then all will be well.

 

If they continue down the page, enter CC info and go back up again and click redeem, then the CC info is still lost, but I think that this minor addition makes things a little more sensible.

 

Quentin

 

Hi Quentin, Thanks for your suggestions. I've implemented this and your second suggestion in the general.php, as I have products in multiple categories.

 

What happens now is:

 

I enter my credit card info and then add the coupon code and click redeem. I get the Congrats message, but my credit card info is now gone.

 

I enter my credit card info and hit continue, and on the confirmation page, the discount does not appear.

 

Since the credit card info is higher on the page than the coupon, people will naturually fill that in, and then have to fill it in again after they hit redeem. And since the message says their discount is applied, they are likely to hit continue after the second time.

 

Any ideas? If I move the redeem button above the credit card info, would that help?

 

Thanks,

Janet

Link to comment
Share on other sites

Report two bugs:

 

In V5.13 or V5.13a, if create a discount coupon + free shipping then only free shipping works.

 

Thanks to Gyakutsuki's V5.13b.

 

the new ot_coupon.php will create a effective coupon code when discount+free shipping.

 

but there are still two tiny bugs:

 

1, when create a discount coupon:

discount + free shipping ( for example 10% off + free shipping over 100 dollars)

 

The name of the coupon will be only: free shipping

 

Hope some one will correct the name to 10% off + free shipping for over...

 

2, maybe the same bug:

In the shopping cart info box, the coupon info will also display as free shipping, no discount information.

 

Hope some guy can correct this. Before the correction, I suggest users please create two kinds of coupons separately: only discount coupon or only free shipping coupon.

 

And at last one suggestion:

 

I also installed a free shipping contribution. With this, when check out, the customer will be informed the minimum order requirement for free shipping.(not coupon)

 

CCGV has the same function to let me set the minimum order for free shipping but customer will know this only if their orders meet the minimum. I hope CCGV can also let the customer know the minimum in any check out condition.

 

 

Thanks.

Edited by ebayer
Link to comment
Share on other sites

Hi Quentin, Thanks for your suggestions. I've implemented this and your second suggestion in the general.php, as I have products in multiple categories. 

 

What happens now is:

 

I enter my credit card info and then add the coupon code and click redeem.  I get the Congrats message, but my credit card info is now gone.

 

I enter my credit card info and hit continue, and on the confirmation page, the discount does not appear. 

 

Since the credit card info is higher on the page than the coupon, people will naturually fill that in, and then have to fill it in again after they hit redeem.  And since the message says their discount is applied, they are likely to hit continue after the second time. 

 

Any ideas?  If I move the redeem button above the credit card info, would that help?

 

Thanks,

Janet

 

Hi,

 

I have the coupon above the CC info, which is why I did it that way.

 

I'll check what happens if I follow your sequence.

 

Quentin

Link to comment
Share on other sites

Well I did this andthe file still does not pop up and I made sure the fiel wasuploaded..... does it need to have the rul in there? I have no moreideas to trry thanks!

 

Maddie

QUOTE(csaunders @ Mar 1 2005, 12:37 PM)

Hi,

 

Firstly, big thanks to all who have been involved in making this contribution - it's fantastic.  I hope that the information below helps in making it even better.

 

I am using the latest versions of all the files for this contrib on MS2.2.

 

Firstly, there is a small ommission of the ICW comment string in the includes/boxes/shopping_cart file.  There is some Javascript at the start that makes the popup_coupon_help work:

 

CODE

 

<!-- shopping_cart //-->

<script language="javascript"><!--

function couponpopupWindow(url) {

window.open(url,'popupWindow',& #39;toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,

left=150')

}

//--></script>

 

 

That will fix the problem for anyone who has been wondering why the popup does nothing (and generates an error).

 

Next, I have also made some other changes to this file.  Using this code, instead of having

 

"coupon: more info"

 

in the shopping cart infobox, you will have:

 

"coupon: (name of coupon you entered in admin)

more info"

 

To me this makes more sense, but that's a matter of opinion.  Here is the code for includes/boxes/shopping_cart:

 

Find ~line 90:

CODE

 

if (tep_session_is_registered('cc_id') && $cc_id) {

  $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

  $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="java script:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 

 

Replace with:

CODE

 

if (tep_session_is_registered('cc_id') && $cc_id) {

$coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");

$coupon = tep_db_fetch_array($coupon_query);

$coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_id . "' and language_id = '" . $languages_id . "'");

$coupon_desc = tep_db_fetch_array($coupon_desc_query);

$text_coupon_help = sprintf($coupon_desc['coupon_name']);

  $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

  $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="infoBoxContents">' . CART_COUPON . $text_coupon_help . '<br>' . '<a href="java script:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 

 

 

Thanks in advance.

-Christian

*

Well I did this andthe file still does not pop up and I made sure the fiel wasuploaded..... does it need to have the rul in there? I have no moreideas to trry thanks!

 

Maddie

 

Did anyone ever figure this out?? I changed the code, and still can't get a popup.

Edited by chynathedragon
Link to comment
Share on other sites

Ok, here's what's going on: Installed lastest version of this contribution, everything seemed to be running smoothly, except I have a couple issues:

 

1. Discount coupons that include multiple items in categories aren't working. No discount is being taken from the order total. However, a blanket coupon, with no items listed or catedgories listed, work just fine. I.E. With any $25.00 lingerie purchase, customer receives free stockings. We've listed in admin the stockings that are eligible, and the categories for eligibility. But in checkout, discounts are not being taken. It doesn't matter whether or not the products have attributes or not; neither will work.

 

Alternatively, we have a promotion for referral customers, 20% off any item in the store. This discount works fine, and shows splendidly.

 

2. We are able to purchase and send gift vouchers fine, but we seem unable to redeem them. I.E. I purchased a $100.00 gift voucher under one account, and sent myself a $100.00 gift voucher under another account. When I log in to the second account, the $100.00 gift voucher balance is there (I already released it in admin), but when I go to enter the redeem code, it tells me the code is invalid. So my voucher balance stays at $100.00.

 

I dont know if somehow these two issues are related, but I conjecture that the first issue has a problem with either the product list, or the category list. Just to be clear: the valid products/categories lists are for the products/categories that are eligible for the discounts, correct?

Link to comment
Share on other sites

Whilst working through this [the fix for where items have attributes], I also found that, where a product is in multiple category trees (I've got Brand, Age and Activity for toys), things fail if the selected category is not  the first one found by tep_get_product_path in general.php.

 

This is cured by adding to general.php

 

  
function tep_get_product_full_path($products_id) {
   $cPath = '';

   $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status <> '0' and p.products_id = p2c.products_id");

   $categories = array();
   while ($category = tep_db_fetch_array($category_query))
   {
     tep_get_parent_categories($categories, $category['categories_id']);

     $categories = array_reverse($categories);
     $categories[] = $category['categories_id'];

   }
   $cPath = implode('_', $categories);

   return $cPath;
 }

and replacing the call to tep_get_product_path in ot_coupon.php with a call to this new function.

 

Hope this helps someone.

 

Quentin

 

Quentin:

 

If you alter this function, you're "undefining" the function in includes/application_top.php

 

When you click on links to product in the shopping cart, for example, it gives a fatal error.

 

Am I missing something?

Link to comment
Share on other sites

Ok, here's what's going on:  Installed lastest version of this contribution, everything seemed to be running smoothly, except I have a couple issues:

 

1.  Discount coupons that include multiple items in categories aren't working.  No discount is being taken from the order total.  However, a blanket coupon, with no items listed or catedgories listed, work just fine.  I.E.  With any $25.00 lingerie purchase, customer receives free stockings.  We've listed in admin the stockings that are eligible, and the categories for eligibility.  But in checkout, discounts are not being taken.  It doesn't matter whether or not the products have attributes or not; neither will work.

 

Alternatively, we have a promotion for referral customers, 20% off any item in the store.  This discount works fine, and shows splendidly.

 

2.  We are able to purchase and send gift vouchers fine, but we seem unable to redeem them.  I.E.  I purchased a $100.00 gift voucher under one account, and sent myself a $100.00 gift voucher under another account.  When I log in to the second account, the $100.00 gift voucher balance is there (I already released it in admin), but when I go to enter the redeem code, it tells me the code is invalid.  So my voucher balance stays at $100.00.

 

I dont know if somehow these two issues are related, but I conjecture that the first issue has a problem with either the product list, or the category list.  Just to be clear:  the valid products/categories lists are for the products/categories that are eligible for the discounts, correct?

 

I inevitably post something then find the answer. This post was a huge help.

 

I'm surprised it's not been altered yet...think I'll go do that.

Link to comment
Share on other sites

Errr, I meant here. I uploaded the two files to the contribution so no one else has the headache I currently have from beating my head against a wall :P

Link to comment
Share on other sites

A programmer has installed CCGV 5.13b and i want to fully test it out. What functions should i test. Some sort of checklist.....

 

This is what i have come up with so far.

 

All admin functions

Welcome amount voucher

send voucher to friend

coupon details link

redeemable coupon

coupon + voucher checkout

checkout confirmation with all calculations, email as well

correct coupon heading when redeeming

 

Any more?

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...