Jump to content
JuanIgnacio

Credit Class & Gift Vouchers (CCGV) for 2.3.1

Recommended Posts

As it turns out, the reason for shipping being skipped is pretty elementary - if you have no products in the cart that are not virtual (e.g. also, check that if a product is not virtual that it has a weight specified) - it will, logically, skip shipping.

 

It was skipping shipping even with physical products in the cart for me, until I looked at the product and realized it had no shipping weight assigned. Once I assigned a shipping weight to the product in my cart, the shipping page showed up just fine.

 

Now I am working on the end of file error in checkout_confirmation, and I have just noticed that none of the payment methods installed are showing up on the checkout_payment page, so I'm going to take a wild stab and say that the lack of payment information being provided is the reason for the failure of the checkout_confirmation page.

 

More updates to come, hopefully.

Edited by robertwhitis

Share this post


Link to post
Share on other sites

I have just noticed that if you go to the GV FAQ page, and click on "check balance" - or go to the account page and click check balance, the filename linked to does not exist. Also, in the case of the link on the account page, the link is created using a constant which isn't defined (checked filenames.php modify instructions to verify).

 

So, basically the file, /catalog/gv_balance.php was left off the addon altogether.

 

If the author has this file, it'd be great to post an updated version that fixes these things.

 

Also, on the send store credit page, it doesn't display how much store credit you have. So if you want to share your store credit by passing it on to someone else, it'd make sense to display how much you have to share on that page, just a thought.

 

Off to create my own gv_balance.php file.

 

Robert

Share this post


Link to post
Share on other sites

For those that need a gv_balance.php file, I suggest you edit /catalog/includes/filenames.php and add a define for FILENAME_GV_BALANCE, gv_balance.php first.

 

Here is the code I used:

 


