Jump to content
Vger

[CONTRIBUTION] CCGV (trad)

Recommended Posts

Hi, it's first time using CCGV (and osCommerce) so please excuse if my question is a bit off. :D

I followed all the steps in "ReadFirst.html" file upto "List of Files to be Edited". My question is if I can just overwrite existing files with ones provided if no other contribution (or myself) modified them. Thank you.

Share this post


Link to post
Share on other sites

Yes, you can just overwrite files, if you have made no other modifications to your website.

 

Vger

Share this post


Link to post
Share on other sites

I seem to have run into another small issue!

 

The contrib seems to have installed properly, but when I generate a discount coupon and email it to someone, when they try to use it at checkout they get an 'invalid coupon code' message. I have tried copy and pasting the code, and also typing from fresh but both ways generate the same error.

 

Any ideas?

 

Many thanks (again ;) )

 

Mark.

Share this post


Link to post
Share on other sites
I seem to have run into another small issue!

 

The contrib seems to have installed properly, but when I generate a discount coupon and email it to someone, when they try to use it at checkout they get an 'invalid coupon code' message. I have tried copy and pasting the code, and also typing from fresh but both ways generate the same error.

 

Any ideas?

 

Many thanks (again ;) )

 

Mark.

 

Please ignore...I must have been doing something silly....seems to be working as expected :blush:

 

 

:thumbsup:

Share this post


Link to post
Share on other sites

After installing CCGV, if I click on "check out" I get "Fatal error: Cannot redeclare tep_show_category() (previously declared in /mnt/web_o/d02/s11/b0271738/www/includes/header.php:266)". I read someone wrote: move tep_show_category() function from header.php and categories.php to general.php. Is this proper solution?

Share this post


Link to post
Share on other sites

I don't know why you are getting that error, but it's nothing to do with CCGV.

 

Vger

Share this post


Link to post
Share on other sites
After installing CCGV, if I click on "check out" I get "Fatal error: Cannot redeclare tep_show_category() (previously declared in /mnt/web_o/d02/s11/b0271738/www/includes/header.php:266)". I read someone wrote: move tep_show_category() function from header.php and categories.php to general.php. Is this proper solution?

do you have your header in cart or something?

 

maybe thats partly why the error is coming up.... it is strange to see the: xxx/includes/header.php error!

 

doesn't look like a CCGV error I have ever seen before, even on the original thread


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

i dun seem to be getting any "send link" in the email that contain the voucher. Am I missing something?

 

the mail:

You can redeem this coupon during checkout. Just enter the code in the

box provided, and click on the redeem button.

 

The coupon code is 8f15ef

 

Don't lose the coupon code, make sure to keep the code safe so you can

benefit from this special offer.

 

when you visit http://www.firemax.com.sg/catalog/

Share this post


Link to post
Share on other sites

I found <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> in line 202 in checkout_shipping.php without "// CCGV" comment.

It seems checkout_shipping.php includes colum_left.php and header.php; and colum_left.php includes categories.php.

Now categories.php and header.php both have function called tep_show_category() and that's why it cannot redeclear??

And I got the problem because I just overwrote the file while others searched for the // CCGV comment and modified their files??

Am I on the right track or all screwed up? :blink:

 

By the way, Happy Easter!

Share this post


Link to post
Share on other sites

Oh and another thing, I dun have a send voucher link on the right column even after I have send out the coupon in the admin panel. I tried sending the voucher manually thru the send voucher option in account page but it gave an "invalid amount" error.

 

