Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Set a menu category to Paypal Checkout only?
Author « Topic »  

ITZAP
Ecommerce Template Guru

Australia
1017 Posts

Posted - 07/31/2024 :  18:02:55  
I have websites where the active Payment Providers are:
(1) PayPal Checkout.
(2) Email: EFT Bank Deposit into nominated Account.

Is it possible to set Products entered into a particular Menu Category to accept (1) PayPal Checkout only ?

Gary

ITZAP
Ecommerce Template Guru

Australia
1017 Posts

Posted - 08/08/2024 :  19:12:17  
Presume the answer to this question is NO.

Gary

dbdave
ECT Moderator

USA
10408 Posts

Posted - 08/08/2024 :  21:00:14  
I prefer to do this type of thing with javascript in the DOM and avoid hacking the back end code.
It should not be too much trouble to check the products in the cart - and hide the selection for the email payment selection.
While this can be undone in the browser, most folks would never know how to do it, and if they do, I would cancel their order.

I'm .asp and I would use that to check the products in the cart against the category, or maybe easier a keyword in the search terms, or a custom field, and if found, use javascript to hide that email payment option.

I'm not that good with .php, and I am pretty busy with a new project, but maybe with this idea, someone can help.

This would be done in your cart.php page after the include line that calls up the cart.

step 1 - check for product - need php code
end result is true or false if product exists

step 2 (verified works - with radio payment options - code is commented)
<script>
var phpcheck = [your php variable goes here and should resolve to true or false]
if (document.getElementsByClassName("copayradio1")[0] && phpcheck == true){ //check to see if the an excluded product exists and be sure the payment options are showing.
var noemlpmt = document.getElementsByClassName("copayradio1") //get the payment radio divs
for( i = 0; i < noemlpmt.length; i++ ){ //loop through the payment radio divs
text = document.getElementsByClassName("copayradio1")[i].innerHTML; //get the inner text of the payment radio divs
noemlpmtz = text.includes("EFT") //check to see if word "EFT" is in the div - will resolve to true if found
if (noemlpmtz == true){
document.getElementsByClassName("copayradio1")[i].style.display='none' //hide the payment radio that has the word EFT in it.
}}}
</script>


That's half the work there. confirmed works.

Thanks,
David

Edited by - dbdave on 08/08/2024 21:07:28
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000