<?php
/*
 $Id$

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2010 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

 require(DIR_WS_INCLUDES . 'template_top.php');
?>

<h1><?php echo HEADING_TITLE; ?> - Gift Vouchers</h1>

<?php
 if ($messageStack->size('account') > 0) {
   echo $messageStack->output('account');
 }
?>

<div class="contentContainer">
 <b>Gift Voucher Balance</b>

 <div class="contentText">
 <?php
//CCGV BEGIN
 if (tep_session_is_registered('customer_id')) {
       $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
       $gv_result = tep_db_fetch_array($gv_query);

?>
          <div class="contentText">
       <ul class="accountLinkList">
         <li><span class="ui-icon ui-icon-star accountLinkListEntry"></span><?php echo 'Gift Voucher Balance: '; ?>
 <?php echo $currencies->format($gv_result['amount']); ?></li>
</ul>
<ul class="accountLinkList">
         <li><span class="ui-icon ui-icon-mail-closed accountLinkListEntry"></span><?php echo '<a href="' . tep_href_link(FILENAME_GV_SEND, '', 'SSL') . '">' . 'Share Gift Voucher' . '</a>'; ?></li>
</ul>
<ul class="accountLinkList">
         <li><span class="ui-icon ui-icon-help accountLinkListEntry"></span><?php echo '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'SSL') . '">' . 'Gift Voucher FAQ' . '</a>'; ?></li>
       </ul>
 </div>
<?php

 }
// CCGV END
?>
 </div>

</div>

<div style="clear: both;"></div>

<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

Don't hang me out to dry for putting each "li" it's own "ul"...for some reason, it was indenting each "li" further and further, didn't feel like spending any time figuring out why, so there's a little extra spacing between each "li" - no biggie.

 

Robert

Edited by robertwhitis

Share this post


Link to post
Share on other sites

deleting an order does not return credit amount similar to returning an item to stock

Share this post


Link to post
Share on other sites

As it turns out, the reason for shipping being skipped is pretty elementary - if you have no products in the cart that are not virtual (e.g. also, check that if a product is not virtual that it has a weight specified) - it will, logically, skip shipping.

 

It was skipping shipping even with physical products in the cart for me, until I looked at the product and realized it had no shipping weight assigned. Once I assigned a shipping weight to the product in my cart, the shipping page showed up just fine.

 

Now I am working on the end of file error in checkout_confirmation, and I have just noticed that none of the payment methods installed are showing up on the checkout_payment page, so I'm going to take a wild stab and say that the lack of payment information being provided is the reason for the failure of the checkout_confirmation page.

 

More updates to come, hopefully.

 

Hey Robert, i spent hours on saturday trying to find out why it skipped the shipping page and in the end, i had to restore everything..

 

This morning i woke up, read your post - about the shipping weight - THEN i dive in and redo everything!

 

It works! I believe now my site is live with the discount coupon as well as store credits!

 

Thanks a million!

Share this post


Link to post
Share on other sites

The pop-up error dialog for checkout_payment.php doesnt show when this module is enabled in Admin, but does when it is disabled. Is that by design?

 

By pop-up error dialog, I mean the one that says "Errors have occured during the process of your form. Please make the following corrections:" when you click on Continue.

 

Using 2.3.

 

 

Help or schooling appreciated.

Share this post


Link to post
Share on other sites

The pop-up error dialog for checkout_payment.php doesnt show when this module is enabled in Admin, but does when it is disabled. Is that by design?

 

By pop-up error dialog, I mean the one that says "Errors have occured during the process of your form. Please make the following corrections:" when you click on Continue.

 

Using 2.3.

 

 

Help or schooling appreciated.

 

I discovered that this modules mods to checkout_payment.php include a second draw-form statement that is a duplicate of the original:

echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"');

 

Disabling this line allows the pop-up to work...but I am not sure what other effect disabling it has.

Share this post


Link to post
Share on other sites

Is there anyway to use a store credit when creating an order through the Admin screen?

Share this post


Link to post
Share on other sites

I have installed CCGV 6 with osC 2..3.1 and PayPal express and it doesn't work. I am getting an internal server error (500) on return to checkout_confirmation.php.

 

(The contribution works fine apart from the PayPal Express checkout, and I can find no obvious errors in the install.)

 

Is CCGV 6 compatible with PayPal Express?

 

Are modifications required to paypal_express.php?

 

If CCGV 6 is incompatible with PayPal Express are there vouchers and coupons modules that DO work with it?

 

Help would be appreciated.

 

 

Debugging doesn't show up much except some non fatal errors on return to checkout_confirmation.php

 

Error Type: [E_NOTICE] Undefined variable: gv_contents_string

On line 111

File includes/modules/boxes/bm_shopping_cart.php

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 

Date / Time: 04-03-2013 23:21:07

Error Type: [E_STRICT] date_default_timezone_get()

On line 54

File includes/functions/compatibility.php

 

try this:

PayPal Express Checkout for Discount and Extra Fee Order Total Modules

http://addons.oscommerce.com/info/8848

Share this post


Link to post
Share on other sites

I've been trying to get this add-on working on my dev site and it doesn't seem to be working. I've installed the add-on and it seems to be getting stuck on the checkout confirmation page after returning from paypal. I'm not receiving any emails with my order confirmation or Gift Cert Code from either my site or paypal.

 

Some Info:

I'm using the paypal sandbox.

My dev site is running OSC 2.3.3 and the Newest version of CCGV on a local private server.

Its a slightly modified version of OSC (No other add ons) but nothing that should be causing a problem with this add on.

The paypal transaction is going thought (Money being received) but no gift certs/codes are being generated.

Firebug in giving me an internal error of 500 of the checkout confirmation page.

 

Could you guys give me a direction to head in or some ideas on what I could be doing wrong because as of right now I'm completely lost and I can't figure out what my next move should be.

 

If any more info is needed please let me know and I'll see what I can do.

Edited by TylerThomas

Share this post


Link to post
Share on other sites

Hi T. Thomas,

 

I have Paypal express and it is working fine -- I'm sure you've done this -- but have you released the gift certificates in the Admin module? Did you also install the coupon module (it, too has to be installed as I painfully learned).

Share this post


Link to post
Share on other sites

Hi, for anyone getting the error on checkout_shipping.php.... I tried the solutions everyone else suggested with no result. I practically tore my hair out trying to resolve this issue -- as it occurred just as I took the site live. Unfortunately, I had to restore my old (and ugly!) site and am still working through other issues caused by my restoration.

 

Anyway, the first thing I did was remembered I had stupidly changed the variable of $sendto to $billto because I didn't like the 'functional' way it was presented. Once I fixed that, I still had the issue. I had been clearing my cache locally with every code change -- but then noticed odd cache files hanging around on the host server. I deleted them and viola, was able to proceed.

 

I am a NOOB (but have been somehow muddling through the site for 8 months or so...) sigh... Just thought this might help someone else out there who has been dealing with these errors.

Share this post


Link to post
Share on other sites

Hi,

 

Disclaimer: I am a total NOOB to OSCommerce/Php, etc. but have been working on the site for 8 months and somehow almost have something ready to put up.

 

My problem: I somewhat successfully installed CCGV and everything works great (including the balance showing, emailing, etc.). The only thing that isn't working is the checkbox can't be checked. I have gone over and over and over my backups (where it once worked) but with no success. I have spent the past two weeks working on this and comparing data, etc. etc. Anyone have any ideas?

 

I am attaching my checkout_payment.php file and you can look at my test site at marthasbackyard.co.nz/catalog if you'd like.

 

Thank you for your help!

checkout_payment.php

Share this post


Link to post
Share on other sites

Hi, I finally found the problem and will post in case someone else runs into this.

 

On the checkout_payment.php file, I had the following commented out:

 

<?php /* echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"', true); */ ?>

 

It should have been modified to (and not commented out):

 

 

<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>

 

Still need to test but so far looking good.

Share this post


Link to post
Share on other sites

I've tested the GCGV functionality and the cart & payment seems to be working correctly as follows (using Paypal Express). I've listed four of my testing scenarios below along with the results with the first one being the one that is causing me grief.

 

One:

GC balance exists

'Use GC balance' ticked

Order total is GREATER than GC balance

Select Continue

Paypal (with total order) > Checkout_confirmation (with adjusted amount) > checkout_success

Customer must select 'Confirm Order' for it to be processed by Paypal

