Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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
Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

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!

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
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.

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
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
Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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!

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 2 weeks later...

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

 

http://www.oscommerce.com/forums/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!!!

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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!! :)

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