Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

Hello all, I tried to find more info but did not find my problem nor a solution anywhere.

In my webshop I installed Paypal Express in combination with the add-on "discount code".

I run Oscommerce 2.3.3 and added discount_code_3.2 in combintion with discount_code_paypal_support_for_oscommerce_online_merchant.2.3.1-no1.zip.

 

When checking out everything seems to work fine and the correct amount is displayed on the Paypal page. But when checking the actual payment the discount is not substracted and the full price is charged anyway.

 

I have been looking very careful at the above zipfile and actually I can not find any difference in the function checkout_initialization_method() {... that is supposed to be replaced and changed by the function in this add.

Can anyone tell me what I may have overlooked and should change?

 

Thank you so much in advance for your attention!

Astrid

Edited by Astrid1.0
  • 2 weeks later...
Posted

Hello all, So far I have still not been able to figure out what goes wrong when customers check out with paypal Express when using a discount code and I would appreciate your help.

 

I have installed the following contributions and all seems to work fine exept for the display of correct the images when typing a discount code. (So I took out the coding of the images) and, this is the problem, the discount is NOT substracted from the total amount in the actual payment.

 

1) discount_code_3.1.1.full_for_oscommerce_online_merchant.2.3.1.zip

2) discount_code_3.2_for_oscommerce_online_merchant.2.3.1.zip

3) discount_code_paypal_support_for_oscommerce_online_merchant.2.3.1-no1.zip

and

4) Paypal_Expresscheckout_OT_Modules.zip

 

So in short the customer sees all figures, including discount, displayed correctly on the Paypal pages but when checking out the payment you discoverthat you have paid the full amount.

 

In contribution 3) The read-me instructions inform me to do the following:

========================================

1. Modify the catalog/includes/modules/payment/paypal_express.php file.

Find:

 

function checkout_initialization_method() {

global $cart;

 

if (MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_IMAGE == 'Dynamic') {

if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {

$image_button = 'https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image';

} else {

$image_button = 'https://fpdbs.sandbox.paypal.com/dynamicimageweb?cmd=_dynamic-image';

}

 

$params = array('locale=' . MODULE_PAYMENT_PAYPAL_EXPRESS_LANGUAGE_LOCALE);

 

if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) {

$response_array = $this->getPalDetails();

 

if (isset($response_array['PAL'])) {

$params[] = 'pal=' . $response_array['PAL'];

$params[] = 'ordertotal=' . $this->format_raw($cart->show_total());

}

}

 

if (!empty($params)) {

$image_button .= '&' . implode('&', $params);

}

} else {

$image_button = MODULE_PAYMENT_PAYPAL_EXPRESS_BUTTON;

}

 

$string = '<a href="' . tep_href_link('ext/modules/payment/paypal/express.php', '', 'SSL') . '"><img src="' . $image_button . '" border="0" alt="" title="' . tep_output_string_protected(MODULE_PAYMENT_PAYPAL_EXPRESS_TEXT_BUTTON) . '" /></a>';

 

return $string;

}

 

Replace with:

 

// Discount Code - start

/*

function checkout_initialization_method() {

global $cart;

 

if (MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_IMAGE == 'Dynamic') {

if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {

$image_button = 'https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image';

} else {

$image_button = 'https://fpdbs.sandbox.paypal.com/dynamicimageweb?cmd=_dynamic-image';

}

 

$params = array('locale=' . MODULE_PAYMENT_PAYPAL_EXPRESS_LANGUAGE_LOCALE);

 

if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) {

$response_array = $this->getPalDetails();

 

if (isset($response_array['PAL'])) {

$params[] = 'pal=' . $response_array['PAL'];

$params[] = 'ordertotal=' . $this->format_raw($cart->show_total());

}

}

 

if (!empty($params)) {

$image_button .= '&' . implode('&', $params);

}

} else {

$image_button = MODULE_PAYMENT_PAYPAL_EXPRESS_BUTTON;

}

 

$string = '<a href="' . tep_href_link('ext/modules/payment/paypal/express.php', '', 'SSL') . '"><img src="' . $image_button . '" border="0" alt="" title="' . tep_output_string_protected(MODULE_PAYMENT_PAYPAL_EXPRESS_TEXT_BUTTON) . '" /></a>';

 

return $string;

}

*/

// Discount Code - end

====================================================

 

Actually I don't see any difference between the original and the replacement coding so maybe there should be some coding that is left out.

 

I really appreciate any help in this

regards, Astrid

Posted

With trial and error I eventually discovered that the wrong total - $params['AMT'] - that is send to Paypal is generated in the file - paypas_express.php - before the discount is calculated. I have not been able to change this. To overcome this problem I now use an additional file in which some discount codes are define in combination with the relevant discount. These values are passed to the - function before_process() - in the paypal_express.php file. With this addition the discount that is calculated in the total and in the paid amount is correct.

 

Anyway, thank you for your attention and help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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