Page 195 of 281 FirstFirst ... 95145185193194195196197205245 ... LastLast
Results 1,941 to 1,950 of 2809
  1. #1941
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    527
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    A cr@p is enough so that someone familiar with this plugin (or any other chunk of code) can figure out what's going on if the person who made the change is no longer available!

    I hear you about the code that has no comments at all! Way back, I was tasked with creating a simulation model of a Motorola 68000. I found another developer who had created one and asked for a copy of the code to use as a basis.

    When I received the code (a humongous blob, BTW), there was not a single comment. When I asked the developer why, he said "Comments only indicate what the code's intended to do". I hit the delete button and started from scratch.
    I used the term "######## load" the other day. Of course EVERYONE knows what that means...but my smart-alecky friends would not leave me alone. Do you remember the GOTO days with line numbers? OMG without comments it was all spaghetti!

    well darn, I got spanked for a bad word. The replaced word starts with b...has four letters....geez!

  2. #1942
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    527
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    BTW, I really love the one page checkout. Nicely done.

  3. #1943
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: One-Page Checkout [Support Thread]

    I'm not sure if I should post here, or at the bootstrap thread, in case I apologize.

    That said by trying to make some changes to https://www.zen-cart.com/downloads.php?do=file&id=2305 (bootstrap template for OPC) I noticed there are differences in some of php snips, i.e. tpl_modules_opc_shopping_cart.php
    My guess is I could use the "original" OPC template_default one, and need to be confirmed.

    Also how would I add the price per unit to show in the tpl_modules_opc_shopping_cart.php

    Thank you

  4. #1944
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by keneso View Post
    I'm not sure if I should post here, or at the bootstrap thread, in case I apologize.

    That said by trying to make some changes to https://www.zen-cart.com/downloads.php?do=file&id=2305 (bootstrap template for OPC) I noticed there are differences in some of php snips, i.e. tpl_modules_opc_shopping_cart.php
    My guess is I could use the "original" OPC template_default one, and need to be confirmed.

    Also how would I add the price per unit to show in the tpl_modules_opc_shopping_cart.php

    Thank you
    You're in the right support-thread!

    The BS4/OPC makes changes to every one of OPC's template_default/template files (except for tpl_modules_checkout_one_shipping.php), so you'll want to make your subsequent changes to the tpl_modules_opc_shopping_cart.php that's now present in your clone of the bootstrap template's version.

    I've got stuff going on this morning, but will try to get back later today to answer the part about adding the unit-price to that template.

  5. #1945
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: One-Page Checkout [Support Thread]

    Zen Cart 1.5.7b
    Advanced Shipper 6
    OPC 2.3.7

    I'm getting the following message after clicking the Confirm button for an order.
    "Your order's details have changed. Please review the current values and re-submit."

    No values have changed. Total is the sale before clicking Confirm Order as it is after clicking.

    Do you have any suggestions on how I can resolve this?

  6. #1946
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: One-Page Checkout [Support Thread]

    I took a look in the code to find what triggered this error message and saw the
    Code:
    $session_end_hash != $session_start_hash
    check.

    This led me to send the un hashed content of these two to error logs.

    The output was

    [09-Apr-2021 15:16:50 Europe/Paris] start total: £12.14
    [09-Apr-2021 15:16:55 Europe/Paris] end total: £12.14

    Clearly the use of £ vs £ is the issue here.

    $session_end_hash is currently set like
    Code:
    $session_end_hash = $checkout_one->hashSession($currencies->format ($order->info['total']));
    Can anyone suggest the correct way to resolve this?
    Last edited by strelitzia; 9 Apr 2021 at 02:29 PM.

  7. #1947
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: One-Page Checkout [Support Thread]

    I tried to use html_entity_decode like this
    Code:
    $session_end_hash = $checkout_one->hashSession(html_entity_decode ($currencies->format ($order->info['total'])));
    And while
    Code:
    error_log("end total: ".html_entity_decode ($currencies->format ($order->info['total'])));
    gives me the same output as
    Code:
    error_log("start total: ".$_POST['current_order_total']);
    the hash values are still different.

    [09-Apr-2021 15:56:48 Europe/Paris] session end hash: 35ee63b81d1bbd66ebe5a266291de4f6
    [09-Apr-2021 15:56:48 Europe/Paris] session start hash: adc994f5f3b5a08bbada52c1c26ed16c

    So clearly html_entity_decode is not the solution.

  8. #1948
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: One-Page Checkout [Support Thread]

    What CHARSET is in use on the site? Noting that the OPC's observer class (where the hashSession method resides) attempts to convert those HTML entities into their character counterparts:
    Code:
            // -----
            // Add the order's current total to the blob that's being hashed, so that changes in the total based on
            // payment-module selection can be properly detected (e.g. COD fee).
            //
            // Some currencies use a non-ASCII symbol for its symbol, e.g. £.  To ensure that we don't get into
            // a checkout-loop, make sure that the order's current total is scrubbed to convert any "HTML entities"
            // into their character representation.
            //
            // This is needed since the order's current total, as passed into the confirmation page, is created by
            // javascript that captures the character representation of any symbols.
            //
            // Note: Some templates also include carriage-returns within the total's display, so remove them from
            // the mix, too!
            //
            $current_order_total = str_replace(array("\n", "\r"), '', $current_order_total);
            $session_data['order_current_total'] = html_entity_decode($current_order_total, ENT_COMPAT, CHARSET);

  9. #1949
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    What CHARSET is in use on the site?
    define('CHARSET', 'utf-8');

  10. #1950
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: One-Page Checkout [Support Thread]

    I've got this in the error logs.

    PHP Warning: html_entity_decode(): charset `CHARSET' not supported, assuming utf-8 in /Users/steph/Sites/localhost/balloonmarket/includes/classes/observers/class.checkout_one_observer.php on line 732

    Using PHP 7.4

 

 

Similar Threads

  1. Set number of products displayed per page (support thread)
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 146
    Last Post: 2 Nov 2023, 12:50 AM
  2. v151 Banners In Main Page - Support Thread
    By stevesh in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Sep 2021, 03:36 PM
  3. v151 Site Map/Page Not Found: Combined [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 4 Jan 2016, 02:19 PM
  4. v151 PayPal Express Checkout Using NVP 84.0 [Support Thread]
    By lat9 in forum Addon Payment Modules
    Replies: 32
    Last Post: 28 Dec 2015, 04:54 PM
  5. Checkout Amazon Style -- Support Thread
    By CJPinder in forum All Other Contributions/Addons
    Replies: 72
    Last Post: 13 Apr 2011, 08:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR