
Originally Posted by
flappingfish
I have seen the undefined strip select issue before.. I would suggest checking your settings and that you have added the opc to stripe like it stated in the instructions. Other possible solutions include swapping files from different versions of the module until you get it working or give up and restore what you originally had and stick with 3 page checkout. I tried 4 versions before I got mine remedied with an issue that resulted in payments but no orders :)
With the heavy customisation and big bills i was given to do them i made use of chatgpt to do alot of the heavy work and pay for the monthly subscription plan, i threw your error codes at it and it gave quite a helpful response (sometimes it can be way off the mark) and this seems like the solution is in the settings for stripe where it asks if you are using OPC not being selected, if it is selected and still giving you issues then follow the chatbots guidance....
Code:
You’re seeing the “Undefined variable $stripe_select” warnings because neither your one-page checkout controller nor your template ever actually set that variable before including your Stripe JavaScript snippets. You have two choices:
1) Define $stripe_select before you use it
If you really need the variable (for example you’re injecting a dynamic element ID into your JS), then at the very top of
swift
Copy
Edit
includes/modules/pages/checkout_one_confirmation/jscript_stripe.php
(and in your tpl at the top of
bash
Copy
Edit
templates/abyss_cobalt/templates/tpl_checkout_one_confirmation_default.php
) add:
php
Copy
Edit
<?php
// make sure we always have *something* in $stripe_select
if ( !isset($stripe_select) || !strlen($stripe_select) ) {
// this should be the ID of your Stripe wrapper element—
// change it if you’re mounting to a different DIV
$stripe_select = 'payment-element';
}
?>
That will stop the notices and give your JS something to target:
php
Copy
Edit
<script>
// before: document.getElementById('<?php echo $stripe_select;?>')…
// now $stripe_select is guaranteed to exist
const paymentEl = document.getElementById('<?php echo $stripe_select;?>');
…
</script>
2) Remove the variable altogether
If your Stripe integration no longer needs a PHP-injected element ID (for example you hard-coded #payment-element in your JS), simply delete every reference to $stripe_select:
In jscript_stripe.php remove or comment out any lines using $stripe_select.
In your template (around line 238), replace
php
Copy
Edit
document.getElementById('<?php echo $stripe_select;?>').…
with
js
Copy
Edit
document.getElementById('payment-element').…
Why it happened
Zen Cart’s one-page checkout stashes almost everything in $POST and in the $payment_modules object—you have to explicitly assign template-scope variables if you intend to echo them later. Since $stripe_select was never set in the controller, PHP correctly warned that it didn’t exist.
Pick one of the above strategies and those warnings will go away.
Sounds like a credible solution... take file and database backups first and thoroughly test if all seems to show up, ie make sure you can submit an order and it get recorded by zencart
Bookmarks