Is there anyway to ensure the user is directed to the Checkout_confirmation PRIOR to going to Paypal when the order total exceeds the gift balance available?

 

Two:

GC balance exists

'Use GC balance' unticked

Select continue

Paypal > Checkout_success page

I figure this one is okay as Paypal is processing the order correctly but would be ideal to go to the checkout_confirmation page for consistency.

 

Three:

GC balance exists

'Use GC balance' ticked

Order total is LESS than GC balance

Select Continue

Checkout_Confirmation > checkout_success (no need to go to paypal for this)

 

Four:

GC Balance does not exist

Select Continue to process order

Paypal > Checkout_success

 

I figure this one is okay as Paypal is processing the order correctly but would be ideal to go to the checkout_confirmation page before paypal for consistency.

 

Am happy to post my files is needed and Thx for your help!

Share this post


Link to post
Share on other sites

@@SpencerInTheMiddle thats the thing. When ever I make a purchase the money is received but nothing else happens. After a successful paypal transaction I’m returned to a blank white page (internal error 500) on my site. No code is generated for me to release and no emails are sent telling me about a successful purchase from my site.

 

What process are you using to install this add on? It it some where up on the web and you installed and tested from there or are you doing this locally. I can't understand why no codes are being place in the release table and I figure an email isn't being sent because I haven't confirmed/released the gift certs.

 

Thank you for your time.

Share this post


Link to post
Share on other sites

I have installed CCGV 6 with osC 2..3.1 and PayPal express and it doesn't work. I am getting an internal server error (500) on return to checkout_confirmation.php.

 

(The contribution works fine apart from the PayPal Express checkout, and I can find no obvious errors in the install.)

 

Is CCGV 6 compatible with PayPal Express?

 

Are modifications required to paypal_express.php?

 

If CCGV 6 is incompatible with PayPal Express are there vouchers and coupons modules that DO work with it?

 

Help would be appreciated.

 

 

Debugging doesn't show up much except some non fatal errors on return to checkout_confirmation.php

 

Error Type: [E_NOTICE] Undefined variable: gv_contents_string

On line 111

File includes/modules/boxes/bm_shopping_cart.php

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 

Date / Time: 04-03-2013 23:21:07

Error Type: [E_STRICT] date_default_timezone_get()

On line 54

File includes/functions/compatibility.php

 

You need this:

PayPal Express Checkout for Discount and Extra Fee Order Total Modules

http://addons.oscommerce.com/info/8848

 

It should be possible to modify for CCGV 6

Edited by raiwa

Share this post


Link to post
Share on other sites

Hi,

 

I'm also seeking advice on getting CCGV to give a shipping discount + price discount combo via one single coupon code. Has anyone done this yet?

 

Thank you!

Share this post


Link to post
Share on other sites

I got most of it working, and I'm working on a rewrite for the instructions.

 

Is there anyway to have this working for downloadable files? I have Super Download installed. Please help

 

http://mtrosemedia.tk/store

 

Hi I am just wondering what is this superdownload? I am new to oscommerce. where can i download it from?

Share this post


Link to post
Share on other sites

Hi

I installed CCGV module. I cannot see in the admin section:

module>order total> Gift vouchers.

 

Do u know what i did wrong?

Share this post


Link to post
Share on other sites

This is the REAL fix for the 'cannot redeclare order_total ...line 13' error with Paypal Express & CCGV 6 for 2.3x.

 

http://forums.oscommerce.com/topic/338187-paypal-returning-customer-cannot-redeclare-class-order-total/page__hl__cannot%20redeclare%20class%20order_total#entry1410123

 

In addition to the fixes in this post I also modified files according to the contrib PayPal Express Checkout for Discount and Extra Fee Order Total Modules dated June 2013 by raiwa. Works like a charm on my heavily modded OSC2.3.3, thanks to all who helped resolve this problem it took me almost 24 hrs a ton of reading & a ton of searching this forum but its finally fixed!!!

Share this post


Link to post
Share on other sites

I've been working with this plugin trying to get it install for a couple of months. Has anyone got it working on 2.3.3? if so what was your process? I get redeclare errors on both paypal_standard.php and on ccerr.php. I've noticed that the errors pop up when the amount of the GV fully covers the amount of the purchase. I'm grasping for any help. I've been working on getting this plugin installed for a while and any help would be greatly apreeicated. I've tried using @@gardenho's help above but that doesn't work (no paypal_ipn.php) for me I've also tested it on live websites and on local private servers. I also get a malformated paypal link when the GV covers everything but the shipping. Like I said any help (Links, guesses, magic) would be helpful at this point, I don't know where to go from here.

Share this post


Link to post
Share on other sites

@@pheludar Make sure you copied everything over correctly. The only thing I can think of is that you didn't copy over the files to your webstore site. I hoped you have a backup so you can reinstall it.

Share this post


Link to post
Share on other sites

I have come to the end of my rope on this AddOn..

 

Can someone PLEASE help me. I have added everything, got it all ready to go then when I go to checkout using PayPal Express it will not bring over the discounted total balance.

 

Is there anyway to fix this without having to know 5 tons of programming anything. Cause I do not know anything about it.

 

Thanks so much in advance!! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×