Not for free shipping. Discount coupons only for a portion of the sale or product ($5 off $30 kind of thing)
Printable View
In case you need it the order total modules installed are: Gift Certificates, Coupons, Group Discounts and Reward Points.
Since none of your coupons offer free shipping, I think that you can solve your issue by changing the sort-order (Modules->Order Total) of the ot_shipping module so that its processing occurs after the coupon, group discount and rewardpoints modules.
That way, the order's total will be reduced by those discount modules and the freeoptions method won't kick in since the order's total is now reduced by any of those deductions.
That method has never worked before I believe it's because freeoptions makes the calculation based on order sub-total and not order total, but I tried it again to see if it would work with OPC with various scenarios.
1) Placed ot_shipping with a value of 1000 which puts it below ot_total leaving all discounts above, and removed the modification from the tpl_modules_opc_submit_block.php file and it didn't work. freeoptions is still applied even though the cart is way below the minimum for free options. Which is exactly what I can't have.
Attachment 18615
2) I placed the modification back on the tpl_modules_opc_submit_block.php file. ot_shipping still below ot_total and it didn't work either. The message that's generated by the code I placed stays on regardless of the shipping method selected unless the shipping method selected increases the order total above the minimum of $100.
Attachment 18616
In scenario 2 above the only problem with the little piece of code I wrote is that it isn't taking into consideration that freeoptions must be selected for the message and the hiding of the buttons to kick in. If another shipping option is selected the message should not appear allowing the checkout process to continue, but that isn't happening and I have no idea how to do it.
You should set the sort-order for ot_shipping to be higher than any of the deduction-type totals, but lower than ot_tax and ot_total.
I see the problem you're describing with the freeoptions shipping method, as you indicated it's looking at the cart-based cost for its calculations rather than the order's current total.
For your needs, your quickest correction is to edit this section in /includes/modules/shipping/freeoptions.php
to readCode:if ($this->ck_freeoptions_total) {
switch (true) {
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='' and MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// free shipping total should not need adjusting
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if (($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
}
}
Code:if ($this->ck_freeoptions_total) {
switch (true) {
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='' and MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// free shipping total should not need adjusting
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if ($order->info['total'] >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN && $order->info['total'] <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
if ($order->info['total'] >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if ($order->info['total'] <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
}
}
I'm going to have to table this for a bit; that freeoptions shipping method is making my head hurt.
I have a weird problem and am hoping someone can point me in the right direction...
ZC 1.5.6, OPC 2.1.3, php 5.5.38
Using PayPal Express and Guest Checkout sometimes comes up with a blank shipping address. Keyword is sometimes and I can't figure out why - the only common factors are PayPal Express and Guest Checkout. It does not happen all the time, so we do have guest orders using PayPal Express and it's all good.
We tried disabling PayPal Guest account (in PayPal account settings), and have tried disabling the PayPal shortcut button on the login page - made no difference.
Attachment 18620
One thing I did notice (although possibly just a coincidence) is that there are 0 orders using PPE with Guest Checkout and different billing/shipping addresses. We do have PPE and different addresses, we do have PayPal Pro and different addresses, we do have PayPal Pro in Guest Checkout with different addresses, but not one PPE in Guest Checkout with different Shipping and Billing addresses. Maybe just a coincidence?
Any ideas? Where do I start? I have both PPE and OPC debug on, but didn't notice anything relevant. TIA
@balihr, besides the PPE/OPC trace-logs were there any debug-logs thrown an/around the time of the missing shipping-address(es)?
Depending on the site in question, i.e. how 'buggy' it is, you might consider installing Report All Errors and setting it for all non-duplicate-constant messages on the storefront. That way, if/when the issue occurs again, there would be additional breadcrumbs left to hone in on the issue's source.
BTW, which sub-version of zc156 is in use?