5

we created coupon code, so that that coupon should not work if customer select "Cash on delivery" payment method.

enter image description here

customer will apply coupon in cart page & go to checkout and select Prepaid payment method and no issue here, he can see Discount as below image. [ -139]

enter image description here

Again customer will go back to "Payment information" step & he selects Cash on delivery and go to "Order review" step, he dont see any discount, thats fine.....

enter image description here

But customer become mad and again he go back to "Payment information" & select Prepaid payment method and come to "Order review" step, now he see the Devil that he dont see any discount....

This issue is happening only for new customers in site, for old customers there is no issue....

log errors in app/code/core/Mage/Checkout/Model/Type/Onepage.php

Notice: Array to string conversion in

$send .= $param . '=' . $value . "\r\n";}

Notice: Undefined variable: datasend in

$datasend .= substr($send, 5, -1);

Edit 2

enter image description here

13
  • you can check in this demo site with dummy coupon code : dummy Commented Feb 9, 2017 at 15:00
  • also you need to enter 560043 to see cash on delivery as payment method.... Commented Feb 9, 2017 at 18:28
  • @Nits please enter 560043 under zip code , coupon code name is dummy Commented Feb 10, 2017 at 5:12
  • plz disable cache for some time :)
    – Nits
    Commented Feb 10, 2017 at 5:19
  • @Nits its done cache disabled now..... Commented Feb 10, 2017 at 5:20

3 Answers 3

2
+50

You can add below code in your file at line no. 647 , you had forgot to define variable for $datasend,

$sendNewStr = '';
 foreach ($send as $param=>$value) {
    $sendNewStr .= $param . '=' . $value . "\r\n";
 }
 $datasend = '';
$datasend .= substr($sendNewStr, 5, -1);
7
  • i added your code $sendNewStr = ''; & I tested it many times, still issue is there..... Commented Feb 13, 2017 at 6:26
  • which error are you faced now? Commented Feb 13, 2017 at 6:27
  • in log i am getting Notice: Undefined index: p in app/design/frontend/rwd/theme/template/catalog/category/view.phtml - <?php if($_GET['p']<=1){?> , full code : pastebin.com/F6t0RDcE Commented Feb 13, 2017 at 6:29
  • if(isset($_GET['p']) && !empty($_GET['p'])){ if($_GET['p']<=1) {} } keep your code in condition Commented Feb 13, 2017 at 6:31
  • updated code, still i can see same errors in log..... Commented Feb 13, 2017 at 6:37
2

Before digging into the overall code base, one key statement that you made above made me think that we should look at the overall Shopping Cart Price Rule:

  • Existing users have no problems using the rule.
  • New users are not seeing the discount.

Have you checked to make sure that in the Shopping Cart Price Rule, you rule has everyone selected?

Shopping Cart Price Rule, with only logged in users

Here's the same rule, but with all customer groups selected:

Shopping Cart Price Rule, with ALL users selected

Hopefully this fixes the issue?

If this doesn't fix the issue, I'd recommend testing out the shopping cart price rule on a blank, fresh instance of the Magento 1.x site to see if it works there.

If it does work on a blank, fresh instance, it's likely a code modification or an extension conflict.

I'd recommend running a Magento code audit on the site to see if you have any core file changes or overrides, such as the one here: Free Magento Code Audit Tool

1
  • Thanks for reply, i checked with configuration, its correct..... i will check other tips suggested by you...... Commented Feb 19, 2017 at 18:42
1

Try to perform a reindex and secondly, use native theme (rwd).

6
  • Thanks, i am reindexing now for 20 million products...... Commented Feb 9, 2017 at 18:14
  • rwd is not available, we checked with default theme in another replica site , but issue is still there.... Commented Feb 9, 2017 at 18:36
  • reindexing done, still issue is there..... Commented Feb 9, 2017 at 19:31
  • Try to re-check your promo rules, conditions, validations, active websites and other stuff related. Commented Feb 9, 2017 at 21:54
  • let me update question with full images...... Commented Feb 9, 2017 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.