thks for any help in advance (",)

Share this post


Link to post
Share on other sites

Hi

 

Please forgive the rhetorical and perhaps naiive question, :-" but I read the info on install with this contrib that says it only works with OSCIPN 1+

 

....but noticed that OSC IPN 1.1 has flaws that allow downloads by backing out of the confirm payment just on entering paypal but before paying and permitting a customer to return to their account and see the downlaod link and download a product (as noted in the Paypal IPN 3.15 by devsc thread in contrib support section.... note devsc's ipn3.15 contrib fixes that flaw)

 

SO... I know that that the answer is that ccgv (trad) was made for OSC IPN1+........ but shouldnt it make more sense to port it to a Paypal contrib that actually works properly?

 

[i'm now bracing myself for an onslaught of insults]

 

In good faith ;)

 

W

Share this post


Link to post
Share on other sites
i'm now bracing myself for an onslaught of insults

 

No, more an onslaught of laughter. What does that have to do with CCGV? CCGV(trad) queues all Gift Voucher releases, so they have to be released by the website admin, and this doesn't take place until the site admin has confirmed the payment has actualy been made. No 'download' happens unless the Voucher has been manually released.

 

Yes, there are problems with the osCommerce Pay Pal IPN, but the advantage of it is that you don't have to alter hundreds of files to install it, and it doesn't impact upon your ability to later on add other contributions.

 

Vger

Share this post


Link to post
Share on other sites
No, more an onslaught of laughter. What does that have to do with CCGV? CCGV(trad) queues all Gift Voucher releases, so they have to be released by the website admin, and this doesn't take place until the site admin has confirmed the payment has actualy been made. No 'download' happens unless the Voucher has been manually released.

 

Yes, there are problems with the osCommerce Pay Pal IPN, but the advantage of it is that you don't have to alter hundreds of files to install it, and it doesn't impact upon your ability to later on add other contributions.

 

Vger

 

Hi Vger

 

thanks for the response. I understand your point, but I didnt know if I could use THIS CCGV trad with devsc IPN 3.15

 

So... there is still an issue if I want an immediate download store for for example audio media?

The problem for me (and I guess a lot of people) is that I dont think a lot of customers want to wait for me to wake up in the morning to authorize their downlaod if they buy while Im asleep?

Share this post


Link to post
Share on other sites

CCGV(trad) harks back to the older (working) version of CCGV (5.10c) with a few security fixes added and some changes introduced by myself. In particular it is not suitable for sites which wish to offer immediate downloads of products, so won't be suitable for your website.

 

It was put together so as to automatically queue all purchases of Gift Vouchers, and I have removed the 'True/False' buttons for changing that setting in osCommerce admin. I have added the ability to delete queued Gift Vouchers - previously this had to be done via the database.

 

Gift Vouchers are purchased and sent to the purchaser, who then sends them on to the intended recipient. I don't see why anyone would want to buy a Gift Voucher to then spend themselves on a downloadable product.

 

Vger

Share this post


Link to post
Share on other sites
CCGV(trad) harks back to the older (working) version of CCGV (5.10c) with a few security fixes added and some changes introduced by myself. In particular it is not suitable for sites which wish to offer immediate downloads of products, so won't be suitable for your website.

 

It was put together so as to automatically queue all purchases of Gift Vouchers, and I have removed the 'True/False' buttons for changing that setting in osCommerce admin. I have added the ability to delete queued Gift Vouchers - previously this had to be done via the database.

 

Gift Vouchers are purchased and sent to the purchaser, who then sends them on to the intended recipient. I don't see why anyone would want to buy a Gift Voucher to then spend themselves on a downloadable product.

 

Vger

I would like to suggest a compromise for the next release Vger...... (if you don't mind)

 

I have the highest regard for you because you have given osCommerce advice to me for maybe a year and a half and you are avery valued member of the osC team but maybe re-adding the TRUE/FALSE button isn't a bad thing because there are those who need the Gift Voucher released immediately for downloads.

 

Yes it is a security hazard but if the seller is prepared to live withthat then why not let them?

 

At least if they have a 'TRUE/FALSE' button then they can revert to the GV QUEUE system if (or when) they have their fingers burn't and decide that the queue system is better after all!

 

As for people buying a Gift Voucher and spending it on themselves on downloadable products, I can only say that there are sites out there that allow customers to buy a 5, 10, 25 etc Gift Voucher and allow them to keep it as a balance on their account for any downloads - I have seen them.

 

I really think the 'immediate delete' button should be a 'delete' button which then leads on to a 'are you sure you want to delete', this is because there is a safety buffer incase an error is made. As it stands the queued voucher is deleted as soon as the button is pressed once.


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

I have already explained to people in this thread that if they wish to enable immediate release of Gift Vouchers they only have to change one True to False in the SQL file that comes with the contribution.

 

I won't be re-applying the True/False buttons in admin for this contribution, because I truly believe that to use Gift Vouchers without a queueing system is a security mistake. If people wish to have that functionality then they can re-add it for themselves or use one of the other variants of CCGV that has this functionality.

 

Most site owners who come to these forums are inexperienced at running an e-commerce website. They know the features that they want for their site but have't necessarily thought through the security implications of the contributions they apply. Experienced site owners can easily re-add the functionality for themselves, while queueing Gift Vouchers will protect the inexperienced.

 

I have said that I will look into a 'Confirm' stage for deleting of queued vouchers, as soon as I have the time to implement it.

 

Vger

Share this post


Link to post
Share on other sites

Hi,

 

I've installed CCGV (trad) on a fresh installation of the latest version of osCommerce, I've run the SQL, and I've confirmed that both Discount Coupons and Gift Vouchers are installed in Modules -> Order Total.

 

I installed CCGV by simply ftping all the CCGV files over the top of the existing osCommerce files.

 

I have created a coupon as follows:

 

Discount Coupons

 

Coupon Name 20% Off

Coupon Name

Coupon Name

Coupon Description 20% Off Everything in the Store

Coupon Description

Coupon Description

Coupon Amount 20.0000%

Coupon Minimum Order 25.0000

Free Shipping No Free Shipping

Coupon Code a196b1

Uses per Coupon 10

Uses per Customer 1

Valid Product List

Valid Categories List

Start Date 04/16/2006

End Date 2006-04-16 04/16/2007

 

 

 

 

My problem is that I can't get the box to appear for the customer to enter the coupon code. I am ordering products in excess of $25.

 

Please help... I'm sure this is something simple I've overlooked as no one else seems to have had this problem, but I can't see what it is.

 

Many thanks!

Share this post


Link to post
Share on other sites

Has anyone seen this error after a customer sends the gift certificate to someone?

 

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /home/USERNAME/public_html/catalog/includes/functions/database.php on line 112

 

I followed install to t but appears may have mucked something up. Everything works fine but as the gv_send.php?action=process page showed up with the confirmation of email sent (and email was sent fine) this error is across top of page.


Paul ------------

Share this post


Link to post
Share on other sites
My problem is that I can't get the box to appear for the customer to enter the coupon code. I am ordering products in excess of $25.

 

Please help... I'm sure this is something simple I've overlooked as no one else seems to have had this problem, but I can't see what it is.

 

Many thanks!

have a look at your checkout_payment.php file to see if you uploaded that


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
have a look at your checkout_payment.php file to see if you uploaded that

 

 

Chooch! Thanks so much... I deleted that file, and ftp'd it again and it now appears. Many thanks for the quick response.

Share this post


Link to post
Share on other sites

hi there, i just installed the mod but now i get this at the top of my checkout_payment.php

 

tle, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_PAYPAL_ID','".STORE_OWNER_EMAIL_ADDRESS."', 'The e-mail address to use for the PayPal service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Business ID', 'MODULE_PAYMENT_PAYPAL_BUSINESS_ID','".STORE_OWNER_EMAIL_ADDRESS."', 'Email address or account ID of the payment recipient', '6', '', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Default Currency', 'MODULE_PAYMENT_PAYPAL_DEFAULT_CURRENCY', 'USD', 'The default currency to use for when the customer chooses to checkout via the store using a currency not supported by PayPal.
(This currency must exist in your store)', '6', '0', 'tep_cfg_select_option(array(\'USD\',\'CAD\',\'EUR\',\'GBP\',\'JPY\',\'AUD\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPAL_CURRENCY', 'Selected Currency', 'The currency to use for credit card transactions', '6', '0', 'tep_cfg_select_option(array(\'Selected Currency\',\'Only USD\',\'Only CAD\',\'Only EUR\',\'Only GBP\',\'Only JPY\',\'Only AUD\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the Pending Notification status of orders made with this payment module to this value (\'Pending\' recommended)', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of orders made with this payment module to this value
(\'Processing\' recommended)', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set On Hold Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of On Hold orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Canceled Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of Canceled orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Synchronize Invoice', 'MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED', 'False', 'Do you want to specify the order number as the PayPal invoice number?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Refunded Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_REFUNDED_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of Refunded orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Background Color', 'MODULE_PAYMENT_PAYPAL_CS', 'White', 'Select the background color of PayPal\'s payment pages.', '6', '0', 'tep_cfg_select_option(array(\'White\',\'Black\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Processing logo', 'MODULE_PAYMENT_PAYPAL_PROCESSING_LOGO', 'oscommerce.gif', 'The image file name to display the store\'s checkout process', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Store logo', 'MODULE_PAYMENT_PAYPAL_STORE_LOGO', '', 'The image file name for PayPal to display (leave empty if your store does not have SSL)', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPal Page Style Name', 'MODULE_PAYMENT_PAYPAL_PAGE_STYLE', 'default', 'The name of the page style you have configured in your PayPal Account', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Include a note with payment', 'MODULE_PAYMENT_PAYPAL_NO_NOTE', 'No', 'Choose whether your customer should be prompted to include a note or not?', '6', '0', 'tep_cfg_select_option(array(\'Yes\',\'No\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shopping Cart Method', 'MODULE_PAYMENT_PAYPAL_METHOD', 'Aggregate', 'What type of shopping cart do you want to use?', '6', '0', 'tep_cfg_select_option(array(\'Aggregate\',\'Itemized\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Shipping Address', 'MODULE_PAYMENT_PAYPAL_SHIPPING_ALLOWED', 'No', 'Allow the customer to choose their own PayPal shipping address?', '6', '0', 'tep_cfg_select_option(array(\'Yes\',\'No\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Email Notifications', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG', 'Yes', 'Enable debug email notifications', '6', '0', 'tep_cfg_select_option(array(\'Yes\',\'No\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Digest Key', 'MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY', 'PayPal_Shopping_Cart_IPN', 'Key to use for the digest functionality', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test Mode', 'MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE', 'Off', 'Set test mode [IPN Test Panel]', '6', '0', 'tep_cfg_select_option(array(\'Off\',\'On\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Cart Test', 'MODULE_PAYMENT_PAYPAL_IPN_CART_TEST', 'On', 'Set cart test mode to verify the transaction amounts', '6', '0', 'tep_cfg_select_option(array(\'Off\',\'On\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug Email Notification Address', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL','".STORE_OWNER_EMAIL_ADDRESS."', 'The e-mail address to send debug notifications to', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PayPal Domain', 'MODULE_PAYMENT_PAYPAL_DOMAIN', 'www.paypal.com', 'Select which PayPal domain to use
(for live production select www.paypal.com)', '6', '0', 'tep_cfg_select_option(array(\'www.paypal.com\',\'www.sandbox.paypal.com\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Return URL behavior', 'MODULE_PAYMENT_PAYPAL_RM', '1', 'How should the customer be sent back from PayPal to the specified URL?
0=No IPN, 1=GET, 2=POST', '6', '0', 'tep_cfg_select_option(array(\'0\',\'1\',\'2\'), ', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array( 'MODULE_PAYMENT_PAYPAL_STATUS', 'MODULE_PAYMENT_PAYPAL_ID', 'MODULE_PAYMENT_PAYPAL_BUSINESS_ID', 'MODULE_PAYMENT_PAYPAL_DEFAULT_CURRENCY', 'MODULE_PAYMENT_PAYPAL_CURRENCY', 'MODULE_PAYMENT_PAYPAL_ZONE', 'MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_ORDER_REFUNDED_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED', 'MODULE_PAYMENT_PAYPAL_SORT_ORDER', 'MODULE_PAYMENT_PAYPAL_CS', 'MODULE_PAYMENT_PAYPAL_PROCESSING_LOGO', 'MODULE_PAYMENT_PAYPAL_STORE_LOGO', 'MODULE_PAYMENT_PAYPAL_PAGE_STYLE', 'MODULE_PAYMENT_PAYPAL_NO_NOTE', 'MODULE_PAYMENT_PAYPAL_METHOD', 'MODULE_PAYMENT_PAYPAL_SHIPPING_ALLOWED', 'MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE', 'MODULE_PAYMENT_PAYPAL_IPN_CART_TEST', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL', 'MODULE_PAYMENT_PAYPAL_DOMAIN', 'MODULE_PAYMENT_PAYPAL_RM'); } function setTransactionID() { global $order, $currencies; $my_currency = $this->currency(); $trans_id = STORE_NAME . date('Ymdhis'); $this->digest = md5($trans_id . number_format($order->info['total'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency), '.', '') . MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY); return $this->digest; } function formFields($txn_sign = '', $payment_amount = '', $payment_currency = '', $payment_currency_value = '', $orders_id = '', $return_url = '', $cancel_url = '' ) { global $order, $currencies; $my_currency = (!empty($payment_currency)) ? $payment_currency : $this->currency(); $my_currency_value = (!empty($payment_currency_value)) ? $payment_currency_value : $currencies->get_value($my_currency); //Merchant Info $paypal_fields = tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_BUSINESS_ID); //Currency $paypal_fields .= tep_draw_hidden_field('currency_code', $my_currency); //Shopping Cart Info if(MODULE_PAYMENT_PAYPAL_METHOD == 'Itemized') { $paypal_fields .= tep_draw_hidden_field('upload', sizeof($order->products)) . tep_draw_hidden_field('redirect_cmd', '_cart') . tep_draw_hidden_field('handling_cart', number_format(/*$order->info['shipping_cost']*/0 * $my_currency_value, $currencies->get_decimal_places($my_currency))); //Itemized Order Details for ($i=0,$index=1; $iproducts); $i++, $index++) { //$index = $i+1; $paypal_fields .= tep_draw_hidden_field('item_name_'.$index, $order->products[$i]['name']). tep_draw_hidden_field('item_number_'.$index, $order->products[$i]['model']). tep_draw_hidden_field('quantity_'.$index, $order->products[$i]['qty']). tep_draw_hidden_field('amount_'.$index, number_format($order->products[$i]['final_price']* $my_currency_value,2)); $tax = ($order->products[$i]['final_price'] * ($order->products[$i]['tax'] / 100)) * $my_currency_value; $paypal_fields .= tep_draw_hidden_field('tax_'.$index, number_format($tax, 2)); //Customer Specified Product Options: PayPal Max = 2 if ($order->products[$i]['attributes']) { //$n = sizeof($order->products[$i]['attributes']); for ($j=0; $j<2; $j++) { if($order->products[$i]['attributes'][$j]['option']){ $paypal_fields .= $this->optionSetFields($j,$index,$order->products[$i]['attributes'][$j]['option'],$order->products[$i]['attributes'][$j]['value']); } else { $paypal_fields .= $this->optionSetFields($j,$index); } } } else { for ($j=0; $j<2; $j++) { $paypal_fields .= $this->optionSetFields($j,$index); } } } } else { //Aggregate Cart (Method 1) $paypal_fields .= tep_draw_hidden_field('item_name', STORE_NAME) . tep_draw_hidden_field('redirect_cmd', '_xclick') . tep_draw_hidden_field('amount', !empty($payment_amount) ? $payment_amount : $this->amount($my_currency)) . tep_draw_hidden_field('shipping', number_format(/*$order->info['shipping_cost']*/0 * $my_currency_value, $currencies->get_decimal_places($my_currency))); $item_number = ''; for ($i=0; $iproducts); $i++) $item_number .= ' '.$order->products[$i]['name'].' ,'; $item_number = substr_replace($item_number,'',-2); $paypal_fields .= tep_draw_hidden_field('item_number', $item_number); } //Synchronize invoice if(MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED == 'True') $paypal_fields .= tep_draw_hidden_field('invoice', !empty($orders_id) ? $orders_id : $this->orders_id); //Allow customer to choose their own shipping address if(MODULE_PAYMENT_PAYPAL_SHIPPING_ALLOWED == 'No' ) $paypal_fields .= tep_draw_hidden_field('no_shipping', '1' ); //Customer registration fields $paypal_fields .= $this->customerDetailsFields($order); //Customer comment field $paypal_fields .= $this->noteOptionFields(MODULE_PAYMENT_PAYPAL_NO_NOTE , MODULE_PAYMENT_PAYPAL_CUSTOMER_COMMENTS); //Store Logo if(tep_not_null(MODULE_PAYMENT_PAYPAL_STORE_LOGO)) $paypal_fields .= tep_draw_hidden_field('image_url', tep_href_link(DIR_WS_IMAGES.MODULE_PAYMENT_PAYPAL_STORE_LOGO, '', 'SSL',false)); //PayPal background color $paypal_fields .= tep_draw_hidden_field('cs',(MODULE_PAYMENT_PAYPAL_CS == 'White') ? '0' : '1'); //PayPal page style if(tep_not_null(MODULE_PAYMENT_PAYPAL_PAGE_STYLE)) $paypal_fields .= tep_draw_hidden_field('page_style',MODULE_PAYMENT_PAYPAL_PAGE_STYLE); //PayPal Store Config $paypal_fields .= tep_draw_hidden_field('custom', !empty($txn_sign) ? $txn_sign : $this->digest) . tep_draw_hidden_field('return', !empty($return_url) ? $return_url : tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=success', 'SSL')) . tep_draw_hidden_field('cancel_return', !empty($cancel_url) ? $cancel_url : tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')) . tep_draw_hidden_field('notify_url', tep_href_link(FILENAME_IPN, '', 'SSL',false)) . tep_draw_hidden_field('rm', MODULE_PAYMENT_PAYPAL_RM) . tep_draw_hidden_field('bn', 'osc-ipn-v1'); return $paypal_fields; } function customerDetailsFields(&$order) { //Customer Details - for those who haven't signed up to PayPal $paypal_fields = tep_draw_hidden_field('cmd', '_ext-enter') . //allows the customer addr details to be passed tep_draw_hidden_field('email', $order->customer['email_address']) . tep_draw_hidden_field('first_name', $order->billing['firstname']) . tep_draw_hidden_field('last_name', $order->billing['lastname']) . tep_draw_hidden_field('address1', $order->billing['street_address']) . tep_draw_hidden_field('address2', $order->billing['suburb']) . tep_draw_hidden_field('city', $order->billing['city']) . tep_draw_hidden_field('state', tep_get_zone_code($order->billing['country']['id'],$order->billing['zone_id'],$order->billing['zone_id'])) . tep_draw_hidden_field('zip', $order->billing['postcode']) . //Note: Anguilla[AI], Dominican Republic[DO], The Netherlands[NL] have different codes to the iso codes in the osC db tep_draw_hidden_field('country', $order->billing['country']['iso_code_2']); //Telephone is problematic. /*//OMITTED SINCE NOT SPECIFICALLY BILLING ADDRESS RELATED $telephone = preg_replace('/\D/', '', $order->customer['telephone']); $paypal_fields .= tep_draw_hidden_field('night_phone_a',substr($telephone,0,3)); $paypal_fields .= tep_draw_hidden_field('night_phone_b',substr($telephone,3,3)); $paypal_fields .= tep_draw_hidden_field('night_phone_c',substr($telephone,6,4)); $paypal_fields .= tep_draw_hidden_field('day_phone_a',substr($telephone,0,3)); $paypal_fields .= tep_draw_hidden_field('day_phone_b',substr($telephone,3,3)); $paypal_fields .= tep_draw_hidden_field('day_phone_c',substr($telephone,6,4)); */ //Flow Language $paypal_fields .= tep_draw_hidden_field('lc', $order->billing['country']['iso_code_2']); return $paypal_fields; } function optionSetFields($sub_index,$index,$option=' ',$value=' ') { return tep_draw_hidden_field('on'.$sub_index.'_'.$index,$option). tep_draw_hidden_field('os'.$sub_index.'_'.$index,$value); } function noteOptionFields($option='No',$msg='Add Comments About Your Order') { $option = ($option == 'Yes') ? '0': '1'; $no_note = tep_draw_hidden_field('no_note',$option); if (!$option) return $no_note .= tep_draw_hidden_field('cn',$msg); else return $no_note; } function sendMoneyFields(&$order, $orders_id) { include_once(DIR_WS_MODULES . 'payment/paypal/database_tables.inc.php'); $orders_session_query = tep_db_query("select firstname, lastname, payment_amount, payment_currency, payment_currency_val, txn_signature from " . TABLE_ORDERS_SESSION_INFO . " where orders_id ='" . (int)$orders_id . "'"); $orders_session_info = tep_db_fetch_array($orders_session_query); $order->billing['firstname'] = $orders_session_info['firstname']; $order->billing['lastname'] = $orders_session_info['lastname']; $return_href_link = tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id='.$orders_id, 'SSL'); $cancel_href_link = $return_href_link; return $this->formFields($orders_session_info['txn_signature'], $orders_session_info['payment_amount']/* - $order->info['shipping_cost']*/, $orders_session_info['payment_currency'], $orders_session_info['payment_currency_val'], $orders_id, $return_href_link, $cancel_href_link); } }//end class ?>

Share this post


Link to post
Share on other sites

ok, i got the error to go away, sorry for the big mess of text in my last post. I wish there was a way to edit your posts here.

Share this post


Link to post
Share on other sites

OH NO...my cart is down now, problem is, its a live cart

 

when i go to the cart, i get this

 

Fatal error: Cannot redeclare create_coupon_code() (previously declared in /mounted-storage/home13/sub004/sc12844-MMOB/www/catalog/includes/add_ccgvdc_application_top.php:36) in /mounted-storage/home13/sub004/sc12844-MMOB/www/catalog/includes/add_ccgvdc_application_top.php on line 36

 

here is my line 36

  function create_coupon_code($salt="secret", $length = SECURITY_CODE_LENGTH) {

 

this is what is after it

  $ccid = md5(uniqid("","salt"));
$ccid .= md5(uniqid("","salt"));
$ccid .= md5(uniqid("","salt"));
$ccid .= md5(uniqid("","salt"));
srand((double)microtime()*1000000); // seed the random number generator
$random_start = @rand(0, (128-$length));
$good_result = 0;
while ($good_result == 0) {
  $id1=substr($ccid, $random_start,$length);		
  $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");	
  if (tep_db_num_rows($query) == 0) $good_result = 1;
}
return $id1;
 }

 

please help :(

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

×