Re: One-Page Checkout [Support Thread]
OK. It isn't a choice value by design. It needs to set and my "Zen-ability" is not quite there yet. I am using the "zen_draw_hidden_field" to set the value.
As in "'field' => zen_draw_hidden_field('opt_hazmat_handling', '1', $selected)". There is probably a better way to do this that sets the value to be fixed based on products choices on the basket.
Working on it.
TR
Re: One-Page Checkout [Support Thread]
I need to work on my postings. I get a little rushed and it doesn't make quite as much sense I intend. I'll try again.
When I reworked the priority handling code for the hazmat and surcharge fees. I needed the charge to be a defined variable. Either yes or no. There are additional fields added to the products table, 1/0 values as to whether an item requires hazmat shipping or whether an item requires a surcharge fee.
If yes (1) is set for either of the fields it then triggers one or both of the plugins to set the charge and then add to the order total.
In the original plugin, this was a checkbox asking if the customer wanted priority handling. I made it a hidden field and assigned a value of 1.
The code looks like this "'field' => zen_draw_hidden_field('opt_hazmat_handling', '1', $selected)". It works outside of the OPC plugin fine, but now that I have added the OPC to the mix, I can see it still has problems.
1) OPC still sees it as a choice and presents it as something that can be applied (the APPLY button). I think is based on the original plugin being based on the credit component. Not sure I can change the code base without doing a complete rewrite, which is currently outside my scope.
I could rewrite the hidden field code and make it a fixed value but not sure if I am using the correct zen method to accomplish this:
maybe it should be "'field' => zen_draw_hidden_field('opt_hazmat_handling', '1')", but I am not sure if that changes anything.
It just need to be a hidden form field set to true.
After that I need to make the "APPLY" button disappear and get the fee amount back into the OPC order total.
If you have any suggestions please let me know.
Tony
Re: One-Page Checkout [Support Thread]
Yes, any order-total that declares itself as a "credit-class" module will be displayed with an Apply button by OPC. Note that rewriting that checkbox-input to a hidden field will result in the same OPC behavior since the session-related information changes during the confirmation phase of its processing.
Let me "play back" what I "heard" you say in your previous post:
Quote:
For each of your "surcharge" and "hazmat" order-totals, there's an associated flag in a product's database table that indicates whether (1) or not (0) the associated fee should be applied to an order containing one-or-more of those products.
If that's the case, there's a simpler way to code those order-totals ...
Re: One-Page Checkout [Support Thread]
Hi lat9
First of all, thanks very much for bringing this wonderful plugin. Thanks very much.
We're testing this plugin(downloaded from https://github.com/lat9/one_page_checkout, version 1.1.1) under ZC 1.5.5c, and we got some issue with the Reward Points plugin.
We can see the Reward Points section on checkout_one page, but after we check the redeem checkbox ("Point Redeem Method" is set as auto, so by checking the checkbox, all available points will be used) and then click on the Apply button, the page will be refreshed, but the order total is not updated. We've tried set the "Point Redeem Method" as manual, and it is the same.
Parameters posted:
Code:
ecurityToken:e786368f3e580c522b26b589ae06190f
action:process
javascript_enabled:1
shipping_billing:1
comments:
redeem_flag:on
redeem_checkout_flag:
apply_reward_points_x:Apply
dc_redeem_code:
shipping:advshipper_3-0-0
shipping:advshipper_3-0-0
payment:paypalwpp
order_confirmed:0
current_order_total:0
Thanks
Davis
Re: One-Page Checkout [Support Thread]
Hi, y051313! First, a couple of questions:
- Which Reward Points plugin (and which version) are you using?
- Are any myDEBUG logs generated in your store's /logs directory?
- When you view your browser's console (normally by pressing F12 during a browser session, then looking for a "Console" tab), are there javascript and/or jQuery issues noted?
- Is the site publically available? If so, you can send me a link via PM and I can check a couple of things, too.
You can create me a one-page-checkout log file for this case by performing these steps:
- Log into your admin.
- Go to Configuration->One Page Checkout Settings; set the plugin's debug to "true" and make sure that the plugin itself is enabled.
- Place something "rewardable" into your cart, log in to the shop and go to checkout (so you're sitting on the OPC main page).
- Using your FTP program (or similar), go to your store's /logs directory and delete either all myDEBUG-one_page_checkout-*.log files or just the one associated with your customer id (as the last couple of characters in the file's name).
- On the storefront OPC main page, click the "Apply" button associated with the to-be-redeemed points.
- Go to the store's file-system and make a copy of the OPC log file that was generated; let me know via PM and I'll give you a direct email address to which you can send that file.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Hi, y051313! First, a couple of questions:
- Which Reward Points plugin (and which version) are you using?
- Are any myDEBUG logs generated in your store's /logs directory?
- When you view your browser's console (normally by pressing F12 during a browser session, then looking for a "Console" tab), are there javascript and/or jQuery issues noted?
- Is the site publically available? If so, you can send me a link via PM and I can check a couple of things, too.
Hi lat9
The Reward Points plugin we use is reward_point_full_suite 25.e (https://www.zen-cart.com/downloads.php?do=file&id=704 latest version)
Browser console doesn't show any errors, it only shows
Code:
Setting orderConfirmed (0), submitter (null)
(index):217 jQuery version: 1.12.4
I've sent you the site via PM
Re: One-Page Checkout [Support Thread]
Hi lat9
We've find a solution with for the reward_point_full_suite 25.e issue (https://www.zen-cart.com/downloads.php?do=file&id=704 latest version).
It looks like the $_POST parameter was not passed into the reward module, so we have used session instead of post.
The change was made on /includes/modules/order_total/ot_reward_points.php, in function function collect_posts(), add below code
PHP Code:
if (isset($_SESSION['redeem_flag']) && $_SESSION['redeem_flag'])
$_POST['redeem_flag'] = $_SESSION['redeem_flag'];
Besides, /includes/modules/page/checkout_one_confirmation/header_php.php, add below code after the "require_once (DIR_WS_CLASSES . 'http_client.php');
"
PHP Code:
if((isset($_POST['redeem_flag']) && $_POST['redeem_flag']))
$_SESSION['redeem_flag'] = $_POST['redeem_flag'];
else
unset($_SESSION['redeem_flag']);
Best
Davis
Re: One-Page Checkout [Support Thread]
Btw, we also noticed 2 more issues:
1. in case user uncheck "shipping address same as billing address" checkbox, then select a shipping address with different country (e.g. billing address is US address, and shipping address is UK one), and then check "shipping address same as billing address" checkbox again, the shipping options list won't be updated (still the options available for UK address).
2. If user use a 100% coupon, which makes order total becomes zero, and then click on the confirm order button, he will be redirected back to checkout_one page, with error msg "Your order's details have changed. Please review the current values and re-submit."
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
y051313
Hi lat9
We've find a solution with for the reward_point_full_suite 25.e issue (
https://www.zen-cart.com/downloads.php?do=file&id=704 latest version).
It looks like the $_POST parameter was not passed into the reward module, so we have used session instead of post.
The change was made on /includes/modules/order_total/ot_reward_points.php, in function function collect_posts(), add below code
PHP Code:
if (isset($_SESSION['redeem_flag']) && $_SESSION['redeem_flag'])
$_POST['redeem_flag'] = $_SESSION['redeem_flag'];
Besides, /includes/modules/page/checkout_one_confirmation/header_php.php, add below code after the "require_once (DIR_WS_CLASSES . 'http_client.php');
"
PHP Code:
if((isset($_POST['redeem_flag']) && $_POST['redeem_flag']))
$_SESSION['redeem_flag'] = $_POST['redeem_flag'];
else
unset($_SESSION['redeem_flag']);
Best
Davis
Thanks for that, Davis. I will update the OPC readme with integration notes and identify those changes as required when a store also uses ot_reward_points.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
y051313
Btw, we also noticed 2 more issues:
1. in case user uncheck "shipping address same as billing address" checkbox, then select a shipping address with different country (e.g. billing address is US address, and shipping address is UK one), and then check "shipping address same as billing address" checkbox again, the shipping options list won't be updated (still the options available for UK address).
2. If user use a 100% coupon, which makes order total becomes zero, and then click on the confirm order button, he will be redirected back to checkout_one page, with error msg "Your order's details have changed. Please review the current values and re-submit."
I have reproduced issue#2 (and created an associated GitHub issue); I'll need a bit of time to attempt to reproduce the first.