Re: One-Page Checkout [Support Thread]
I do have an additional question, a bit more related to this module in specific. I intend on offering several payment methods such as Money Orders and COD. I feel it would be best to have different landing pages after checking out based on the selection chosen. Similar to how when the credit card option is chosen you are redirected to the "checkout_one_confirmation" page instead of "checkout_success", I would need a separate button or link that appears when these options are selected that takes the customer to the predefined pages "payment_instructions" and "COD_terms".
Thank you and regards
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
Koda
I do have an additional question, a bit more related to this module in specific. I intend on offering several payment methods such as Money Orders and COD. I feel it would be best to have different landing pages after checking out based on the selection chosen. Similar to how when the credit card option is chosen you are redirected to the "checkout_one_confirmation" page instead of "checkout_success", I would need a separate button or link that appears when these options are selected that takes the customer to the predefined pages "payment_instructions" and "COD_terms".
Thank you and regards
Interesting idea! On the initial entry to the checkout_success page, the session-variable ($_SESSION['order_summary']) is copied to the variable $order_summary and that session-value is removed (enabling after-order tracking scripts to 'know' to send only once).
The payment method used for the order is present in $order_summary['payment_module_code']. You could modify /includes/modules/pages/checkout_success/main_template_vars.php (as provided by OPC) to check for (a) the presence of that variable and then (b) change the name of the $checkout_success_template to display after-order instructions to your customers.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Yes, that was corrected in OPC v2.3.2.
Upgraded from 2.3.1 to 2.3.2 but my issue still persist.
Re: One-Page Checkout [Support Thread]
Well, :censored:, I missed that one. You can edit /includes/modules/pages/checkout_one/jquery.checkout_one.js, finding
Code:
function changeShippingFields(event)
{
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneShipto .opc-buttons, #opc-ship-save').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneShipto').removeClass('visibleField');
jQuery('#checkoutOneShipto').addClass('opc-view');
}
and changing to
Code:
function changeShippingFields(event)
{
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneShipto .opc-buttons, #opc-ship-save, #opc-add-ship, #opc-add-ship+label').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneShipto').removeClass('visibleField');
jQuery('#checkoutOneShipto').addClass('opc-view');
}
If your site is using minified scripts, you'll need to push that unminified version through a minifier; I use https://jscompress.com/.
2 Attachment(s)
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Well, :censored:, I missed that one. You can edit /includes/modules/pages/checkout_one/jquery.checkout_one.js, finding
Code:
function changeShippingFields(event)
{
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneShipto .opc-buttons, #opc-ship-save').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneShipto').removeClass('visibleField');
jQuery('#checkoutOneShipto').addClass('opc-view');
}
and changing to
Code:
function changeShippingFields(event)
{
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneShipto .opc-buttons, #opc-ship-save, #opc-add-ship, #opc-add-ship+label').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneShipto').removeClass('visibleField');
jQuery('#checkoutOneShipto').addClass('opc-view');
}
If your site is using minified scripts, you'll need to push that unminified version through a minifier; I use
https://jscompress.com/.
Still no luck.
I tried OPC 2.3.2 on a fresh install of ZC 1.5.6 with no add on but the same thing happens.
Shipping address is not being registered in the address book.
Attachment 19038
I am not an expert but I added the following code in /templates/templates_default/tpl_checkout_shipping_address_default.php
Code:
<?php
if ($show_add_address) {
?>
<?php echo zen_draw_checkbox_field("add_address['ship']", 'style="display:inline"','1', false, 'id="opc-add-ship"' . $parameters); ?>
<label class="checkboxLabel custom-control-label" for="add_address['ship']" title="<?php echo TITLE_ADD_TO_ADDRESS_BOOK; ?>"><?php echo TEXT_ADD_TO_ADDRESS_BOOK; ?></label>
<?php
The check box and text is displayed but it did not fix my problem of the address not being registered in the address book. OPC is really great but this issue has me clueless.
Attachment 19039
I also apologize for pushing on my issue and appreciate everyone trying to help.
Thank you again
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Well, :censored:, I missed that one. You can edit /includes/modules/pages/checkout_one/jquery.checkout_one.js, finding
Code:
function changeShippingFields(event)
{
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneShipto .opc-buttons, #opc-ship-save').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneShipto').removeClass('visibleField');
jQuery('#checkoutOneShipto').addClass('opc-view');
}
and changing to
Code:
function changeShippingFields(event)
{
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneShipto .opc-buttons, #opc-ship-save, #opc-add-ship, #opc-add-ship+label').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneShipto').removeClass('visibleField');
jQuery('#checkoutOneShipto').addClass('opc-view');
}
If your site is using minified scripts, you'll need to push that unminified version through a minifier; I use
https://jscompress.com/.
Please disregard my previous post. Your solution seems to have fixed it.
Once I set one page checkout minified to false as well as js loader to false, the "add address box showed up".
I do have another question though.
How can I make the box checked by default? so the shipping address is automatically saved to address book without having customer checking the box.
Thank you
Re: One-Page Checkout [Support Thread]
To have those "Save to Address Book" elements checked by default, you'll need to make a template-override of both the tpl_modules_opc_billing_address.php and tpl_modules_opc_shipping_address.php.
For the shipping-address, it's this block in the shipping-related file:
Code:
<?php
if ($show_add_address) {
?>
<?php echo zen_draw_checkbox_field("add_address['ship']", '1', false, 'id="opc-add-ship"' . $parameters); ?>
<label class="checkboxLabel custom-control-label" for="add_address['ship']" title="<?php echo TITLE_ADD_TO_ADDRESS_BOOK; ?>"><?php echo TEXT_ADD_TO_ADDRESS_BOOK; ?></label>
<?php
}
?>
There's a similar block in the billing-address script. Just 'flip' that false to true to change the default for those checkboxes.
Re: One-Page Checkout [Support Thread]
I'm having a problem with this on a client site using authorize.net.
Zen Cart 1.5.5e
One-Page 2.3.2
When using a.net and clicking checkout I get the spinning circle and then the page reloads and I'm still in checkout. Checking the error logs, I see the error below. Oddly, that is not my ip address.
Here's what I think is going on. I installed and tested the plugin on a development site. But not with authorize.net. This is new now that Payeezy stopped working. When I made the dev site live, I copied the customer tables from the live site to the dev site. This of course wiped out the changes one-page does upon installation so I ran:
ALTER TABLE `orders` ADD COLUMN `is_guest_order` tinyint(1) NOT NULL DEFAULT '0';
Is there something else I should have done to ensure this will work when moving from dev to live? I did search the thread thinking this may have been covered but was unable to find an answer.
[10-Jun-2020 16:25:41 America/New_York] Request URI: /ADMIN/customers.php?page=1&cID=11098, IP address: 208.123.180.13
#1 array_merge() called at [/home2/austrao6/public_html/ADMIN/customers.php:1184]
[10-Jun-2020 16:25:41 America/New_York] PHP Warning: array_merge(): Argument #1 is not an array in /home2/austrao6/public_html/Du1262Mj/customers.php on line 1184
[10-Jun-2020 16:25:41 America/New_York] Request URI: /ADMIN/customers.php?page=1&cID=11098, IP address: 208.123.180.13
#1 array_merge() called at [/home2/austrao6/public_html/ADMIN/customers.php:1186]
[10-Jun-2020 16:25:41 America/New_York] PHP Warning: array_merge(): Argument #2 is not an array in /home2/austrao6/public_html/ADMIN/customers.php on line 1186
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jeking
I'm having a problem with this on a client site using authorize.net.
Zen Cart 1.5.5e
One-Page 2.3.2
When using a.net and clicking checkout I get the spinning circle and then the page reloads and I'm still in checkout. Checking the error logs, I see the error below. Oddly, that is not my ip address.
Here's what I think is going on. I installed and tested the plugin on a development site. But not with authorize.net. This is new now that Payeezy stopped working. When I made the dev site live, I copied the customer tables from the live site to the dev site. This of course wiped out the changes one-page does upon installation so I ran:
ALTER TABLE `orders` ADD COLUMN `is_guest_order` tinyint(1) NOT NULL DEFAULT '0';
Is there something else I should have done to ensure this will work when moving from dev to live? I did search the thread thinking this may have been covered but was unable to find an answer.
[10-Jun-2020 16:25:41 America/New_York] Request URI: /ADMIN/customers.php?page=1&cID=11098, IP address: 208.123.180.13
#1 array_merge() called at [/home2/austrao6/public_html/ADMIN/customers.php:1184]
[10-Jun-2020 16:25:41 America/New_York] PHP Warning: array_merge(): Argument #1 is not an array in /home2/austrao6/public_html/Du1262Mj/customers.php on line 1184
[10-Jun-2020 16:25:41 America/New_York] Request URI: /ADMIN/customers.php?page=1&cID=11098, IP address: 208.123.180.13
#1 array_merge() called at [/home2/austrao6/public_html/ADMIN/customers.php:1186]
[10-Jun-2020 16:25:41 America/New_York] PHP Warning: array_merge(): Argument #2 is not an array in /home2/austrao6/public_html/ADMIN/customers.php on line 1186
First, that's an admin-log created by customers.php which OPC doesn't touch.
Pulling in the customer (and presumably address-book) records from the live store that didn't have OPC installed has, though, wiped out the guest-related records. You can cause OPC's admin initialization script to recreate these records by running the following query (either in phpMyAdmin, where you need also to include the site's DB_PREFIX, or via the admin's Install SQL Patches):
Code:
DELETE FROM configuration WHERE configuration_key IN ('CHECKOUT_ONE_GUEST_CUSTOMER_ID', 'CHECKOUT_ONE_GUEST_BILLTO_ADDRESS_BOOK_ID', 'CHECKOUT_ONE_GUEST_SENDTO_ADDRESS_BOOK_ID');
I don't know what's causing the checkout/confirmation loop. Is there anything in the browser's console log, seen by pressing F12 on most browsers then inspecting the 'Console' tab's information.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Pulling in the customer (and presumably address-book) records from the live store that didn't have OPC installed has, though, wiped out the guest-related records. You can cause OPC's admin initialization script to recreate these records by running the following query (either in phpMyAdmin, where you need also to include the site's DB_PREFIX, or via the admin's Install SQL Patches):
Code:
DELETE FROM configuration WHERE configuration_key IN ('CHECKOUT_ONE_GUEST_CUSTOMER_ID', 'CHECKOUT_ONE_GUEST_BILLTO_ADDRESS_BOOK_ID', 'CHECKOUT_ONE_GUEST_SENDTO_ADDRESS_BOOK_ID');
I don't know what's causing the checkout/confirmation loop. Is there anything in the browser's console log, seen by pressing F12 on most browsers then inspecting the 'Console' tab's information.
Wiping out the guest-related record was the culprit. Running the query did the trick. Thank you!! :clap: