Zen Cart Logo
Forums / All Other Contributions/Addons / One-Page Checkout [Support Thread]

One-Page Checkout [Support Thread]

Views: 629,211

Results 401 to 420 of 3,073
9 Apr 2017, 7:46 PM
#401
tonyreynolds avatar

tonyreynolds

New Zenner

Join Date:
Dec 2012
Posts:
68
Plugin Contributions:
0

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

10 Apr 2017, 5:46 AM
#402
tonyreynolds avatar

tonyreynolds

New Zenner

Join Date:
Dec 2012
Posts:
68
Plugin Contributions:
0

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

10 Apr 2017, 11:53 AM
#403
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

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:

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

14 Apr 2017, 8:00 AM
#404
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

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:```
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
14 Apr 2017, 11:38 AM
#405
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Hi, y051313! First, a couple of questions:

  1. Which Reward Points plugin (and which version) are you using?
  2. Are any myDEBUG logs generated in your store's /logs directory?
  3. 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?
  4. 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:

  1. Log into your admin.
  2. Go to Configuration->One Page Checkout Settings; set the plugin's debug to "true" and make sure that the plugin itself is enabled.
  3. Place something "rewardable" into your cart, log in to the shop and go to checkout (so you're sitting on the OPC main page).
  4. 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).
  5. On the storefront OPC main page, click the "Apply" button associated with the to-be-redeemed points.
  6. 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.
15 Apr 2017, 12:32 PM
#406
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Hi, y051313! First, a couple of questions:

  1. Which Reward Points plugin (and which version) are you using?
  1. Are any myDEBUG logs generated in your store's /logs directory?
  1. 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?
  1. 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

Setting orderConfirmed (0), submitter (null)
(index):217 jQuery version: 1.12.4

I've sent you the site via PM

21 Apr 2017, 3:54 AM
#407
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

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

		
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');
"

if((isset($_POST['redeem_flag']) && $_POST['redeem_flag']))
    $_SESSION['redeem_flag'] = $_POST['redeem_flag'];
else
    unset($_SESSION['redeem_flag']);

Best
Davis

21 Apr 2017, 3:59 AM
#408
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

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

21 Apr 2017, 12:02 PM
#409
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

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

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

21 Apr 2017, 12:08 PM
#410
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

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.

21 Apr 2017, 7:41 PM
#411
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

frank18:

Meanwhile, in includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_one_confirmation_default.php I changed this part

<?php if ($order->info['shipping_method']) { ?>
    <h3 id="checkoutConfirmDefaultShipment"><?php echo HEADING_SHIPPING_METHOD; ?></h3>
    <h4 id="checkoutConfirmDefaultShipmentTitle"><?php echo $order->info['shipping_method']; ?></h4>
<?php } ?>
> 
> to this
> 
> ```php
<?php
        if ($order->info['shipping_method']) {
?>
        <h3 id="checkoutConfirmDefaultShipment"><?php echo HEADING_SHIPPING_METHOD; ?></h3>
        <div class="buttonRow forward"><?php echo  '<a href="' . zen_href_link (FILENAME_CHECKOUT_ONE, '', 'SSL') . '">' . zen_image_button (BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
        <h4 id="checkoutConfirmDefaultShipmentTitle"><?php echo $order->info['shipping_method']; ?></h4>
<?php
        }
?>

Cheers / Frank

lat9:

Thanks, @frank18, I'll look to get this into the next release ... with a caveat:

There are payment modules that replace the shipping-address link during the "normal" checkout_confirmation processing. I'll look to more mimic the full checkout_confirmation page on the OPC confirmation one.
@frank18 ... OK, color me confused!:huh:

That "Edit" button shows in both the checkout_one_confirmation and ajax_checkout_confirmation pages and the plugin doesn't distribute the file /includes/templates/YOUR_TEMPLATE/tpl_checkout_one_confirmation_default.php.

From what I can see, reviewing the GitHub changes, that button was added back in August of 2016; perhaps you've made a template-override version that (somehow) got down-level?

Please advise.

22 Apr 2017, 12:14 AM
#412
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: One-Page Checkout [Support Thread]

lat9:

@frank18 ... OK, color me confused!:huh:

That "Edit" button shows in both the checkout_one_confirmation and ajax_checkout_confirmation pages and the plugin doesn't distribute the file /includes/templates/YOUR_TEMPLATE/tpl_checkout_one_confirmation_default.php.

From what I can see, reviewing the GitHub changes, that button was added back in August of 2016; perhaps you've made a template-override version that (somehow) got down-level?

Please advise.

Well... color me embarrassed :shocking: - I sure had to make changes in that template-override file to meet some requirements of this site!! Doh......

My apologies for creating confusion.

Cheers

22 Apr 2017, 12:32 PM
#413
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

lat9:

I have reproduced issue#2 (and created an associated GitHub issue); I'll need a bit of time to attempt to reproduce the first.
I have also reproduced issue#1; I'll post back when a solution is available.

22 Apr 2017, 1:02 PM
#414
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

I have also reproduced issue#1; I'll post back when a solution is available.

Thanks Lat9. We use a temporary solution, once user unchecks the "same address" checkbox, we will hide this checkbox.

22 Apr 2017, 4:47 PM
#415
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

y051313:

Thanks Lat9. We use a temporary solution, once user unchecks the "same address" checkbox, we will hide this checkbox.
I've got the* rather extensive *changes complete and uploaded to the plugin's GitHub repository, if anyone wants to take a look until I get the chance to package these changes up.

23 Apr 2017, 2:28 PM
#416
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

I've just submitted v1.2.0 to the Zen Cart plugins for review and will post back when it's available for download.

This version contains changes associated with the following GitHub issues:

#79: Correct conditionally-enabling the plugin causes checkout-loop.
#80: Add an Edit button to shopping-cart block on checkout pages.
#83: Unwanted "Your order has changed" message received after applying a credit-class order-total to the order.
#85: Correct checkout-loop after a 100%-off coupon is applied to an order.
#86: Correct "Shipping, same as Billing" processing.

... and various documentation edits.

30 Apr 2017, 4:07 PM
#417
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

lat9:

I've just submitted v1.2.0 to the Zen Cart plugins for review and will post back when it's available for download.

This version contains changes associated with the following GitHub issues:

#79: Correct conditionally-enabling the plugin causes checkout-loop.
#80: Add an Edit button to shopping-cart block on checkout pages.
#83: Unwanted "Your order has changed" message received after applying a credit-class order-total to the order.
#85: Correct checkout-loop after a 100%-off coupon is applied to an order.
#86: Correct "Shipping, same as Billing" processing.

... and various documentation edits.
OPC v1.2.0 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095

4 May 2017, 4:00 AM
#418
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

OPC v1.2.0 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095

Hi lat9

I'v upgraded to v1.2.0. When I uncheck the "Shipping Address, Same as Billing?" checkbox, the shipping option list is not updated.

I saw there was a request to page "/ajax.php?act=ajaxOnePageCheckout&method=updateShipping", but the response is messy code like "�š[{�a{�a{�a{�a{�a{�a{'

The returning array in the debug log looks correct.

Any clues?

Thanks
Davis

4 May 2017, 11:33 AM
#419
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Davis, does your store use a custom template? Have you customized the tpl_checkout_one_default.php template in your custom template?

If so, did you merge the template changes (highlighted in the readme) into your template-override version?

5 May 2017, 1:44 PM
#420
y051313 avatar

y051313

New Zenner

Join Date:
Mar 2010
Posts:
54
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Davis, does your store use a custom template? Have you customized the tpl_checkout_one_default.php template in your custom template?

If so, did you merge the template changes (highlighted in the readme) into your template-override version?

Hi lat9

I've replaced all files in the new version.

Seems the issue is with the ob_flush () function on line 185 in file /includes/classes/ajax/zcAjaxOnePageCheckout.php. If I comment this line out, then the module works well.

Best
Davis