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

One-Page Checkout [Support Thread]

Views: 628,963

Results 61 to 80 of 3,073
11 Aug 2016, 20:57
#61
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

One-Page Checkout [Support Thread]

fjbern1943:

Hello,
First let me thank you very much, especially since this is away off topic for this thread.

I will give this a try and see how I make out. Seems like a very reasonable approach.

Frank

OK it didn't work. It produces an error:

[11-Aug-2016 15:36:31 America/Chicago] PHP Warning:  Invalid argument supplied for foreach() in /hsphere/local/home/religiousshop/religious-shop.com/includes/classes/order.php on line 713

Here is Line 712 to 719 in order.php:

712 $shipping_array = $_SESSION['cart']->vendor_shipping;
713  foreach ($shipping_array as $vendors_id => $shipping_data) {
714   $vendors = $db->Execute("select vendors_name from " . TABLE_VENDORS . " where vendors_id = '" . (int)$vendors_id . "'");
715    $vendors_name = 'Unknown';
716   if ($vendors) {
717      $vendors_name = $vendors->fields['vendors_name'];
718    }
719     $shipping_method_array = explode ('_', $shipping_data['id']);

What do you think?

Frank

12 Aug 2016, 11:26
#62
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Frank, I was thinking last night that there's a better way ... and there is.

Rather than going down the config.core.php replacement, simply place the following define statement just before your script loads application_top.php:

define ('CHECKOUT_ONE_ENABLED', 'false');

That definition will "preempt" the database setting and will allow your script to run in "normal" checkout mode regardless the configuration of the One-Page Checkout plugin.

12 Aug 2016, 13:46
#63
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

v1.0.1 is now available for download from the Zen Cart plugins. There are a couple of issues (identified in postings above) that are targeted for a v1.0.2 release, which will most likely happen within the next week.

13 Aug 2016, 00:19
#64
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Frank, I was thinking last night that there's a better way ... and there is.

Rather than going down the config.core.php replacement, simply place the following define statement just before your script loads application_top.php:

define ('CHECKOUT_ONE_ENABLED', 'false');

> That definition will "preempt" the database setting and will allow your script to run in "normal" checkout mode regardless the configuration of the One-Page Checkout plugin.

Hello,

Well it took all my brainpower and a very long investigation to figure this out.  The file we were looking at in post #55 had absolutely nothing to do with my MVS/Vendor plugin.  It was to be used if you wanted to charge freight, not per order but by vendor.  In other words if an order went to two different vendors that file would have been used to charge the customer multiple shipping charges.  When I was working with the plugin developer I had them change the way the plugin work so that the customer was only charged for one freight charge.  Unfortunately they left that file in the distribution but it didn't do anything.  The more I looked at the file the more I realized that it made no sense.  I removed it from the server and placed an order using the standard multi form check out and the order was processed and the vendor information was posted and vendor email was sent..  Just as it was suppose to, even though that file was removed.

I placed another order using the on-page checkout and it processed the order but it did not produce any vendor information or vendor email.

I looked at the standard modules/pages/header_php.php pages and compared them to modules/pages/checkout_one/header_php.php file.

I ended up adding this code: 

$vendor_shipping = $_SESSION['cart']->vendor_shipping(); to the confirmation_one/header_php.php page code, and then ran another test order and guess what it all worked.  Problem solved.  Sorry for being so winded but I wanted you to know the full story

I want to thank you for all your assistance and certainly going the extra mile to help out a fellow zenner.

P.S.  Don't think abut this tonight put your valuable talents to work on something really worth while. Suggestion, a new COWA plugin to go along with the one-page checkout. :-)
14 Aug 2016, 16:26
#65
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

A couple more bugfixes have been posted to the plugin's GitHub repository:

Need to move the customers_auth check to after we know the customer's logged in (there were PHP Notify errors being recorded). Change needed to /includes/modules/pages/checkout_one/header_php.php to move that checking block. Currently:

// -----
// If the plugin's debug-mode is set to "full", then enable ALL error reporting for the checkout_one page.
//
if (CHECKOUT_ONE_DEBUG == 'full') {
    @ini_set('error_reporting', -1 );
}
[B]// -----
// In the "normal" Zen Cart checkout flow, the module /includes/init_includes/init_customer_auth.php performs the
// following check to see that the customer is authorized to checkout.  Rather than changing the code in that
// core-file, we'll repeat that check here.
//
if ($_SESSION['customers_authorization'] != 0) {
    $messageStack->add_session ('header', TEXT_AUTHORIZATION_PENDING_CHECKOUT, 'caution');
    zen_redirect (zen_href_link (FILENAME_DEFAULT));
}[/B]
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
    zen_redirect (zen_href_link (FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
// if the customer is not logged on, redirect them to the login page
if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
    $_SESSION['navigation']->set_snapshot();
    zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
  
} else {
    // validate customer
    if (zen_get_customer_validate_session ($_SESSION['customer_id']) == false) {
        $_SESSION['navigation']->set_snapshot (array ('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_ONEPAGE));
        zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
    
    }
}

to

// -----
// If the plugin's debug-mode is set to "full", then enable ALL error reporting for the checkout_one page.
//
if (CHECKOUT_ONE_DEBUG == 'full') {
    @ini_set('error_reporting', -1 );
}

// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
    zen_redirect (zen_href_link (FILENAME_SHOPPING_CART, '', 'NONSSL'));
}

// if the customer is not logged on, redirect them to the login page
if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
    $_SESSION['navigation']->set_snapshot();
    zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
  
} else {
    // validate customer
    if (zen_get_customer_validate_session ($_SESSION['customer_id']) == false) {
        $_SESSION['navigation']->set_snapshot (array ('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_ONEPAGE));
        zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
    
    }
}
[B]
// -----
// In the "normal" Zen Cart checkout flow, the module /includes/init_includes/init_customer_auth.php performs the
// following check to see that the customer is authorized to checkout.  Rather than changing the code in that
// core-file, we'll repeat that check here.
//
if ($_SESSION['customers_authorization'] != 0) {
    $messageStack->add_session ('header', TEXT_AUTHORIZATION_PENDING_CHECKOUT, 'caution');
    zen_redirect (zen_href_link (FILENAME_DEFAULT));
}[/B]

... essentially, moving that customers_authorization check to after we know the customer's logged in.

I'll identify the other issue in a follow-on post.

14 Aug 2016, 16:33
#66
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Here's the other one:

The "collectsCardDataOnsite" interface changed between Zen Cart 1.5.4 and 1.5.5 and the plugin's using the 1.5.4 version (which was used to verify the authorizenet_aim payment method). Need to update /includes/modules/pages/checkout_one/jscript_main.php to include the ZC 1.5.5 version of the interface as well.

To correct, add the highlighted code sections:

function shippingIsBilling () 
{
    var shippingAddress = document.getElementById ('checkoutOneShipto');
    if (shippingAddress) {
        if (document.getElementById ('shipping_billing').checked) {
            shippingAddress.className = 'hiddenField';
            shippingAddress.setAttribute ('className', 'hiddenField'); 
        } else {
            shippingAddress.className = 'visibleField';
            shippingAddress.setAttribute ('className', 'visibleField');
        }
    }
}

[B]<?php
// -----
// The "collectsCartDataOnsite" interface built into Zen Cart magically transformed between
// Zen Cart 1.5.4 and 1.5.5, so this module for the One-Page Checkout plugin includes both
// forms.  That way, if a payment module was written for 1.5.4 it'll work, ditto for those
// written for the 1.5.5 method.
// 
?>[/B]
function collectsCardDataOnsite(paymentValue)
{
    zcJS.ajax({
        url: "ajax.php?act=ajaxPayment&method=doesCollectsCardDataOnsite",
        data: {paymentValue: paymentValue}
    }).done(function( response ) {
        if (response.data == true) {
            var str = $('form[name="checkout_payment"]').serializeArray();

            zcJS.ajax({
                url: "ajax.php?act=ajaxPayment&method=prepareConfirmation",
                data: str
            }).done(function( response ) {
                $('#checkoutPayment').hide();
                $('#navBreadCrumb').html(response.breadCrumbHtml);
                $('#checkoutPayment').before(response.confirmationHtml);
                $(document).attr('title', response.pageTitle);

            });
        } else {
            zcLog2Console ('collectsCartDataOnsite: submitting form');
            $('form[name="checkout_payment"]')[0].submit();
        }
    });
    return false;
}
[B]
function doesCollectsCardDataOnsite(paymentValue)
{
    if ($('#'+paymentValue+'_collects_onsite').val()) {
        if ($('#pmt-'+paymentValue).is(':checked')) {
            return true;
        }
    }
    return false;
}

function doCollectsCardDataOnsite(paymentValue)
{
    var str = $('form[name="checkout_payment"]').serializeArray();

    zcJS.ajax({
        url: "ajax.php?act=ajaxPayment&method=prepareConfirmation",
        data: str
    }).done(function( response ) {
        $('#checkoutPayment').hide();
        $('#navBreadCrumb').html(response.breadCrumbHtml);
        $('#checkoutPayment').before(response.confirmationHtml);
        $(document).attr('title', response.pageTitle);
    });
}[/B]
19 Aug 2016, 11:59
#67
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.0.2 to the plugins' area for review (if you can't wait, you can download it from either the plugin's GitHub repository or my website).

This version provides changes to address the following issues (as identified by their issue numbers in the plugin's GitHub repository):
#13: Form won't submit under IE-11
#14: Pre-integration with "Product Delivery by Postcode (PDP)"
#17: Missing semi-colon in language file
#18: Error-log generated when the customer has applied a discount coupon
#19: Move customer's authorization check
#20: Include both ZC1.5.4 and 1.5.5 versions of "handlesCreditCardDataOnSite"
#21: Correct interoperation with some shipping methods
#22: Correct AJAX session-save issue
#23: Session time-out handling
#24: Display payment-method block when in "special checkout"

21 Aug 2016, 21:16
#68
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I am using v1.5.4 and template 'Tableau'

Do I have to have FEC installed as well? nothing seems to work correctly;
Reading through the install instructions 'D. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run.' For me this does not happen.
When I go to checkout all the boxes and format is missing.

I have been trying to give you a picture of what is happening but I cannot remember how to get the page in to a displayable picture, sorry.

22 Aug 2016, 11:26
#69
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

adb34:

I am using v1.5.4 and template 'Tableau'

Do I have to have FEC installed as well? nothing seems to work correctly;
Reading through the install instructions 'D. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run.' For me this does not happen.
When I go to checkout all the boxes and format is missing.

I have been trying to give you a picture of what is happening but I cannot remember how to get the page in to a displayable picture, sorry.
You absolutely, positively don't want to have FEC installed to use the One-Page Checkout! That would actually be a disaster waiting to happen.

Once you've copied the plugin's files to your store, changing the YOUR_ADMIN and YOUR_TEMPLATE names appropriately, that click on "Admin Home" installs the plugin's configuration information into the database. Now, go to Configuration->One-Page Checkout Settings and enable the plugin.

22 Aug 2016, 12:11
#70
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:

You absolutely, positively don't want to have FEC installed to use the One-Page Checkout! That would actually be a disaster waiting to happen.....

And a BIG nod from me - this plugin is the best thing since sliced bread was invented. FEC is definitely not needed at all - and, yes, it would be a disaster waiting to happen......

Since I installed this plugin, sales have increased considerably, even had comments from long-standing clients/customers that their checkout experience is so much easier. And since making my favorite payment modules eWay a default selected, it's thumbs up all round.

22 Aug 2016, 12:23
#71
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Thanks for your kind words, @frank18!

22 Aug 2016, 15:15
#72
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

You absolutely, positively don't want to have FEC installed to use the One-Page Checkout! That would actually be a disaster waiting to happen.

Once you've copied the plugin's files to your store, changing the YOUR_ADMIN and YOUR_TEMPLATE names appropriately, that click on "Admin Home" installs the plugin's configuration information into the database. Now, go to Configuration->One-Page Checkout Settings and enable the plugin.

I would love to find out what is happening. I have done all the changes; merges; uploads; Enabled, still looking a mess. I have also uploaded the v1.5.4 put of your plugin. I am wondering if this plugin will not work with 'Tableau' template? I know this template does not like v1.5.5/a. I will try to get you an image of the screen so that you will see what I am on about, but until then.

Question: At part "D. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run." when I login to the backoffice, what should expect to see? should there be a log file?

22 Aug 2016, 16:09
#73
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

You might have some other checkout-related observers installed that are "not helping". Please list the files you've got in your store's /includes/classes/observers folder.

Once you've uploaded the files to your store's file-system and click that "Admin Home" button, you will see the Admin->Configuration->One-Page Checkout Settings menu item which, when clicked, shows you the plugin's current settings. No message is issued.

22 Aug 2016, 19:02
#74
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

You might have some other checkout-related observers installed that are "not helping". Please list the files you've got in your store's /includes/classes/observers folder.

Once you've uploaded the files to your store's file-system and click that "Admin Home" button, you will see the Admin->Configuration->One-Page Checkout Settings menu item which, when clicked, shows you the plugin's current settings. No message is issued.

One-Page Checkout Setting

Version/Release Date 1.0.1 (2016-08-06)
Enable One-Page Checkout? True
Enable One-Page Checkout debug? False
Debug: Customer List Nothing showing

22 Aug 2016, 19:42
#75
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

OK, so you got the plugin installed and enabled. What about the file-list in your store's /includes/classes/observers folder?

If you have this installed on an accessible server (i.e. not a local test setup), you could PM me the link so that I can see for myself what's going on.

26 Aug 2016, 12:30
#76
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I have managed to get a screen shot of my challenge
Attachment 16611

I have been going through the merged files again, but nothing is standing out as a problem

26 Aug 2016, 13:26
#77
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Did you copy the checkout_one.css file to your template's /css folder?

If this isn't a local installation, would you send me a PM with the site's link so that I can see what's going on myself?

26 Aug 2016, 13:27
#78
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I have run the debug 'true' and 'full'. these file a massive 'true' @ just over 64k and full @ 154k. How can I show them without filling every bodies screen?

26 Aug 2016, 15:10
#79
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@adb34, I don't think that the debug file is going to show me anything. As I asked before, do you have a publicly-accessible link for the site? If so, please send it to me via PM.

26 Aug 2016, 16:51
#80
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@adb34, got your PM. The *Tableau *template makes a **ton **of changes to the Zen-Cart standard CSS; for example it's not including the stylesheet_css_buttons.css so that your buttons display wonky and there are many other as-shipped Zen Cart CSS selectors that aren't included.

That's why the page looks so disorganized, since the ***One-Page Checkout ***plugin was designed/tested using templates that conform to the ZC standard.

I don't have free time to debug/determine what changes will be needed for that template to properly support this plugin. I will update the plugin's readme to add a section identifying templates that aren't supported -- Tableau will be noted along with the TM ones.